/*============================================================================= Copyright (c) 1999-2003 Jaakko Järvi Copyright (c) 2001-2003 Joel de Guzman Use, modification and distribution is 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(FUSION_SEQUENCE_DETAIL_AS_TUPLE_ELEMENT_HPP) #define FUSION_SEQUENCE_DETAIL_AS_TUPLE_ELEMENT_HPP #include #if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # include # include # include # include #endif namespace boost { namespace fusion { namespace detail { #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct as_tuple_element { typedef T type; }; template struct as_tuple_element > { typedef T& type; }; #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) template struct as_tuple_element const> { typedef T& type; }; #endif template struct as_tuple_element { typedef const T(&type)[N]; }; template struct as_tuple_element { typedef const volatile T(&type)[N]; }; template struct as_tuple_element { typedef const volatile T(&type)[N]; }; #else // The Non-PTS version cannot accept arrays since there is no way to // get the element type of an array T[N]. However, we shall provide // the most common case where the array is a char[N] or wchar_t[N]. // Doing so will allow literal string argument types. template struct maybe_string { typedef typename mpl::eval_if< is_array , mpl::eval_if< is_convertible , mpl::identity , mpl::eval_if< is_convertible , mpl::identity , mpl::identity > > , mpl::identity >::type type; }; template struct as_tuple_element { typedef typename mpl::eval_if< is_reference_wrapper , add_reference::type> , maybe_string >::type type; }; #endif }}} #endif