forked from boostorg/fusion
Merge remote-tracking branch 'origin/develop' into feature/constexpr
This commit is contained in:
@ -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
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace traits
|
||||
{
|
||||
template <typename T> struct deduce;
|
||||
@ -86,6 +90,21 @@ namespace boost { namespace fusion { namespace traits
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
// Also unwrap C++11 std::ref if available (referencee cv is deduced)
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
template <typename T>
|
||||
struct deduce<std::reference_wrapper<T> &>
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct deduce<std::reference_wrapper<T> const &>
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
#endif
|
||||
|
||||
// Keep references on arrays, even if const
|
||||
|
||||
template <typename T, int N>
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
@ -25,6 +29,14 @@ namespace boost { namespace fusion { namespace detail
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
template <typename T>
|
||||
struct as_fusion_element<std::reference_wrapper<T> >
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T, int N>
|
||||
struct as_fusion_element<T[N]>
|
||||
{
|
||||
|
Reference in New Issue
Block a user