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

@ -68,4 +68,23 @@ namespace boost { namespace fusion { namespace detail
# define BOOST_FUSION_FWD_ELEM(type, value) std::forward<type>(value)
#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