forked from boostorg/fusion
Support removing the C++11 standard reference wrappers.
This commit is contained in:
@ -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