/*============================================================================= Copyright (c) 2007 Tobias Schwinger Use modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). ==============================================================================*/ #if !defined(BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED) #define BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED #include #include #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL #include #endif namespace boost { namespace fusion { namespace traits { template struct deduce; //----- ---- --- -- - - - - // Non-references pass unchanged template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; // Keep references on mutable LValues template struct deduce { typedef T & type; }; template struct deduce { typedef T volatile& type; }; // Store away potential RValues template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; // Unwrap Boost.RefS (referencee cv is deduced) template struct deduce & > { typedef T& type; }; template struct deduce const & > { typedef T& type; }; // Also unwrap C++11 std::ref if available (referencee cv is deduced) #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL template struct deduce &> { typedef T& type; }; template struct deduce const &> { typedef T& type; }; #endif // Keep references on arrays, even if const template struct deduce { typedef T(&type)[N]; }; template struct deduce { typedef volatile T(&type)[N]; }; template struct deduce { typedef const T(&type)[N]; }; template struct deduce { typedef const volatile T(&type)[N]; }; }}} #endif