1 /*=============================================================================
2     Copyright (c) 2006-2007 Tobias Schwinger
3 
4     Use modification and distribution are 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 
9 #if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_ACCESS_HPP_INCLUDED)
10 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_ACCESS_HPP_INCLUDED
11 
12 namespace boost { namespace fusion { namespace detail
13 {
14     // const reference deduction for function templates that accept T const &
15     template <typename T> struct cref               { typedef T const& type; };
16     template <typename T> struct cref<T&>           { typedef T const& type; };
17     template <typename T> struct cref<T const>      { typedef T const& type; };
18 
19     // mutable reference deduction for function templates that accept T &
20     template <typename T> struct mref               { typedef T      & type; };
21     template <typename T> struct mref<T&>           { typedef T      & type; };
22 
23     // generic reference deduction for function templates that are overloaded
24     // to accept both T const & and T &
25     template <typename T> struct gref               { typedef T const& type; };
26     template <typename T> struct gref<T&>           { typedef T      & type; };
27     template <typename T> struct gref<T const>      { typedef T const& type; };
28 
29     // appropriately qualified target function in const context
30     template <typename T> struct qf_c          { typedef T const  type; };
31     template <typename T> struct qf_c<T const> { typedef T const  type; };
32     template <typename T> struct qf_c<T &>     { typedef T        type; };
33 
34     // appropriately qualified target function in non-const context
35     template <typename T> struct qf            { typedef T        type; };
36     template <typename T> struct qf<T const>   { typedef T const  type; };
37     template <typename T> struct qf<T &>       { typedef T        type; };
38 }}}
39 
40 #endif
41 
42