Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2006-2007 Tobias Schwinger
|
Chris@16
|
3
|
Chris@16
|
4 Use modification and distribution are subject to the Boost Software
|
Chris@16
|
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
6 http://www.boost.org/LICENSE_1_0.txt).
|
Chris@16
|
7 ==============================================================================*/
|
Chris@16
|
8
|
Chris@16
|
9 #if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_ACCESS_HPP_INCLUDED)
|
Chris@16
|
10 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_ACCESS_HPP_INCLUDED
|
Chris@16
|
11
|
Chris@16
|
12 namespace boost { namespace fusion { namespace detail
|
Chris@16
|
13 {
|
Chris@16
|
14 // const reference deduction for function templates that accept T const &
|
Chris@16
|
15 template <typename T> struct cref { typedef T const& type; };
|
Chris@16
|
16 template <typename T> struct cref<T&> { typedef T const& type; };
|
Chris@16
|
17 template <typename T> struct cref<T const> { typedef T const& type; };
|
Chris@16
|
18
|
Chris@16
|
19 // mutable reference deduction for function templates that accept T &
|
Chris@16
|
20 template <typename T> struct mref { typedef T & type; };
|
Chris@16
|
21 template <typename T> struct mref<T&> { typedef T & type; };
|
Chris@16
|
22
|
Chris@16
|
23 // generic reference deduction for function templates that are overloaded
|
Chris@16
|
24 // to accept both T const & and T &
|
Chris@16
|
25 template <typename T> struct gref { typedef T const& type; };
|
Chris@16
|
26 template <typename T> struct gref<T&> { typedef T & type; };
|
Chris@16
|
27 template <typename T> struct gref<T const> { typedef T const& type; };
|
Chris@16
|
28
|
Chris@16
|
29 // appropriately qualified target function in const context
|
Chris@16
|
30 template <typename T> struct qf_c { typedef T const type; };
|
Chris@16
|
31 template <typename T> struct qf_c<T const> { typedef T const type; };
|
Chris@16
|
32 template <typename T> struct qf_c<T &> { typedef T type; };
|
Chris@16
|
33
|
Chris@16
|
34 // appropriately qualified target function in non-const context
|
Chris@16
|
35 template <typename T> struct qf { typedef T type; };
|
Chris@16
|
36 template <typename T> struct qf<T const> { typedef T const type; };
|
Chris@16
|
37 template <typename T> struct qf<T &> { typedef T type; };
|
Chris@16
|
38 }}}
|
Chris@16
|
39
|
Chris@16
|
40 #endif
|
Chris@16
|
41
|