mirror of
https://github.com/boostorg/unordered.git
synced 2025-11-07 11:11:41 +01:00
Attempt to work around Visual C++ initializer list overload bug.
I'm hoping that these templated initializer lists will be considered a better overload than the others. I have no idea if it will actually work, this is a real shot in the dark. The enable_if checks should probably be for implicit conversion, there might be a chance this could override a valid call when there's an explicit conversion. [SVN r86419]
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
#include <initializer_list>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
@@ -402,6 +406,16 @@ namespace unordered
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
void insert(std::initializer_list<value_type>);
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
|
||||
template <typename T>
|
||||
typename boost::enable_if_c<
|
||||
boost::is_convertible<T, value_type>::value,
|
||||
void>::type insert(std::initializer_list<T> list)
|
||||
{
|
||||
table_.insert_range(list.begin(), list.end());
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
iterator erase(const_iterator);
|
||||
@@ -872,6 +886,16 @@ namespace unordered
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
void insert(std::initializer_list<value_type>);
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
|
||||
template <typename T>
|
||||
typename boost::enable_if_c<
|
||||
boost::is_convertible<T, value_type>::value,
|
||||
void>::type insert(std::initializer_list<T> list)
|
||||
{
|
||||
table_.insert_range(list.begin(), list.end());
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
iterator erase(const_iterator);
|
||||
|
||||
Reference in New Issue
Block a user