1 /*============================================================================= 2 Copyright (c) 1999-2003 Jaakko Jarvi 3 Copyright (c) 2001-2011 Joel de Guzman 4 5 Distributed under the Boost Software License, Version 1.0. (See accompanying 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 ==============================================================================*/ 8 #if !defined(FUSION_AS_FUSION_ELEMENT_05052005_0338) 9 #define FUSION_AS_FUSION_ELEMENT_05052005_0338 10 11 #include <boost/fusion/support/config.hpp> 12 #include <boost/ref.hpp> 13 14 #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL 15 #include <functional> 16 #endif 17 18 namespace boost { namespace fusion { namespace detail 19 { 20 template <typename T> 21 struct as_fusion_element 22 { 23 typedef T type; 24 }; 25 26 template <typename T> 27 struct as_fusion_element<reference_wrapper<T> > 28 { 29 typedef T& type; 30 }; 31 32 #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL 33 template <typename T> 34 struct as_fusion_element<std::reference_wrapper<T> > 35 { 36 typedef T& type; 37 }; 38 #endif 39 40 template <typename T, int N> 41 struct as_fusion_element<T[N]> 42 { 43 typedef const T(&type)[N]; 44 }; 45 46 template <typename T, int N> 47 struct as_fusion_element<volatile T[N]> 48 { 49 typedef const volatile T(&type)[N]; 50 }; 51 52 template <typename T, int N> 53 struct as_fusion_element<const volatile T[N]> 54 { 55 typedef const volatile T(&type)[N]; 56 }; 57 58 }}} 59 60 #endif 61