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:
Kohei Takahashi
2015-02-05 23:04:36 +09:00
parent 5e4978b870
commit 6ab68a29d8
21 changed files with 202 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)
# pragma warning(pop)
#endif

View File

@ -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

View File

@ -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