Fixes Ticket #12534: flat_map fails to compile if included after type_traits is instantiated under gcc

This commit is contained in:
Ion Gaztañaga
2016-11-25 23:56:33 +01:00
parent d3ea3468de
commit 5e4a107e82
2 changed files with 1 additions and 30 deletions

View File

@@ -428,36 +428,6 @@ inline void swap(pair<T1, T2>& x, pair<T1, T2>& y)
} //namespace container_detail {
} //namespace container {
//Without this specialization recursive flat_(multi)map instantiation fails
//because is_enum needs to instantiate the recursive pair, leading to a compilation error).
//This breaks the cycle clearly stating that pair is not an enum avoiding any instantiation.
template<class T>
struct is_enum;
template<class T, class U>
struct is_enum< ::boost::container::container_detail::pair<T, U> >
{
static const bool value = false;
};
template<class T, class U>
struct is_enum< ::std::pair<T, U> >
{
static const bool value = false;
};
template <class T>
struct is_class;
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
template <class T1, class T2>
struct is_class< ::boost::container::container_detail::pair<T1, T2> >
{
static const bool value = true;
};
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class T1, class T2>