diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-01-12 18:41:34 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-01-13 10:36:26 (GMT) |
commit | f3bc816af1b0d61452de973963e453bf3b3f95a2 (patch) | |
tree | e895f8afa3580e6cff6f5ad2017d45bf147a17c2 /3rdParty/Boost/src/boost/proto/transform/detail/pack.hpp | |
parent | 188fc285c6555eadd3c9d50ab8a94adcade78d89 (diff) | |
download | swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.zip swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.tar.bz2 |
Adding in the spirit Boost stuff
Change-Id: I4f127ce61667243b64081b0aa309028d5077045f
Diffstat (limited to '3rdParty/Boost/src/boost/proto/transform/detail/pack.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/transform/detail/pack.hpp | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/proto/transform/detail/pack.hpp b/3rdParty/Boost/src/boost/proto/transform/detail/pack.hpp new file mode 100644 index 0000000..863e7a0 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/transform/detail/pack.hpp @@ -0,0 +1,97 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file pack.hpp +/// Contains helpers for pseudo-pack expansion. +// +// Copyright 2012 Eric Niebler. Distributed under 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) + +#ifndef BOOST_PROTO_TRANSFORM_DETAIL_PACK_HPP_EAN_2012_07_11 +#define BOOST_PROTO_TRANSFORM_DETAIL_PACK_HPP_EAN_2012_07_11 + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/arithmetic/sub.hpp> +#include <boost/preprocessor/punctuation/comma_if.hpp> +#include <boost/preprocessor/repetition/enum.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_trailing_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> +#include <boost/preprocessor/repetition/repeat.hpp> +#include <boost/preprocessor/iteration/local.hpp> +#include <boost/preprocessor/iteration/iterate.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/proto/proto_fwd.hpp> + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma warning(push) +# pragma warning(disable: 4348) // redefinition of default parameter +#endif + +namespace boost { namespace proto +{ + namespace detail + { + template<typename Fun> + struct msvc_fun_workaround; + + template<typename Tfx, typename T> + struct expand_pattern_helper + { + typedef T type; + typedef mpl::false_ applied; + }; + + template<typename Tfx, typename Fun> + struct expand_pattern_helper<Tfx, Fun *> + : expand_pattern_helper<Tfx, Fun> + {}; + + template<typename Tfx, typename T> + struct expand_pattern_helper<Tfx, pack(T)> + { + // BUGBUG fix me. See comment in transform/detail/call.hpp + BOOST_MPL_ASSERT_MSG( + (is_same<T, _>::value) + , PACK_EXPANSIONS_OF_EXPRESSIONS_OTHER_THAN_THE_CURRENT_NOT_YET_SUPPORTED + , (T) + ); + typedef Tfx type(T); + typedef mpl::true_ applied; + }; + + template<typename Tfx> + struct expand_pattern_helper<Tfx, pack(_)> + { + typedef Tfx type; + typedef mpl::true_ applied; + }; + + #include <boost/proto/transform/detail/expand_pack.hpp> + + template<long Arity, typename Fun, typename Cont> + struct expand_pattern; + + template<typename Fun, typename Cont> + struct expand_pattern<0, Fun, Cont> + : Cont::template cat<typename expand_pattern_helper<proto::_value, Fun>::type> + { + BOOST_MPL_ASSERT_MSG( + (expand_pattern_helper<proto::_value, Fun>::applied::value) + , NO_PACK_EXPRESSION_FOUND_IN_PACK_EXPANSION + , (Fun) + ); + }; + + #include <boost/proto/transform/detail/pack_impl.hpp> + } +}} + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma warning(pop) +#endif + +#endif |