summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/variant/recursive_variant.hpp')
-rw-r--r--3rdParty/Boost/src/boost/variant/recursive_variant.hpp63
1 files changed, 37 insertions, 26 deletions
diff --git a/3rdParty/Boost/src/boost/variant/recursive_variant.hpp b/3rdParty/Boost/src/boost/variant/recursive_variant.hpp
index c4cd3b0..071d0f9 100644
--- a/3rdParty/Boost/src/boost/variant/recursive_variant.hpp
+++ b/3rdParty/Boost/src/boost/variant/recursive_variant.hpp
@@ -21,15 +21,15 @@
#include "boost/mpl/aux_/lambda_arity_param.hpp"
-#if !defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
-# include "boost/mpl/eval_if.hpp"
-# include "boost/mpl/identity.hpp"
-# include "boost/mpl/protect.hpp"
-# include "boost/mpl/transform.hpp"
-#else
-# include "boost/preprocessor/cat.hpp"
-# include "boost/preprocessor/repeat.hpp"
-#endif
+#include "boost/mpl/equal.hpp"
+#include "boost/mpl/eval_if.hpp"
+#include "boost/mpl/identity.hpp"
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/protect.hpp"
+#include "boost/mpl/transform.hpp"
+#include "boost/type_traits/is_same.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/repeat.hpp"
#include "boost/mpl/bool.hpp"
#include "boost/mpl/is_sequence.hpp"
@@ -74,34 +74,48 @@ template <
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity)
>
struct substitute<
- ::boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >
+ ::boost::variant<
+ ::boost::detail::variant::over_sequence< T0 >
+ , BOOST_VARIANT_ENUM_SHIFTED_PARAMS(T)
+ >
, RecursiveVariant
, ::boost::recursive_variant_
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(Arity)
>
{
+private:
-#if !defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
-
-private: // helpers, for metafunction result (below)
-
- typedef typename mpl::eval_if<
- ::boost::detail::variant::is_over_sequence<T0>
- , mpl::identity< T0 >
- , make_variant_list< BOOST_VARIANT_ENUM_PARAMS(T) >
- >::type initial_types;
+ typedef T0 initial_types;
typedef typename mpl::transform<
initial_types
, mpl::protect< quoted_enable_recursive<RecursiveVariant,mpl::true_> >
>::type types;
-public: // metafunction result
-
- typedef ::boost::variant< types > type;
+public:
-#else // defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
+ typedef typename mpl::if_<
+ mpl::equal<initial_types, types, ::boost::is_same<mpl::_1, mpl::_2> >
+ , ::boost::variant<
+ ::boost::detail::variant::over_sequence< T0 >
+ , BOOST_VARIANT_ENUM_SHIFTED_PARAMS(T)
+ >
+ , ::boost::variant< over_sequence<types> >
+ >::type type;
+};
+template <
+ BOOST_VARIANT_ENUM_PARAMS(typename T)
+ , typename RecursiveVariant
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity)
+ >
+struct substitute<
+ ::boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >
+ , RecursiveVariant
+ , ::boost::recursive_variant_
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(Arity)
+ >
+{
private: // helpers, for metafunction result (below)
#define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS(z,N,_) \
@@ -123,9 +137,6 @@ private: // helpers, for metafunction result (below)
public: // metafunction result
typedef ::boost::variant< BOOST_VARIANT_ENUM_PARAMS(wknd_T) > type;
-
-#endif // BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT workaround
-
};
#else // defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)