]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2009 Joel de Guzman | |
3 | Copyright (c) 2005-2006 Dan Marsden | |
4 | Copyright (c) 2010 Christopher Schmidt | |
5 | ||
6 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | ==============================================================================*/ | |
9 | ||
10 | #ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP | |
11 | #define BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP | |
12 | ||
13 | #include <boost/fusion/support/config.hpp> | |
14 | #include <boost/type_traits/remove_const.hpp> | |
15 | #include <boost/type_traits/remove_reference.hpp> | |
16 | #include <boost/fusion/support/as_const.hpp> | |
17 | #include <boost/fusion/adapted/struct/detail/extension.hpp> | |
18 | ||
19 | namespace boost { namespace fusion | |
20 | { | |
21 | namespace detail | |
22 | { | |
23 | template <typename T, typename Dummy> | |
24 | struct get_identity | |
25 | : remove_const<typename remove_reference<T>::type> | |
26 | {}; | |
27 | } | |
28 | ||
29 | namespace extension | |
30 | { | |
31 | // Overload as_const() to unwrap adt_attribute_proxy. | |
32 | template <typename T, int N, bool Const> | |
33 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
34 | typename adt_attribute_proxy<T, N, Const>::type as_const(const adt_attribute_proxy<T, N, Const>& proxy) | |
35 | { | |
36 | return proxy.get(); | |
37 | } | |
38 | } | |
39 | }} | |
40 | ||
41 | #endif |