|
||||
File indexing completed on 2025-01-31 10:02:38
0001 /*============================================================================= 0002 Copyright (c) 2001-2014 Joel de Guzman 0003 http://spirit.sourceforge.net/ 0004 0005 Distributed under the Boost Software License, Version 1.0. (See accompanying 0006 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0007 =============================================================================*/ 0008 #if !defined(BOOST_SPIRIT_X3_IS_VARIANT_JAN_10_2012_0823AM) 0009 #define BOOST_SPIRIT_X3_IS_VARIANT_JAN_10_2012_0823AM 0010 0011 #include <boost/variant.hpp> 0012 #include <boost/mpl/has_xxx.hpp> 0013 #include <boost/mpl/bool.hpp> 0014 0015 namespace boost { namespace spirit { namespace x3 { namespace traits 0016 { 0017 namespace detail 0018 { 0019 // By declaring a nested struct in your class/struct, you tell 0020 // spirit that it is regarded as a variant type. The minimum 0021 // required interface for such a variant is that it has constructors 0022 // for various types supported by your variant and a typedef 'types' 0023 // which is an mpl sequence of the contained types. 0024 // 0025 // This is an intrusive interface. For a non-intrusive interface, 0026 // use the is_variant trait. 0027 BOOST_MPL_HAS_XXX_TRAIT_DEF(adapted_variant_tag) 0028 } 0029 0030 template <typename T, typename Enable = void> 0031 struct is_variant 0032 : detail::has_adapted_variant_tag<T> 0033 {}; 0034 0035 template <BOOST_VARIANT_ENUM_PARAMS(typename T)> 0036 struct is_variant<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>> 0037 : mpl::true_ 0038 {}; 0039 }}}} 0040 0041 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |