1 //-----------------------------------------------------------------------------
2 // boost variant/detail/enable_recursive_fwd.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_FWD_HPP
14 #define BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_FWD_HPP
16 #include "boost/mpl/aux_/config/ctps.hpp"
18 #include "boost/mpl/bool_fwd.hpp"
20 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
21 # include "boost/mpl/bool.hpp"
23 # include "boost/type_traits/is_base_and_derived.hpp"
27 namespace detail
{ namespace variant
{
29 ///////////////////////////////////////////////////////////////////////////////
30 // (detail) tag recursive_flag
32 // Signifies that the variant should perform recursive substituion.
35 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
43 #else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
45 struct recursive_flag_tag
56 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
58 ///////////////////////////////////////////////////////////////////////////////
59 // (detail) metafunction is_recursive_flag
61 // Signifies that the variant should perform recursive substituion.
64 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
67 struct is_recursive_flag
73 struct is_recursive_flag
< recursive_flag
<T
> >
78 #else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
81 struct is_recursive_flag
82 : is_base_and_derived
< recursive_flag_tag
,T
>
86 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
88 ///////////////////////////////////////////////////////////////////////////////
89 // (detail) metafunction enable_recursive
91 // Attempts recursive_variant_ tag substitution, wrapping with
92 // boost::recursive_wrapper if substituion occurs w/ non-indirect result
93 // (i.e., not a reference or pointer) *and* NoWrapper is false_.
97 , typename RecursiveVariant
98 , typename NoWrapper
= mpl::false_
100 struct enable_recursive
;
102 ///////////////////////////////////////////////////////////////////////////////
103 // (detail) metafunction class quoted_enable_recursive
105 // Same behavior as enable_recursive metafunction (see above).
108 typename RecursiveVariant
109 , typename NoWrapper
= mpl::false_
111 struct quoted_enable_recursive
;
113 }} // namespace detail::variant
116 #endif // BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_FWD_HPP