forked from boostorg/fusion
reduce number of template instantiations
[SVN r53566]
This commit is contained in:
@@ -7,12 +7,8 @@
|
||||
#if !defined(FUSION_ACCESS_04182005_0737)
|
||||
#define FUSION_ACCESS_04182005_0737
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
@@ -33,22 +29,35 @@ namespace boost { namespace fusion { namespace detail
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct non_ref_parameter
|
||||
struct call_param
|
||||
{
|
||||
typedef typename boost::remove_cv<T>::type const& type;
|
||||
typedef T const& type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct call_param
|
||||
struct call_param<T &>
|
||||
{
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
is_reference<T>
|
||||
, mpl::identity<T>
|
||||
, non_ref_parameter<T>
|
||||
>::type
|
||||
type;
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct call_param<T const>
|
||||
{
|
||||
typedef T const& type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct call_param<T volatile>
|
||||
{
|
||||
typedef T const& type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct call_param<T const volatile>
|
||||
{
|
||||
typedef T const& type;
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user