forked from boostorg/fusion
Workaround for LWG 2408: SFINAE-friendly std::iterator_traits.
Now available for GCC(libstdc++v3) < 4.5 and MSVC 12.0. It means, there is no ambiguous about calling next/prior/... via ADL.
This commit is contained in:
@ -109,4 +109,13 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Array, int Pos>
|
||||||
|
struct iterator_traits< ::boost::fusion::array_iterator<Array, Pos> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -207,6 +207,15 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Cons>
|
||||||
|
struct iterator_traits< ::boost::fusion::boost_tuple_iterator<Cons> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,6 +114,15 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Iterator>
|
||||||
|
struct iterator_traits< ::boost::fusion::mpl_iterator<Iterator> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +106,15 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Tuple, int Index>
|
||||||
|
struct iterator_traits< ::boost::fusion::std_tuple_iterator<Tuple, Index> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,4 +118,13 @@ namespace boost { namespace fusion {
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Seq, int Pos>
|
||||||
|
struct iterator_traits< ::boost::fusion::deque_iterator<Seq, Pos> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -98,4 +98,13 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Cons>
|
||||||
|
struct iterator_traits< ::boost::fusion::cons_iterator<Cons> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -163,4 +163,13 @@ namespace boost { namespace fusion
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Seq, int Pos>
|
||||||
|
struct iterator_traits< ::boost::fusion::map_iterator<Seq, Pos> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,5 +48,14 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Vector, int N>
|
||||||
|
struct iterator_traits< ::boost::fusion::vector_iterator<Vector, N> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -144,4 +144,13 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Tag, typename Category, typename Seq, int Index>
|
||||||
|
struct iterator_traits< ::boost::fusion::basic_iterator<Tag, Category, Seq, Index> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -135,4 +135,13 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Derived, typename Iterator, typename Category>
|
||||||
|
struct iterator_traits< ::boost::fusion::iterator_adapter<Derived, Iterator, Category> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,4 +56,13 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Derived, typename Category>
|
||||||
|
struct iterator_traits< ::boost::fusion::iterator_facade<Derived, Category> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,4 +68,23 @@ namespace boost { namespace fusion { namespace detail
|
|||||||
# define BOOST_FUSION_FWD_ELEM(type, value) std::forward<type>(value)
|
# define BOOST_FUSION_FWD_ELEM(type, value) std::forward<type>(value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Workaround for LWG 2408: C++17 SFINAE-friendly std::iterator_traits.
|
||||||
|
// http://cplusplus.github.io/LWG/lwg-defects.html#2408
|
||||||
|
//
|
||||||
|
// - GCC 4.5 enables the feature under C++11.
|
||||||
|
// https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01105.html
|
||||||
|
//
|
||||||
|
// - Only MSVC 12.0 doesn't have the feature.
|
||||||
|
#if (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 40500) && \
|
||||||
|
defined(BOOST_LIBSTDCXX11)) || \
|
||||||
|
(defined(BOOST_MSVC) && (BOOST_MSVC == 1800))
|
||||||
|
# define BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename>
|
||||||
|
struct iterator_traits;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -67,6 +67,15 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Category, typename First, typename Last, typename Pred>
|
||||||
|
struct iterator_traits< ::boost::fusion::filter_iterator<Category, First, Last, Pred> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,6 +194,15 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
};
|
};
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename First, typename Base>
|
||||||
|
struct iterator_traits< ::boost::fusion::flatten_view_iterator<First, Base> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -56,6 +56,15 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Category, typename First, typename Last, typename Concat>
|
||||||
|
struct iterator_traits< ::boost::fusion::joint_view_iterator<Category, First, Last, Concat> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +54,15 @@ namespace boost { namespace fusion
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Sequence, typename Pos>
|
||||||
|
struct iterator_traits< ::boost::fusion::nview_iterator<Sequence, Pos> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,5 +53,14 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename Sequence, typename Pos>
|
||||||
|
struct iterator_traits< ::boost::fusion::repetitive_view_iterator<Sequence, Pos> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,5 +54,14 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename First>
|
||||||
|
struct iterator_traits< ::boost::fusion::reverse_view_iterator<First> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -50,6 +50,15 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename SingleView, typename Pos>
|
||||||
|
struct iterator_traits< ::boost::fusion::single_view_iterator<SingleView, Pos> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (BOOST_MSVC)
|
#if defined (BOOST_MSVC)
|
||||||
# pragma warning(pop)
|
# pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
@ -76,5 +76,17 @@ namespace boost { namespace fusion
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename First, typename F>
|
||||||
|
struct iterator_traits< ::boost::fusion::transform_view_iterator<First, F> >
|
||||||
|
{ };
|
||||||
|
template <typename First1, typename First2, typename F>
|
||||||
|
struct iterator_traits< ::boost::fusion::transform_view_iterator2<First1, First2, F> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -46,4 +46,13 @@ namespace boost { namespace fusion {
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename IteratorSequence, typename Traversal>
|
||||||
|
struct iterator_traits< ::boost::fusion::zip_view_iterator<IteratorSequence, Traversal> >
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user