source: NonGTP/Boost/boost/spirit/fusion/detail/access.hpp @ 857

Revision 857, 1.5 KB checked in by igarcia, 18 years ago (diff)
Line 
1/*=============================================================================
2    Copyright (c) 2003 Joel de Guzman
3
4    Use, modification and distribution is subject to the Boost Software
5    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6    http://www.boost.org/LICENSE_1_0.txt)
7==============================================================================*/
8#if !defined(FUSION_DETAIL_ACCESS_HPP)
9#define FUSION_DETAIL_ACCESS_HPP
10
11#include <boost/spirit/fusion/detail/config.hpp>
12#include <boost/mpl/eval_if.hpp>
13#include <boost/mpl/identity.hpp>
14#include <boost/type_traits/add_const.hpp>
15#include <boost/type_traits/add_reference.hpp>
16#include <boost/type_traits/is_reference.hpp>
17#include <boost/type_traits/remove_cv.hpp>
18
19namespace boost { namespace fusion { namespace detail
20{
21    template <typename T>
22    struct ref_result
23    {
24        typedef typename add_reference<FUSION_GET_TYPE(T)>::type type;
25    };
26
27    template <typename T>
28    struct cref_result
29    {
30        typedef typename add_reference<
31            typename add_const<FUSION_GET_TYPE(T)>::type
32        >::type type;
33    };
34
35    template <typename T>
36    struct non_ref_parameter
37    {
38        typedef typename boost::remove_cv<T>::type const& type;
39    };
40
41    template <typename T>
42    struct call_param
43    {
44        typedef
45            typename mpl::eval_if<
46                is_reference<T>
47              , mpl::identity<T>
48              , non_ref_parameter<T>
49            >::type
50        type;
51    };
52}}}
53
54#endif
55
Note: See TracBrowser for help on using the repository browser.