diff --git a/include/boost/parameter.hpp b/include/boost/parameter.hpp deleted file mode 100755 index 87d8542..0000000 --- a/include/boost/parameter.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright David Abrahams, Daniel Wallin 2005. 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) - -#ifndef BOOST_PARAMETER_050401_HPP -#define BOOST_PARAMETER_050401_HPP - -#include -#include -#include -#include -#include -#include -#include - -#endif // BOOST_PARAMETER_050401_HPP - diff --git a/include/boost/parameter/aux_/arg_list.hpp b/include/boost/parameter/aux_/arg_list.hpp deleted file mode 100755 index 404bfd6..0000000 --- a/include/boost/parameter/aux_/arg_list.hpp +++ /dev/null @@ -1,459 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef ARG_LIST_050329_HPP -#define ARG_LIST_050329_HPP - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace boost { namespace parameter { - -// Forward declaration for aux::arg_list, below. -template struct keyword; - -namespace aux { - -// -// Structures used to build the tuple of actual arguments. The -// tuple is a nested cons-style list of arg_list specializations -// terminated by an empty_arg_list. -// -// Each specialization of arg_list is derived from its successor in -// the list type. This feature is used along with using -// declarations to build member function overload sets that can -// match against keywords. -// - -// MPL sequence support -struct arg_list_tag; - -// Terminates arg_list<> and represents an empty list. Since this -// is just the terminating case you might want to look at arg_list -// first, to get a feel for what's really happening here. - -struct empty_arg_list -{ - empty_arg_list() {} - - // Constructor taking BOOST_PARAMETER_MAX_ARITY empty_arg_list - // arguments; this makes initialization - empty_arg_list( - BOOST_PP_ENUM_PARAMS( - BOOST_PARAMETER_MAX_ARITY, void_ BOOST_PP_INTERCEPT - )) - {} - - // A metafunction class that, given a keyword and a default - // type, returns the appropriate result type for a keyword - // lookup given that default - struct binding - { - template - struct apply - { - typedef Default type; - }; - }; - -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - // Terminator for has_key, indicating that the keyword is unique - template - static no_tag has_key(KW*); -#endif - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ - || (BOOST_WORKAROUND(__GNUC__, < 3)) \ - || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - - // The overload set technique doesn't work with these older - // compilers, so they need some explicit handholding. - - // A metafunction class that, given a keyword, returns the type - // of the base sublist whose get() function can produce the - // value for that key - struct key_owner - { - template - struct apply - { - typedef empty_arg_list type; - }; - }; - - template - T& get(default_ x) const - { - return x.value; - } - - template - typename result_of0::type - get(lazy_default x) const - { - return x.compute_default(); - } -#endif - - // If this function is called, it means there is no argument - // in the list that matches the supplied keyword. Just return - // the default value. - template - Default& operator[](default_ x) const - { - return x.value; - } - - // If this function is called, it means there is no argument - // in the list that matches the supplied keyword. Just evaluate - // and return the default value. - template - typename result_of0::type - operator[]( - BOOST_PARAMETER_lazy_default_fallback x) const - { - return x.compute_default(); - } - - // No argument corresponding to ParameterRequirements::key_type - // was found if we match this overload, so unless that parameter - // has a default, we indicate that the actual arguments don't - // match the function's requirements. - template - static typename ParameterRequirements::has_default - satisfies(ParameterRequirements*); - - // MPL sequence support - typedef empty_arg_list type; // convenience - typedef arg_list_tag tag; // For dispatching to sequence intrinsics -}; - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -template -no_tag operator*(empty_arg_list, KW*); -#endif - -// Forward declaration for arg_list::operator, -template -struct tagged_argument; - -// Forward declaration for arg_list::operator[], with -// IS_XXX helper -struct maybe_base; - -template -struct is_maybe - : is_base_and_derived -{}; - -template -struct get_reference -{ - typedef typename T::reference type; -}; - -// A tuple of tagged arguments, terminated with empty_arg_list. -// Every TaggedArg is an instance of tagged_argument<>. -template -struct arg_list : Next -{ - typedef arg_list self; - typedef typename TaggedArg::key_type key_type; - - typedef typename is_maybe::type holds_maybe; - - typedef typename mpl::eval_if< - holds_maybe - , get_reference - , get_reference - >::type reference; - - typedef typename mpl::if_< - holds_maybe - , reference - , typename TaggedArg::value_type - >::type value_type; - - TaggedArg arg; // Stores the argument - - // Store the arguments in successive nodes of this list - template< // class A0, class A1, ... - BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, class A) - > - arg_list( // A0& a0, A1& a1, ... - BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PARAMETER_MAX_ARITY, A, & a) - ) - : Next( // a1, a2, ... - BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PARAMETER_MAX_ARITY, a) - , void_reference() - ) - , arg(a0) - {} - - // Create a new list by prepending arg to a copy of tail. Used - // when incrementally building this structure with the comma - // operator. - arg_list(TaggedArg arg, Next const& tail) - : Next(tail) - , arg(arg) - {} - - // A metafunction class that, given a keyword and a default - // type, returns the appropriate result type for a keyword - // lookup given that default - struct binding - { - template - struct apply - { - typedef typename mpl::eval_if< - boost::is_same - , mpl::identity - , mpl::apply_wrap2 - >::type type; - }; - }; - -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && !BOOST_WORKAROUND(__GNUC__, == 2) -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - friend yes_tag operator*(arg_list, key_type*); -# define BOOST_PARAMETER_CALL_HAS_KEY(next, key) (*(next*)0 * (key*)0) -# else - // Overload for key_type, so the assert below will fire if the - // same keyword is used again - static yes_tag has_key(key_type*); - using Next::has_key; - -# define BOOST_PARAMETER_CALL_HAS_KEY(next, key) next::has_key((key*)0) -# endif - - BOOST_MPL_ASSERT_MSG( - sizeof(BOOST_PARAMETER_CALL_HAS_KEY(Next,key_type)) == sizeof(no_tag) - , duplicate_keyword, (key_type) - ); - -# undef BOOST_PARAMETER_CALL_HAS_KEY -#endif - // - // Begin implementation of indexing operators for looking up - // specific arguments by name - // - - // Helpers that handle the case when TaggedArg is - // empty. - template - reference get_default(D const&, mpl::false_) const - { - return arg.value; - } - - template - reference get_default(D const& d, mpl::true_) const - { - return arg.value ? arg.value.get() : arg.value.construct(d.value); - } - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ - || BOOST_WORKAROUND(__GNUC__, < 3) \ - || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - // These older compilers don't support the overload set creation - // idiom well, so we need to do all the return type calculation - // for the compiler and dispatch through an outer function template - - // A metafunction class that, given a keyword, returns the base - // sublist whose get() function can produce the value for that - // key. - struct key_owner - { - template - struct apply - { - typedef typename mpl::eval_if< - boost::is_same - , mpl::identity > - , mpl::apply_wrap1 - >::type type; - }; - }; - - // Outer indexing operators that dispatch to the right node's - // get() function. - template - typename mpl::apply_wrap2::type - operator[](keyword const& x) const - { - typename mpl::apply_wrap1::type const& sublist = *this; - return sublist.get(x); - } - - template - typename mpl::apply_wrap2::type - operator[](default_ x) const - { - typename mpl::apply_wrap1::type const& sublist = *this; - return sublist.get(x); - } - - template - typename mpl::apply_wrap2< - binding,KW - , typename result_of0::type - >::type - operator[](lazy_default x) const - { - typename mpl::apply_wrap1::type const& sublist = *this; - return sublist.get(x); - } - - // These just return the stored value; when empty_arg_list is - // reached, indicating no matching argument was passed, the - // default is returned, or if no default_ or lazy_default was - // passed, compilation fails. - reference get(keyword const&) const - { - BOOST_MPL_ASSERT_NOT((holds_maybe)); - return arg.value; - } - - template - reference get(default_ const& d) const - { - return get_default(d, holds_maybe()); - } - - template - reference get(lazy_default) const - { - return arg.value; - } - -#else - - reference operator[](keyword const&) const - { - BOOST_MPL_ASSERT_NOT((holds_maybe)); - return arg.value; - } - - template - reference operator[](default_ const& d) const - { - return get_default(d, holds_maybe()); - } - - template - reference operator[](lazy_default) const - { - return arg.value; - } - - // Builds an overload set including operator[]s defined in base - // classes. - using Next::operator[]; - - // - // End of indexing support - // - - - // - // For parameter_requirements matching this node's key_type, - // return a bool constant wrapper indicating whether the - // requirements are satisfied by TaggedArg. Used only for - // compile-time computation and never really called, so a - // declaration is enough. - // - template - static typename mpl::apply1::type - satisfies( - parameter_requirements* - ); - - // Builds an overload set including satisfies functions defined - // in base classes. - using Next::satisfies; -#endif - - // Comma operator to compose argument list without using parameters<>. - // Useful for argument lists with undetermined length. - template - arg_list, self> - operator,(tagged_argument x) const - { - return arg_list, self>(x, *this); - } - - // MPL sequence support - typedef self type; // Convenience for users - typedef Next tail_type; // For the benefit of iterators - typedef arg_list_tag tag; // For dispatching to sequence intrinsics -}; - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) // ETI workaround -template <> struct arg_list {}; -#endif - -// MPL sequence support -template -struct arg_list_iterator -{ - typedef mpl::forward_iterator_tag category; - - // The incremented iterator - typedef arg_list_iterator next; - - // dereferencing yields the key type - typedef typename ArgumentPack::key_type type; -}; - -template <> -struct arg_list_iterator {}; - -}} // namespace parameter::aux - -// MPL sequence support -namespace mpl -{ - template <> - struct begin_impl - { - template - struct apply - { - typedef parameter::aux::arg_list_iterator type; - }; - }; - - template <> - struct end_impl - { - template - struct apply - { - typedef parameter::aux::arg_list_iterator type; - }; - }; -} - -} // namespace boost - -#endif // ARG_LIST_050329_HPP - diff --git a/include/boost/parameter/aux_/cast.hpp b/include/boost/parameter/aux_/cast.hpp deleted file mode 100755 index 8c3f114..0000000 --- a/include/boost/parameter/aux_/cast.hpp +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright Daniel Wallin 2006. 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) - -#ifndef BOOST_PARAMETER_CAST_060902_HPP -# define BOOST_PARAMETER_CAST_060902_HPP - -# include -# include - -namespace boost { namespace parameter { namespace aux { - -# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - -# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate) value - -# else - -// Handles possible implicit casts. Used by preprocessor.hpp to -// normalize user input. -// -// cast::execute() is identity -// cast::execute() is identity -// cast::execute() casts to X -// -// preprocessor.hpp uses this like this: -// -// #define X(value, predicate) -// cast::execute(value) -// -// X(something, *) -// X(something, *(predicate)) -// X(something, (int)) - -template -struct cast; - -template <> -struct cast -{ - template - static U& execute(U& value) - { - return value; - } -}; - -template -struct cast - : cast -{ -}; - -template -struct cast -{ - typedef typename boost::add_reference< - typename boost::add_const::type - >::type reference; - - static reference execute(reference value) - { - return value; - } -}; - -# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate) \ - boost::parameter::aux::cast::execute(value) - -# endif - -}}} // namespace boost::parameter::aux - -#endif // BOOST_PARAMETER_CAST_060902_HPP - diff --git a/include/boost/parameter/aux_/default.hpp b/include/boost/parameter/aux_/default.hpp deleted file mode 100755 index ee90b95..0000000 --- a/include/boost/parameter/aux_/default.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef DEFAULT_050329_HPP -#define DEFAULT_050329_HPP - -namespace boost { namespace parameter { namespace aux { - -// A wrapper for the default value passed by the user when resolving -// the value of the parameter with the given Keyword -template -struct default_ -{ - default_(Value& x) - : value(x) - {} - - Value& value; -}; - -// -// lazy_default -- -// -// A wrapper for the default value computation function passed by -// the user when resolving the value of the parameter with the -// given keyword -// -#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300) -// These compilers need a little extra help with overload -// resolution; we have empty_arg_list's operator[] accept a base -// class to make that overload less preferable. -template -struct lazy_default_base -{ - lazy_default_base(DefaultComputer const& x) - : compute_default(x) - {} - DefaultComputer const& compute_default; -}; - -template -struct lazy_default - : lazy_default_base - { - lazy_default(DefaultComputer const & x) - : lazy_default_base(x) - {} - }; -# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base -#else -template -struct lazy_default -{ - lazy_default(const DefaultComputer& x) - : compute_default(x) - {} - DefaultComputer const& compute_default; -}; -# define BOOST_PARAMETER_lazy_default_fallback lazy_default -#endif - -}}} // namespace boost::parameter::aux - -#endif // DEFAULT_050329_HPP - diff --git a/include/boost/parameter/aux_/maybe.hpp b/include/boost/parameter/aux_/maybe.hpp deleted file mode 100755 index ddb06e0..0000000 --- a/include/boost/parameter/aux_/maybe.hpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright Daniel Wallin 2006. 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) - -#ifndef BOOST_PARAMETER_MAYBE_060211_HPP -# define BOOST_PARAMETER_MAYBE_060211_HPP - -# include -# include -# include -# include -# include -# include -# include - -namespace boost { namespace parameter { namespace aux { - -struct maybe_base {}; - -template -struct maybe : maybe_base -{ - typedef typename mpl::if_< - is_reference - , T - , typename add_reference< -# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - T const -# else - typename add_const::type -# endif - >::type - >::type reference; - - explicit maybe(T value) - : value(value) - , constructed(false) - {} - - maybe() - : constructed(false) - {} - - ~maybe() - { - if (constructed) - destroy((void(*)(reference))0); - } - - reference construct(reference value) const - { - return value; - } - - template - reference construct(U const& value, void(*)(V&)) const - { - new (m_storage.bytes) V(value); - constructed = true; - return *(V*)m_storage.bytes; - } - - template - reference construct(U const& value) const - { - return construct(value, (void(*)(reference))0); - } - - template - void destroy(void(*)(U&)) - { - ((U*)m_storage.bytes)->~U(); - } - - typedef reference(maybe::*safe_bool)() const; - - operator safe_bool() const - { - return value ? &maybe::get : 0 ; - } - - reference get() const - { - return value.get(); - } - -private: - boost::optional value; - mutable bool constructed; - mutable typename boost::python::detail::referent_storage< - reference - >::type m_storage; -}; - -}}} // namespace boost::parameter::aux - -#endif // BOOST_PARAMETER_MAYBE_060211_HPP - diff --git a/include/boost/parameter/aux_/overloads.hpp b/include/boost/parameter/aux_/overloads.hpp deleted file mode 100755 index 406682d..0000000 --- a/include/boost/parameter/aux_/overloads.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright David Abrahams, Daniel Wallin 2003. 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) - -// This file generates overloads in this format: -// -// template -// typename mpl::apply_wrap1< -// aux::make_arg_list< -// PS0,A0 -// , aux::make_arg_list< -// PS1,A1 -// , mpl::identity -// > -// > -// , unnamed_list -// >::type -// operator()(A0 const& a0, A1 const& a1) const -// { -// typedef typename mpl::apply_wrap1< -// aux::make_arg_list< -// PS0,A0 -// , aux::make_arg_list< -// PS1,A1 -// , mpl::identity -// > -// > -// >::type arg_tuple; -// -// return arg_tuple( -// a0 -// , a1 -// , aux::void_() -// ... -// ); -// } -// - -#if !defined(BOOST_PP_IS_ITERATING) -# error Boost.Parameters - do not include this file! -#endif - -#define N BOOST_PP_ITERATION() - -#define BOOST_PARAMETER_open_list(z, n, text) \ - aux::make_arg_list< \ - BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n), aux::tag_keyword_arg - -#define BOOST_PARAMETER_close_list(z, n, text) > - -#define BOOST_PARAMETER_arg_list(n) \ - mpl::apply_wrap1< \ - BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \ - , mpl::always \ - BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \ - , unnamed_list> - -template -typename BOOST_PARAMETER_arg_list(N)::type -operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const -{ - typedef typename BOOST_PARAMETER_arg_list(N)::type arg_tuple; - - return arg_tuple( - BOOST_PP_ENUM_PARAMS(N, a) - BOOST_PP_ENUM_TRAILING_PARAMS( - BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N) - , aux::void_reference() BOOST_PP_INTERCEPT - )); -} - -#undef BOOST_PARAMETER_arg_list -#undef BOOST_PARAMETER_open_list -#undef BOOST_PARAMETER_close_list -#undef N - diff --git a/include/boost/parameter/aux_/parameter_requirements.hpp b/include/boost/parameter/aux_/parameter_requirements.hpp deleted file mode 100755 index ad7a129..0000000 --- a/include/boost/parameter/aux_/parameter_requirements.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef PARAMETER_REQUIREMENTS_050331_HPP -#define PARAMETER_REQUIREMENTS_050331_HPP - -namespace boost { namespace parameter { namespace aux { - -// Used to pass static information about parameter requirements -// through the satisfies() overload set (below). The -// matched function is never invoked, but its type indicates whether -// a parameter matches at compile-time -template -struct parameter_requirements -{ - typedef Keyword keyword; - typedef Predicate predicate; - typedef HasDefault has_default; -}; - -}}} // namespace boost::parameter::aux - -#endif // PARAMETER_REQUIREMENTS_050331_HPP diff --git a/include/boost/parameter/aux_/parenthesized_type.hpp b/include/boost/parameter/aux_/parenthesized_type.hpp deleted file mode 100755 index c6ddd77..0000000 --- a/include/boost/parameter/aux_/parenthesized_type.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright David Abrahams 2006. 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_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP -# define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP - -# include -# include - -namespace boost { namespace parameter { namespace aux { - -// A macro that takes a parenthesized C++ type name (T) and transforms -// it into an un-parenthesized type expression equivalent to T. -# define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \ - boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type - -// A metafunction that transforms void(*)(T) -> T -template -struct unaryfunptr_arg_type; - -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - -template -struct unaryfunptr_arg_type -{ - typedef Arg type; -}; - -# else - -// Use the "native typeof" bugfeatures of older versions of MSVC to -// accomplish what we'd normally do with partial specialization. This -// capability was discovered by Igor Chesnokov. - -# if BOOST_WORKAROUND(BOOST_MSVC, != 1300) - -// This version applies to VC6.5 and VC7.1 (except that we can just -// use partial specialization for the latter in this case). - -// This gets used as a base class. -template -struct msvc_type_memory -{ - // A nullary metafunction that will yield the Value type "stored" - // at this Address. - struct storage; -}; - -template -struct msvc_store_type : msvc_type_memory
-{ - // VC++ somehow lets us define the base's nested storage - // metafunction here, where we have the Value type we'd like to - // "store" in it. Later we can come back to the base class and - // extract the "stored type." - typedef msvc_type_memory
location; - struct location::storage - { - typedef Value type; - }; -}; - -# else - -// This slightly more complicated version of the same thing is -// required for msvc-7.0 -template -struct msvc_type_memory -{ - template - struct storage_impl; - - typedef storage_impl storage; -}; - -template -struct msvc_store_type : msvc_type_memory
-{ - // Rather than supplying a definition for the base class' nested - // class, we specialize the base class' nested template - template<> - struct storage_impl - { - typedef Value type; - }; -}; - -# endif - -// Function template argument deduction does many of the same things -// as type matching during partial specialization, so we call a -// function template to "store" T into the type memory addressed by -// void(*)(T). -template -msvc_store_type -msvc_store_argument_type(void(*)(T)); - -template -struct unaryfunptr_arg_type -{ - // We don't want the function to be evaluated, just instantiated, - // so protect it inside of sizeof. - enum { dummy = sizeof(msvc_store_argument_type((FunctionPointer)0)) }; - - // Now pull the type out of the instantiated base class - typedef typename msvc_type_memory::storage::type type; -}; - -# endif - -template <> -struct unaryfunptr_arg_type -{ - typedef void type; -}; - -}}} // namespace boost::parameter::aux - -#endif // BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP diff --git a/include/boost/parameter/aux_/preprocessor/flatten.hpp b/include/boost/parameter/aux_/preprocessor/flatten.hpp deleted file mode 100755 index 2bd7539..0000000 --- a/include/boost/parameter/aux_/preprocessor/flatten.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright Daniel Wallin 2005. 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) - -#ifndef BOOST_PARAMETER_FLATTEN_051217_HPP -# define BOOST_PARAMETER_FLATTEN_051217_HPP - -# include -# include -# include -# include -# include -# include -# include - -# include - -# define BOOST_PARAMETER_FLATTEN_SPLIT_required required, -# define BOOST_PARAMETER_FLATTEN_SPLIT_optional optional, - -# define BOOST_PARAMETER_FLATTEN_SPLIT(sub) \ - BOOST_PP_CAT(BOOST_PARAMETER_FLATTEN_SPLIT_, sub) - -# define BOOST_PARAMETER_FLATTEN_QUALIFIER(sub) \ - BOOST_PP_SPLIT(0, BOOST_PARAMETER_FLATTEN_SPLIT(sub)) - -# define BOOST_PARAMETER_FLATTEN_ARGS(sub) \ - BOOST_PP_SPLIT(1, BOOST_PARAMETER_FLATTEN_SPLIT(sub)) - -# define BOOST_PARAMETER_FLATTEN_ARITY_optional(arities) \ - BOOST_PP_TUPLE_ELEM(3,0,arities) - -# define BOOST_PARAMETER_FLATTEN_ARITY_required(arities) \ - BOOST_PP_TUPLE_ELEM(3,1,arities) - -# define BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~ -# define BOOST_PARAMETER_FLATTEN_SPEC0(r, n, elem, data) \ - (( \ - BOOST_PP_TUPLE_ELEM(3,2,data) \ - , BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3,0,data)) elem \ - BOOST_PP_ENUM_TRAILING( \ - BOOST_PP_SUB( \ - BOOST_PP_TUPLE_ELEM(3,1,data) \ - , BOOST_PP_TUPLE_ELEM(3,0,data) \ - ) \ - , BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM \ - , ~ \ - ) \ - )) - -# define BOOST_PARAMETER_FLATTEN_SPEC_AUX(r, arity, max_arity, spec) \ - BOOST_PARAMETER_FOR_EACH_R( \ - r \ - , arity \ - , BOOST_PARAMETER_FLATTEN_ARGS(spec) \ - , (arity, max_arity, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec)) \ - , BOOST_PARAMETER_FLATTEN_SPEC0 \ - ) - -# define BOOST_PARAMETER_FLATTEN_SPEC(r, arities, spec) \ - BOOST_PARAMETER_FLATTEN_SPEC_AUX( \ - r \ - , BOOST_PP_CAT( \ - BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \ - )(arities) \ - , BOOST_PP_TUPLE_ELEM(3,2,arities) \ - , spec \ - ) - -# define BOOST_PARAMETER_FLATTEN(optional_arity, required_arity, wanted_arity, specs) \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_PARAMETER_FLATTEN_SPEC \ - , ( \ - optional_arity, required_arity \ - , wanted_arity \ - ) \ - , specs \ - ) - -#endif // BOOST_PARAMETER_FLATTEN_051217_HPP - diff --git a/include/boost/parameter/aux_/preprocessor/for_each.hpp b/include/boost/parameter/aux_/preprocessor/for_each.hpp deleted file mode 100755 index 0eb1f70..0000000 --- a/include/boost/parameter/aux_/preprocessor/for_each.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright Daniel Wallin 2005. 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) - -#ifndef BOOST_PARAMETER_FOR_EACH_051217_HPP -# define BOOST_PARAMETER_FOR_EACH_051217_HPP - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# define BOOST_PARAMETER_FOR_EACH_head_aux2(x,y) (x,y), ~ -# define BOOST_PARAMETER_FOR_EACH_head_aux3(x,y,z) (x,y,z), ~ -# define BOOST_PARAMETER_FOR_EACH_head_aux4(x,y,z,u) (x,y,z,u), ~ -# define BOOST_PARAMETER_FOR_EACH_head(n,x) \ - BOOST_PP_SPLIT(0, BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_head_aux,n) x) - -# define BOOST_PARAMETER_FOR_EACH_pred_aux_BOOST_PARAMETER_FOR_EACH_END_SENTINEL -# define BOOST_PARAMETER_FOR_EACH_pred_aux_check(x) \ - BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \ - BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_pred_aux_, x) \ - )), ~ - -# define BOOST_PARAMETER_FOR_EACH_pred_aux2(x,y) \ - BOOST_PARAMETER_FOR_EACH_pred_aux_check(x) -# define BOOST_PARAMETER_FOR_EACH_pred_aux3(x,y,z) \ - BOOST_PARAMETER_FOR_EACH_pred_aux_check(x) -# define BOOST_PARAMETER_FOR_EACH_pred_aux4(x,y,z,u) \ - BOOST_PARAMETER_FOR_EACH_pred_aux_check(x) - -# define BOOST_PARAMETER_FOR_EACH_pred_aux0(n,x) \ - BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_pred_aux,n) x - -# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() -# define BOOST_PARAMETER_FOR_EACH_pred_SPLIT_FIRST(x) \ - BOOST_PP_SPLIT(0, x) - -# define BOOST_PARAMETER_FOR_EACH_pred(r, state) \ - BOOST_PARAMETER_FOR_EACH_pred_SPLIT_FIRST( \ - BOOST_PARAMETER_FOR_EACH_pred_aux0( \ - BOOST_PP_TUPLE_ELEM(5,3,state) \ - , BOOST_PP_TUPLE_ELEM(5,0,state) \ - ) \ - ) -# else -# define BOOST_PARAMETER_FOR_EACH_pred(r, state) \ - BOOST_PP_SPLIT( \ - 0 \ - , BOOST_PARAMETER_FOR_EACH_pred_aux0( \ - BOOST_PP_TUPLE_ELEM(5,3,state) \ - , BOOST_PP_TUPLE_ELEM(5,0,state) \ - ) \ - ) -# endif - -# define BOOST_PARAMETER_FOR_EACH_op(r, state) \ - ( \ - BOOST_PP_TUPLE_EAT(BOOST_PP_TUPLE_ELEM(5,3,state)) \ - BOOST_PP_TUPLE_ELEM(5,0,state) \ - , BOOST_PP_TUPLE_ELEM(5,1,state) \ - , BOOST_PP_TUPLE_ELEM(5,2,state) \ - , BOOST_PP_TUPLE_ELEM(5,3,state) \ - , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(5,4,state)) \ - ) - -# define BOOST_PARAMETER_FOR_EACH_macro(r, state) \ - BOOST_PP_TUPLE_ELEM(5,2,state)( \ - r \ - , BOOST_PP_TUPLE_ELEM(5,4,state) \ - , BOOST_PARAMETER_FOR_EACH_head( \ - BOOST_PP_TUPLE_ELEM(5,3,state) \ - , BOOST_PP_TUPLE_ELEM(5,0,state) \ - ) \ - , BOOST_PP_TUPLE_ELEM(5,1,state) \ - ) - -# define BOOST_PARAMETER_FOR_EACH_build_end_sentinel(z,n,text) \ - BOOST_PP_COMMA_IF(n) BOOST_PARAMETER_FOR_EACH_END_SENTINEL -# define BOOST_PARAMETER_FOR_EACH_build_end_sentinel_tuple(arity) \ - ( \ - BOOST_PP_REPEAT(arity, BOOST_PARAMETER_FOR_EACH_build_end_sentinel, _) \ - ) - -# define BOOST_PARAMETER_FOR_EACH_R(r, arity, list, data, macro) \ - BOOST_PP_CAT(BOOST_PP_FOR_, r)( \ - (list BOOST_PARAMETER_FOR_EACH_build_end_sentinel_tuple(arity), data, macro, arity, 0) \ - , BOOST_PARAMETER_FOR_EACH_pred \ - , BOOST_PARAMETER_FOR_EACH_op \ - , BOOST_PARAMETER_FOR_EACH_macro \ - ) - -# define BOOST_PARAMETER_FOR_EACH(arity, list, data, macro) \ - BOOST_PARAMETER_FOR_EACH_R(BOOST_PP_DEDUCE_R(), arity, list, data, macro) - -#endif // BOOST_PARAMETER_FOR_EACH_051217_HPP - diff --git a/include/boost/parameter/aux_/python/invoker.hpp b/include/boost/parameter/aux_/python/invoker.hpp deleted file mode 100755 index d90ad7d..0000000 --- a/include/boost/parameter/aux_/python/invoker.hpp +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Daniel Wallin 2005. 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) - -#ifndef BOOST_PARAMETER_INVOKER_051210_HPP -# define BOOST_PARAMETER_INVOKER_051210_HPP - -# include -# include -# include -# include -# include - -namespace boost { namespace parameter { namespace python { namespace aux { - -template -struct invoker; - -template -struct make_invoker -{ - template - struct apply - { - typedef invoker< - mpl::size::value, M, R, Args - > type; - }; -}; - -template -struct member_invoker; - -template -struct make_member_invoker -{ - template - struct apply - { - typedef member_invoker< - mpl::size::value, M, R, T, Args - > type; - }; -}; - -template -struct call_invoker; - -template -struct make_call_invoker -{ - template - struct apply - { - typedef call_invoker< - mpl::size::value, T, R, Args - > type; - }; -}; - -template -struct init_invoker; - -template -struct make_init_invoker -{ - template - struct apply - { - typedef init_invoker< - mpl::size::value, T, Args - > type; - }; -}; - -template -struct invoker<0, M, R, Args> -{ - static R execute() - { - return M()(boost::type()); - } -}; - -template -struct member_invoker<0, M, R, T, Args> -{ - static R execute() - { - return M()(boost::type()); - } -}; - -template -struct call_invoker<0, T, R, Args> -{ - static R execute(T& self) - { - return self(); - } -}; - -template -struct init_invoker<0, T, Args> -{ - static T* execute(T& self) - { - return new T; - } -}; - -# define BOOST_PP_ITERATION_PARAMS_1 (4, \ - (1, BOOST_PARAMETER_MAX_ARITY, , 1)) -# include BOOST_PP_ITERATE() - -# define BOOST_PP_ITERATION_PARAMS_1 (4, \ - (1, BOOST_PARAMETER_MAX_ARITY, , 2)) -# include BOOST_PP_ITERATE() - -# define BOOST_PP_ITERATION_PARAMS_1 (4, \ - (1, BOOST_PARAMETER_MAX_ARITY, , 3)) -# include BOOST_PP_ITERATE() - -# define BOOST_PP_ITERATION_PARAMS_1 (4, \ - (1, BOOST_PARAMETER_MAX_ARITY, , 4)) -# include BOOST_PP_ITERATE() - -}}}} // namespace boost::parameter::python::aux - -#endif // BOOST_PARAMETER_INVOKER_051210_HPP - diff --git a/include/boost/parameter/aux_/python/invoker_iterate.hpp b/include/boost/parameter/aux_/python/invoker_iterate.hpp deleted file mode 100755 index c18f6d0..0000000 --- a/include/boost/parameter/aux_/python/invoker_iterate.hpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright Daniel Wallin 2005. 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) - -#include -#include -#include -#include - -#define N BOOST_PP_ITERATION() - -#define BOOST_PARAMETER_PY_ARG_TYPES(z, n, _) \ - typedef typename mpl::next< \ - BOOST_PP_CAT(iter,BOOST_PP_DEC(n)) \ - >::type BOOST_PP_CAT(iter,n); \ - \ - typedef typename mpl::deref::type BOOST_PP_CAT(spec,n); \ - typedef typename mpl::if_< \ - mpl::and_< \ - mpl::not_ \ - , typename BOOST_PP_CAT(spec,n)::optimized_default \ - > \ - , parameter::aux::maybe \ - , typename BOOST_PP_CAT(spec,n)::type \ - >::type BOOST_PP_CAT(arg,n); \ - typedef typename BOOST_PP_CAT(spec,n)::keyword BOOST_PP_CAT(kw,n); - -#if BOOST_PP_ITERATION_FLAGS() == 1 -template -struct invoker -#elif BOOST_PP_ITERATION_FLAGS() == 2 -template -struct call_invoker -#elif BOOST_PP_ITERATION_FLAGS() == 3 -template -struct init_invoker -#elif BOOST_PP_ITERATION_FLAGS() == 4 -template -struct member_invoker -#endif -{ - typedef typename mpl::begin::type iter0; - typedef typename mpl::deref::type spec0; - typedef typename mpl::if_< - mpl::and_< - mpl::not_ - , typename spec0::optimized_default - > - , parameter::aux::maybe - , typename spec0::type - >::type arg0; - typedef typename spec0::keyword kw0; - - BOOST_PP_REPEAT_FROM_TO(1, N, BOOST_PARAMETER_PY_ARG_TYPES, ~) - - static -#if BOOST_PP_ITERATION_FLAGS() == 3 - T* -#else - R -#endif - execute( -#if BOOST_PP_ITERATION_FLAGS() == 2 || BOOST_PP_ITERATION_FLAGS() == 4 - T& self - , -#endif - BOOST_PP_ENUM_BINARY_PARAMS(N, arg, a) - ) - { - return -#if BOOST_PP_ITERATION_FLAGS() == 1 || BOOST_PP_ITERATION_FLAGS() == 4 - M()( - boost::type() -# if BOOST_PP_ITERATION_FLAGS() == 4 - , self -# endif - , BOOST_PP_ENUM_BINARY_PARAMS(N, parameter::keyword::get() = a) - ); -#elif BOOST_PP_ITERATION_FLAGS() == 2 - self( - BOOST_PP_ENUM_BINARY_PARAMS(N, parameter::keyword::get() = a) - ); -#elif BOOST_PP_ITERATION_FLAGS() == 3 - new T( - BOOST_PP_ENUM_BINARY_PARAMS(N, parameter::keyword::get() = a) - ); -#endif - } -}; - -#undef BOOST_PARAMETER_PY_ARG_TYPES -#undef N - diff --git a/include/boost/parameter/aux_/result_of0.hpp b/include/boost/parameter/aux_/result_of0.hpp deleted file mode 100755 index e009614..0000000 --- a/include/boost/parameter/aux_/result_of0.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright David Abrahams 2005. 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_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP -# define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP - -# include - -// A metafunction returning the result of invoking a nullary function -// object of the given type. - -#ifndef BOOST_NO_RESULT_OF - -# include -namespace boost { namespace parameter { namespace aux { -template -struct result_of0 : result_of -{}; - -}}} // namespace boost::parameter::aux_ - -#else - -namespace boost { namespace parameter { namespace aux { -template -struct result_of0 -{ - typedef typename F::result_type type; -}; - -}}} // namespace boost::parameter::aux_ - -#endif - - -#endif // BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP diff --git a/include/boost/parameter/aux_/tag.hpp b/include/boost/parameter/aux_/tag.hpp deleted file mode 100755 index 475efb9..0000000 --- a/include/boost/parameter/aux_/tag.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright David Abrahams 2005. 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_PARAMETER_AUX_TAG_DWA2005610_HPP -# define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP - -# include -# include - -namespace boost { namespace parameter { namespace aux { - -template ::type -#endif - > -struct tag -{ - typedef tagged_argument< - Keyword - , typename unwrap_cv_reference::type - > type; -}; - -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -template -struct tag -{ - typedef tagged_argument< - Keyword - , ActualArg - > type; -}; -#endif - -}}} // namespace boost::parameter::aux_ - -#endif // BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP diff --git a/include/boost/parameter/aux_/tagged_argument.hpp b/include/boost/parameter/aux_/tagged_argument.hpp deleted file mode 100755 index d09e8ab..0000000 --- a/include/boost/parameter/aux_/tagged_argument.hpp +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP -# define BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP - -# include -# include -# include -# include -# include -# include -# include -# include -# include - -namespace boost { namespace parameter { namespace aux { - -struct empty_arg_list; -struct arg_list_tag; - -struct tagged_argument_base {}; - -// Holds a reference to an argument of type Arg associated with -// keyword Keyword - -template -struct tagged_argument : tagged_argument_base -{ - typedef Keyword key_type; - typedef Arg value_type; - typedef Arg& reference; - - tagged_argument(reference x) : value(x) {} - - // A metafunction class that, given a keyword and a default - // type, returns the appropriate result type for a keyword - // lookup given that default - struct binding - { - template - struct apply - { - typedef typename mpl::if_< - boost::is_same - , reference - , Default - >::type type; - }; - }; - - // Comma operator to compose argument list without using parameters<>. - // Useful for argument lists with undetermined length. - template - arg_list< - tagged_argument - , arg_list > - > - operator,(tagged_argument x) const - { - return arg_list< - tagged_argument - , arg_list > - >( - *this - , arg_list >(x, empty_arg_list()) - ); - } - - reference operator[](keyword const&) const - { - return value; - } - -# ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - template - Default& get_with_default(default_ const& x, int) const - { - return x.value; - } - - template - reference get_with_default(default_ const&, long) const - { - return value; - } - - template - typename mpl::apply_wrap2::type - operator[](default_ const& x) const - { - return get_with_default(x, 0L); - } - - template - typename result_of0::type - get_with_lazy_default(lazy_default const& x, int) const - { - return x.compute_default(); - } - - template - reference get_with_lazy_default(lazy_default const&, long) const - { - return value; - } - - template - typename mpl::apply_wrap2< - binding,KW - , typename result_of0::type - >::type - operator[](lazy_default const& x) const - { - return get_with_lazy_default(x, 0L); - } -# else - template - reference operator[](default_ const& x) const - { - return value; - } - - template - reference operator[](lazy_default const& x) const - { - return value; - } - - template - Default& operator[](default_ const& x) const - { - return x.value; - } - - template - typename result_of0::type operator[](lazy_default const& x) const - { - return x.compute_default(); - } - - template - static typename ParameterRequirements::has_default - satisfies(ParameterRequirements*); - - template - static typename mpl::apply1::type - satisfies( - parameter_requirements* - ); -# endif - - reference value; -# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) - // warning suppression - private: - void operator=(tagged_argument const&); - public: -# endif - // MPL sequence support - typedef tagged_argument type; // Convenience for users - typedef empty_arg_list tail_type; // For the benefit of iterators - typedef arg_list_tag tag; // For dispatching to sequence intrinsics -}; - -// Defines a metafunction, is_tagged_argument, that identifies -// tagged_argument specializations and their derived classes. -template -struct is_tagged_argument_aux - : is_convertible -{}; - -template -struct is_tagged_argument - : mpl::and_< - mpl::not_ > - , is_tagged_argument_aux - > -{}; - -}}} // namespace boost::parameter::aux - -#endif // BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP - diff --git a/include/boost/parameter/aux_/template_keyword.hpp b/include/boost/parameter/aux_/template_keyword.hpp deleted file mode 100755 index 5a02f00..0000000 --- a/include/boost/parameter/aux_/template_keyword.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Daniel Wallin 2006. 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) - -#ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP -# define BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP - -# include -# include -# include -# include - -namespace boost { namespace parameter { - -namespace aux -{ - - struct template_keyword_tag {}; - - template - struct is_pointer_convertible - : is_convertible - {}; - - template - struct is_template_keyword - : mpl::and_< - mpl::not_ > - , is_pointer_convertible - > - {}; - -} // namespace aux - -template -struct template_keyword - : aux::template_keyword_tag -{ - typedef Tag key_type; - typedef T value_type; - typedef value_type reference; -}; - -}} // namespace boost::parameter - -#endif // BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP - diff --git a/include/boost/parameter/aux_/unwrap_cv_reference.hpp b/include/boost/parameter/aux_/unwrap_cv_reference.hpp deleted file mode 100755 index e7aa0c1..0000000 --- a/include/boost/parameter/aux_/unwrap_cv_reference.hpp +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef UNWRAP_CV_REFERENCE_050328_HPP -#define UNWRAP_CV_REFERENCE_050328_HPP - -#include -#include -#include -#include - -namespace boost { template class reference_wrapper; } - -namespace boost { namespace parameter { namespace aux { - -// -// reference_wrapper support -- because of the forwarding problem, -// when passing arguments positionally by non-const reference, we -// ask users of named parameter interfaces to use ref(x) to wrap -// them. -// - -// is_cv_reference_wrapper returns mpl::true_ if T is of type -// reference_wrapper cv -template -yes_tag is_cv_reference_wrapper_check(reference_wrapper const volatile*); -no_tag is_cv_reference_wrapper_check(...); - -template -struct is_cv_reference_wrapper -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(is_cv_reference_wrapper_check((T*)0)) == sizeof(yes_tag) - ) - ); - - typedef mpl::bool_< -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - is_cv_reference_wrapper:: -#endif - value> type; -}; - -#if BOOST_WORKAROUND(MSVC, == 1200) -template <> -struct is_cv_reference_wrapper - : mpl::false_ {}; -#endif - -// Needed for unwrap_cv_reference below. T might be const, so -// eval_if might fail because of deriving from T const on EDG. -template -struct get_type -{ - typedef typename T::type type; -}; - -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -template ::type> -struct unwrap_cv_reference -{ - typedef T type; -}; - -template -struct unwrap_cv_reference -{ - typedef T const type; -}; - -template -struct unwrap_cv_reference - : T -{}; - -#else -// Produces the unwrapped type to hold a reference to in named<> -// Can't use boost::unwrap_reference<> here because it -// doesn't handle the case where T = reference_wrapper cv -template -struct unwrap_cv_reference -{ - typedef typename mpl::eval_if< - is_cv_reference_wrapper - , get_type - , mpl::identity - >::type type; -}; -#endif - -}}} // namespace boost::parameter::aux - -#endif // UNWRAP_CV_REFERENCE_050328_HPP - diff --git a/include/boost/parameter/aux_/void.hpp b/include/boost/parameter/aux_/void.hpp deleted file mode 100755 index 7061a7d..0000000 --- a/include/boost/parameter/aux_/void.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef BOOST_PARAMETER_VOID_050329_HPP -#define BOOST_PARAMETER_VOID_050329_HPP - -namespace boost { namespace parameter { - -// A placemarker for "no argument passed." -// MAINTAINER NOTE: Do not make this into a metafunction -struct void_ {}; - -namespace aux -{ - - inline void_& void_reference() - { - static void_ instance; - return instance; - } - -} // namespace aux - -}} // namespace boost::parameter - -#endif // BOOST_PARAMETER_VOID_050329_HPP - diff --git a/include/boost/parameter/aux_/yesno.hpp b/include/boost/parameter/aux_/yesno.hpp deleted file mode 100755 index 13fa545..0000000 --- a/include/boost/parameter/aux_/yesno.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef YESNO_050328_HPP -#define YESNO_050328_HPP - -#include - -namespace boost { namespace parameter { namespace aux { - -// types used with the "sizeof trick" to capture the results of -// overload resolution at compile-time. -typedef char yes_tag; -typedef char (&no_tag)[2]; - -// mpl::true_ and mpl::false_ are not distinguishable by sizeof(), -// so we pass them through these functions to get a type that is. -yes_tag to_yesno(mpl::true_); -no_tag to_yesno(mpl::false_); - -}}} // namespace boost::parameter::aux - -#endif // YESNO_050328_HPP - diff --git a/include/boost/parameter/binding.hpp b/include/boost/parameter/binding.hpp deleted file mode 100755 index 9204c8d..0000000 --- a/include/boost/parameter/binding.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright David Abrahams 2005. 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_PARAMETER_BINDING_DWA200558_HPP -# define BOOST_PARAMETER_BINDING_DWA200558_HPP - -# include -# include -# include -# include -# include -# include - -namespace boost { namespace parameter { - -// A metafunction that, given an argument pack, returns the type of -// the parameter identified by the given keyword. If no such -// parameter has been specified, returns Default -template -# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) -struct binding -# else -struct binding_eti -# endif -{ - typedef typename mpl::apply_wrap2< - typename Parameters::binding,Keyword,Default - >::type type; - - BOOST_MPL_ASSERT_NOT(( - mpl::and_< - is_same - , is_same - > - )); -}; - -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -template -struct binding -{ - typedef typename mpl::eval_if< - is_same - , mpl::identity - , binding_eti - >::type type; -}; -# endif - -// A metafunction that, given an argument pack, returns the type of -// the parameter identified by the given keyword. If no such -// parameter has been specified, returns the type returned by invoking -// DefaultFn -template -struct lazy_binding -{ - typedef typename mpl::apply_wrap2< - typename Parameters::binding - , Keyword - , typename aux::result_of0::type - >::type type; -}; - - -}} // namespace boost::parameter - -#endif // BOOST_PARAMETER_BINDING_DWA200558_HPP diff --git a/include/boost/parameter/config.hpp b/include/boost/parameter/config.hpp deleted file mode 100755 index e4fcc29..0000000 --- a/include/boost/parameter/config.hpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef BOOST_PARAMETER_CONFIG_050403_HPP -#define BOOST_PARAMETER_CONFIG_050403_HPP - -#ifndef BOOST_PARAMETER_MAX_ARITY -# define BOOST_PARAMETER_MAX_ARITY 5 -#endif - -#endif // BOOST_PARAMETER_CONFIG_050403_HPP - diff --git a/include/boost/parameter/keyword.hpp b/include/boost/parameter/keyword.hpp deleted file mode 100755 index 9011aa8..0000000 --- a/include/boost/parameter/keyword.hpp +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright Daniel Wallin, David Abrahams 2005. 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) - -#ifndef KEYWORD_050328_HPP -#define KEYWORD_050328_HPP - -#include -#include -#include - -namespace boost { namespace parameter { - -// Instances of unique specializations of keyword<...> serve to -// associate arguments with parameter names. For example: -// -// struct rate_; // parameter names -// struct skew_; -// namespace -// { -// keyword rate; // keywords -// keyword skew; -// } -// -// ... -// -// f(rate = 1, skew = 2.4); -// -template -struct keyword -{ - template - typename aux::tag::type const - operator=(T& x) const - { - typedef typename aux::tag::type result; - return result(x); - } - - template - aux::default_ - operator|(Default& default_) const - { - return aux::default_(default_); - } - - template - aux::lazy_default - operator||(Default& default_) const - { - return aux::lazy_default(default_); - } - -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs - template - typename aux::tag::type const - operator=(T const& x) const - { - typedef typename aux::tag::type result; - return result(x); - } -#endif - -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs - template - aux::default_ - operator|(const Default& default_) const -#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - volatile -#endif - { - return aux::default_(default_); - } - - template - aux::lazy_default - operator||(Default const& default_) const -#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - volatile -#endif - { - return aux::lazy_default(default_); - } -#endif - - public: // Insurance against ODR violations - - // People will need to define these keywords in header files. To - // prevent ODR violations, it's important that the keyword used in - // every instantiation of a function template is the same object. - // We provide a reference to a common instance of each keyword - // object and prevent construction by users. - - static keyword& get() - { - static keyword result; - return result; - } -}; - -// Reduces boilerplate required to declare and initialize keywords -// without violating ODR. Declares a keyword tag type with the given -// name in namespace tag_namespace, and declares and initializes a -// reference in an anonymous namespace to a singleton instance of that -// type. - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - -# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \ - namespace tag_namespace \ - { \ - struct name \ - { \ - static char const* keyword_name() \ - { \ - return #name; \ - } \ - }; \ - } \ - static ::boost::parameter::keyword& name \ - = ::boost::parameter::keyword::get(); - -#else - -#define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \ - namespace tag_namespace \ - { \ - struct name \ - { \ - static char const* keyword_name() \ - { \ - return #name; \ - } \ - }; \ - } \ - namespace \ - { \ - ::boost::parameter::keyword& name \ - = ::boost::parameter::keyword::get(); \ - } - -#endif - -}} // namespace boost::parameter - -#endif // KEYWORD_050328_HPP - diff --git a/include/boost/parameter/macros.hpp b/include/boost/parameter/macros.hpp deleted file mode 100755 index 00b5ae9..0000000 --- a/include/boost/parameter/macros.hpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright David Abrahams, Daniel Wallin 2003. 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) - -#ifndef BOOST_PARAMETER_MACROS_050412_HPP -#define BOOST_PARAMETER_MACROS_050412_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define BOOST_PARAMETER_FUN_TEMPLATE_HEAD1(n) \ - template - -#define BOOST_PARAMETER_FUN_TEMPLATE_HEAD0(n) - -#ifndef BOOST_NO_SFINAE - -# define BOOST_PARAMETER_MATCH_TYPE(n, param) \ - BOOST_PP_EXPR_IF(n, typename) param::match \ - < \ - BOOST_PP_ENUM_PARAMS(n, T) \ - >::type - -#else - -# define BOOST_PARAMETER_MATCH_TYPE(n, param) param - -#endif - -#define BOOST_PARAMETER_FUN_DECL(z, n, params) \ - \ - BOOST_PP_CAT(BOOST_PARAMETER_FUN_TEMPLATE_HEAD, BOOST_PP_BOOL(n))(n) \ - \ - BOOST_PP_TUPLE_ELEM(3, 0, params) \ - BOOST_PP_TUPLE_ELEM(3, 1, params)( \ - BOOST_PP_ENUM_BINARY_PARAMS(n, T, const& p) \ - BOOST_PP_COMMA_IF(n) \ - BOOST_PARAMETER_MATCH_TYPE(n,BOOST_PP_TUPLE_ELEM(3, 2, params)) \ - kw = BOOST_PP_TUPLE_ELEM(3, 2, params)() \ - ) \ - { \ - return BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, params), _with_named_params)( \ - kw(BOOST_PP_ENUM_PARAMS(n, p)) \ - ); \ - } - -// Generates: -// -// template -// ret name ## _with_named_params(Params const&); -// -// template -// ret name(T0 const& p0, typename parameters::match::type kw = parameters()) -// { -// return name ## _with_named_params(kw(p0)); -// } -// -// template -// ret name(T0 const& p0, ..., TN const& PN -// , typename parameters::match::type kw = parameters()) -// { -// return name ## _with_named_params(kw(p0, ..., pN)); -// } -// -// template -// ret name ## _with_named_params(Params const&) -// -// lo and hi determines the min and max arity of the generated functions. - -#define BOOST_PARAMETER_FUN(ret, name, lo, hi, parameters) \ - \ - template \ - ret BOOST_PP_CAT(name, _with_named_params)(Params const& p); \ - \ - BOOST_PP_REPEAT_FROM_TO( \ - lo, BOOST_PP_INC(hi), BOOST_PARAMETER_FUN_DECL, (ret, name, parameters)) \ - \ - template \ - ret BOOST_PP_CAT(name, _with_named_params)(Params const& p) - -#define BOOST_PARAMETER_MEMFUN(ret, name, lo, hi, parameters) \ - \ - BOOST_PP_REPEAT_FROM_TO( \ - lo, BOOST_PP_INC(hi), BOOST_PARAMETER_FUN_DECL, (ret, name, parameters)) \ - \ - template \ - ret BOOST_PP_CAT(name, _with_named_params)(Params const& p) - -#endif // BOOST_PARAMETER_MACROS_050412_HPP - diff --git a/include/boost/parameter/match.hpp b/include/boost/parameter/match.hpp deleted file mode 100755 index 2fa3f17..0000000 --- a/include/boost/parameter/match.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright David Abrahams 2005. 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_PARAMETER_MATCH_DWA2005714_HPP -# define BOOST_PARAMETER_MATCH_DWA2005714_HPP - -# include -# include - -# if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) -// Temporary version of BOOST_PP_SEQ_ENUM until Paul M. integrates the workaround. -# define BOOST_PARAMETER_SEQ_ENUM_I(size,seq) BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, size) seq -# define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PARAMETER_SEQ_ENUM_I(BOOST_PP_SEQ_SIZE(seq), seq) -# else -# define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PP_SEQ_ENUM(seq) -# endif - -# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - -# include -# include -# include -# include -# include - -# define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \ - BOOST_PP_ENUM_TRAILING_PARAMS( \ - BOOST_PP_SUB( \ - BOOST_PARAMETER_MAX_ARITY \ - , BOOST_PP_SEQ_SIZE(ArgTypes) \ - ) \ - , ::boost::parameter::void_ BOOST_PP_INTERCEPT \ - ) - -# else - -# define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) - -# endif - -// -// Generates, e.g. -// -// typename dfs_params::match::type name = dfs_params() -// -// with workarounds for Borland compatibility. -// - -# define BOOST_PARAMETER_MATCH(ParameterSpec, ArgTypes, name) \ - typename ParameterSpec ::match< \ - BOOST_PARAMETER_SEQ_ENUM(ArgTypes) \ - BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \ - >::type name = ParameterSpec () - -#endif // BOOST_PARAMETER_MATCH_DWA2005714_HPP diff --git a/include/boost/parameter/name.hpp b/include/boost/parameter/name.hpp deleted file mode 100755 index 4b9627a..0000000 --- a/include/boost/parameter/name.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright Daniel Wallin 2006. 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) - -#ifndef BOOST_PARAMETER_NAME_060806_HPP -# define BOOST_PARAMETER_NAME_060806_HPP - -# include -# include -# include -# include -# include -# include -# include -# include - -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \ - static ::boost::parameter::keyword& name \ - = ::boost::parameter::keyword::get(); -# else -# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \ - namespace \ - { \ - ::boost::parameter::keyword& name \ - = ::boost::parameter::keyword::get(); \ - } -# endif - -# define BOOST_PARAMETER_BASIC_NAME(tag_namespace, tag, name) \ - namespace tag_namespace \ - { \ - struct tag \ - { \ - static char const* keyword_name() \ - { \ - return BOOST_PP_STRINGIZE(tag); \ - } \ - }; \ - } \ - BOOST_PARAMETER_NAME_OBJECT(tag_namespace::tag, name) - -# define BOOST_PARAMETER_COMPLEX_NAME_TUPLE1(tag,namespace) \ - (tag, namespace), ~ - -# define BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name) \ - BOOST_PP_TUPLE_ELEM(2, 0, (BOOST_PARAMETER_COMPLEX_NAME_TUPLE1 name)) - -# define BOOST_PARAMETER_COMPLEX_NAME_TAG(name) \ - BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name)) - -# define BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \ - BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name)) - -# define BOOST_PARAMETER_COMPLEX_NAME(name) \ - BOOST_PARAMETER_BASIC_NAME( \ - BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \ - , BOOST_PP_TUPLE_EAT(2) name \ - , BOOST_PARAMETER_COMPLEX_NAME_TAG(name) \ - ) \ -/**/ - -# define BOOST_PARAMETER_SIMPLE_NAME(name) \ - BOOST_PARAMETER_BASIC_NAME(tag, name, BOOST_PP_CAT(_, name)) - -# define BOOST_PARAMETER_NAME(name) \ - BOOST_PP_IIF( \ - BOOST_PP_IS_BINARY(name) \ - , BOOST_PARAMETER_COMPLEX_NAME \ - , BOOST_PARAMETER_SIMPLE_NAME \ - )(name) \ -/**/ - - -# define BOOST_PARAMETER_TEMPLATE_KEYWORD(name) \ - namespace tag \ - { \ - struct name; \ - } \ - template \ - struct name \ - : boost::parameter::template_keyword \ - {}; \ -/**/ - -#endif // BOOST_PARAMETER_NAME_060806_HPP - diff --git a/include/boost/parameter/parameters.hpp b/include/boost/parameter/parameters.hpp deleted file mode 100755 index 5c5d013..0000000 --- a/include/boost/parameter/parameters.hpp +++ /dev/null @@ -1,654 +0,0 @@ -// Copyright David Abrahams, Daniel Wallin 2003. 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) - -#ifndef BOOST_PARAMETERS_031014_HPP -#define BOOST_PARAMETERS_031014_HPP - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { - -template class reference_wrapper; - -namespace parameter { - -namespace aux { struct use_default {}; } - -// These templates can be used to describe the treatment of particular -// named parameters for the purposes of overload elimination with -// SFINAE, by placing specializations in the parameters<...> list. In -// order for a treated function to participate in overload resolution: -// -// - all keyword tags wrapped in required<...> must have a matching -// actual argument -// -// - The actual argument type matched by every keyword tag -// associated with a predicate must satisfy that predicate -// -// If a keyword k is specified without an optional<...> or -// required<...>, wrapper, it is treated as though optional were -// specified. -// -// If a keyword k is specified with unnamed<...>, that keyword -// will be automatically deduced from the argument list. -// -template -struct required -{ - typedef Tag key_type; - typedef Predicate predicate; -}; - -template -struct optional -{ - typedef Tag key_type; - typedef Predicate predicate; -}; - -template -struct unnamed -{ - typedef Tag key_type; - typedef Predicate predicate; -}; - -namespace aux -{ - // Defines metafunctions, is_required and is_optional, that - // identify required<...>, optional<...> and unnamed<...> specializations. - BOOST_DETAIL_IS_XXX_DEF(required, required, 2) - BOOST_DETAIL_IS_XXX_DEF(optional, optional, 2) - BOOST_DETAIL_IS_XXX_DEF(unnamed, unnamed, 2) - - // - // key_type, has_default, and predicate -- - // - // These metafunctions accept a ParameterSpec and extract the - // keyword tag, whether or not a default is supplied for the - // parameter, and the predicate that the corresponding actual - // argument type is required match. - // - // a ParameterSpec is a specialization of either keyword<...>, - // required<...>, optional<...> or unnamed<...> - // - - // helper for key_type<...>, below. - template - struct get_key_type - { typedef typename T::key_type type; }; - - template - struct key_type - : mpl::eval_if< - mpl::or_< - is_optional - , is_required - , is_unnamed - > - , get_key_type - , mpl::identity - > - { - }; - - template - struct has_default - : mpl::not_ > - {}; - - // helper for get_predicate<...>, below - template - struct get_predicate_or_default - { - typedef T type; - }; - - template <> - struct get_predicate_or_default - { - typedef mpl::always type; - }; - - // helper for predicate<...>, below - template - struct get_predicate - { - typedef typename - get_predicate_or_default::type - type; - }; - - template - struct predicate - : mpl::eval_if< - mpl::or_< - is_optional - , is_required - , is_unnamed - > - , get_predicate - , mpl::identity > - > - { - }; - - - // Converts a ParameterSpec into a specialization of - // parameter_requirements. We need to do this in order to get the - // key_type into the type in a way that can be conveniently matched - // by a satisfies(...) member function in arg_list. - template - struct as_parameter_requirements - { - typedef parameter_requirements< - typename key_type::type - , typename predicate::type - , typename has_default::type - > type; - }; - - template - struct is_named_argument - : mpl::or_< - is_template_keyword - , is_tagged_argument - > - {}; - - // Labels Arg with default keyword tag DefaultTag if it is not - // already a tagged_argument. If an unnamed spec that matches - // Arg exists in UnnamedList, labels Arg with that spec's - // keyword tag. - template - struct as_tagged_argument - : mpl::eval_if< - is_named_argument - , mpl::identity > - , mpl::apply_wrap3 - > - {}; - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround - template <> - struct as_tagged_argument - { - typedef int type; - }; -#endif - - // Returns mpl::true_ iff the given ParameterRequirements are - // satisfied by ArgList. - template - struct satisfies - { -#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) - // VC7.1 can't handle the sizeof() implementation below, - // so we use this instead. - typedef typename mpl::apply_wrap2< - typename ArgList::binding - , typename ParameterRequirements::keyword - , void_ - >::type bound; - - typedef typename mpl::eval_if< - is_same - , typename ParameterRequirements::has_default - , mpl::apply1< - typename ParameterRequirements::predicate - , typename remove_reference::type - > - >::type type; -#else - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof( - aux::to_yesno( - ArgList::satisfies((ParameterRequirements*)0) - ) - ) == sizeof(yes_tag) - ) - ); - - typedef mpl::bool_ type; -#endif - }; - - // Returns mpl::true_ if the requirements of the given ParameterSpec - // are satisfied by ArgList. - template - struct satisfies_requirements_of - : satisfies< - ArgList - , typename as_parameter_requirements::type - > - {}; - - // Helper for make_partial_arg_list, below. Produce an arg_list - // node for the given ParameterSpec and ArgumentType, whose tail is - // determined by invoking the nullary metafunction TailFn. - template - struct make_arg_list - { - template - struct apply - { - typedef typename as_tagged_argument< - ParameterSpec,ArgumentType,UnnamedList,TagFn - >::type tagged_result; - - typedef arg_list< - typename mpl::first::type - , typename mpl::apply_wrap1< - TailFn, typename mpl::second::type - >::type - > type; - }; - }; - - // Just like make_arg_list, except if ArgumentType is void_, the - // result is empty_arg_list. Used to build arg_lists whose length - // depends on the number of non-default (void_) arguments passed to - // a class template. - template < - class ParameterSpec - , class ArgumentType - , class TagFn - , class TailFn - > - struct make_partial_arg_list - { - template - struct apply - { - typedef typename mpl::eval_if< - is_same - , mpl::identity - , mpl::apply_wrap1< - make_arg_list - , UnnamedList - > - >::type type; - }; - }; - - // Generates: - // - // make< - // parameter_spec#0, argument_type#0 - // , make< - // parameter_spec#1, argument_type#1 - // , ... mpl::identity - // ...> - // > -#define BOOST_PARAMETER_make_arg_list(z, n, names) \ - BOOST_PP_SEQ_ELEM(0,names)< \ - BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1,names), n), \ - BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2,names), n), \ - BOOST_PP_SEQ_ELEM(3,names), - -#define BOOST_PARAMETER_right_angle(z, n, text) > - -#define BOOST_PARAMETER_build_arg_list(n, make, parameter_spec, argument_type, tag) \ - BOOST_PP_REPEAT( \ - n, BOOST_PARAMETER_make_arg_list, (make)(parameter_spec)(argument_type)(tag)) \ - mpl::always \ - BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _) - - // Terminates an unnamed_list (below). - struct empty_unnamed_list - { - template - struct apply - { - // No unnamed predicate matched Arg, so we tag Arg with - // the DefaultTag. - - BOOST_MPL_ASSERT_NOT((is_unnamed)); - - typedef mpl::pair< - typename mpl::apply_wrap2< - TagFn - , typename key_type::type - , Arg - >::type - , empty_unnamed_list - > type; - }; - }; - - // Used by as_tagged_argument to match a given - // argument with a list of unnamed specs. - // - // ParameterSpec is an unnamed spec. - // Tail is either another unnamed_list specialization, - // or empty_unnamed_list. - template - struct unnamed_list - { - // Helper metafunction for apply below. Computes the result - // of Tail::apply. Returns a pair consisting of: - // - // * the tagged argument - // * the unnamed_list that is left after the tagging. Possibly - // with one element removed. - template - struct eval_tail - { - typedef typename mpl::apply_wrap3< - Tail, Arg, Positional, TagFn - >::type result; - - typedef mpl::pair< - typename mpl::first::type - , unnamed_list::type> - > type; - }; - - // If this keyword's predicate returns true for - // the given argument type, tag the argument with - // ParameterSpec::key_type. Otherwise try the tail. - template - struct apply - { - typedef typename mpl::eval_if< - typename mpl::apply1::type - , mpl::pair< - typename mpl::apply_wrap2< - TagFn, typename ParameterSpec::key_type, Arg - >::type - , Tail - > - , -#if BOOST_WORKAROUND(__GNUC__, < 3) - typename unnamed_list::template -#endif - eval_tail - >::type type; - }; - }; - - // We need to build a list of all ParameterSpec's that specify an - // unnamed argument. This list is used when trying to match an - // argument to an unnamed keyword. - - template - struct make_unnamed_list - { - typedef unnamed_list< - ParameterSpec - , typename TailFn::type - > type; - }; - - template - struct make_partial_unnamed_list - : mpl::eval_if< - is_same - , mpl::identity - , mpl::eval_if< - is_unnamed - , make_unnamed_list - , TailFn - > - > - {}; - -#define BOOST_PARAMETER_make_unnamed_list(z, n, names) \ - BOOST_PP_SEQ_ELEM(0,names)< \ - BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1,names), n), - -#define BOOST_PARAMETER_build_unnamed_list(n, make, parameter_spec) \ - BOOST_PP_REPEAT( \ - n, BOOST_PARAMETER_make_unnamed_list, (make)(parameter_spec)) \ - mpl::identity \ - BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _) - - struct tag_keyword_arg - { - template - struct apply - : tag - {}; - }; - - struct tag_template_keyword_arg - { - template - struct apply - { - typedef template_keyword type; - }; - }; - -} // namespace aux - -#define BOOST_PARAMETER_FORWARD_TYPEDEF(z, i, names) \ - typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0,names),i) BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1,names),i); - -#define BOOST_PARAMETER_FORWARD_TYPEDEFS(n, src, dest) \ - BOOST_PP_REPEAT(n, BOOST_PARAMETER_FORWARD_TYPEDEF, (src)(dest)) - - -#define BOOST_PARAMETER_TEMPLATE_ARGS(z, n, text) class BOOST_PP_CAT(PS, n) = void_ - -template< - class PS0 - , BOOST_PP_ENUM_SHIFTED(BOOST_PARAMETER_MAX_ARITY, BOOST_PARAMETER_TEMPLATE_ARGS, _) -> -struct parameters -{ -#undef BOOST_PARAMETER_TEMPLATE_ARGS - - typedef typename BOOST_PARAMETER_build_unnamed_list( - BOOST_PARAMETER_MAX_ARITY, aux::make_partial_unnamed_list, PS - )::type unnamed_list; - - // if the elements of NamedList match the criteria of overload - // resolution, returns a type which can be constructed from - // parameters. Otherwise, this is not a valid metafunction (no nested - // ::type). - - -#ifndef BOOST_NO_SFINAE - // If NamedList satisfies the PS0, PS1, ..., this is a - // metafunction returning parameters. Otherwise it - // has no nested ::type. - template - struct match_base - : mpl::if_< - // mpl::and_< - // aux::satisfies_requirements_of - // , mpl::and_< - // aux::satisfies_requirements_of... - // ..., mpl::true_ - // ...> > - -# define BOOST_PARAMETER_satisfies(z, n, text) \ - mpl::and_< \ - aux::satisfies_requirements_of , - - BOOST_PP_REPEAT(BOOST_PARAMETER_MAX_ARITY, BOOST_PARAMETER_satisfies, _) - mpl::true_ - BOOST_PP_REPEAT(BOOST_PARAMETER_MAX_ARITY, BOOST_PARAMETER_right_angle, _) - -# undef BOOST_PARAMETER_satisfies - - , mpl::identity - , void_ - > - {}; -#endif - - // Specializations are to be used as an optional argument to - // eliminate overloads via SFINAE - template< -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - // Borland simply can't handle default arguments in member - // class templates. People wishing to write portable code can - // explicitly specify BOOST_PARAMETER_MAX_ARITY arguments - BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, class A) -#else - BOOST_PP_ENUM_BINARY_PARAMS( - BOOST_PARAMETER_MAX_ARITY, class A, = void_ BOOST_PP_INTERCEPT - ) -#endif - > - struct match -# ifndef BOOST_NO_SFINAE - : match_base< - typename mpl::apply_wrap1::type - >::type - {}; -# else - { - typedef parameters< - BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, PS) - > type; - }; -# endif - - // Metafunction that returns an ArgumentPack. - - template < -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - // Borland simply can't handle default arguments in member - // class templates. People wishing to write portable code can - // explicitly specify BOOST_PARAMETER_MAX_ARITY arguments - BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, class A) -#else - BOOST_PP_ENUM_BINARY_PARAMS( - BOOST_PARAMETER_MAX_ARITY, class A, = void_ BOOST_PP_INTERCEPT - ) -#endif - > - struct bind - { - typedef typename mpl::apply_wrap1::type type; - }; - - BOOST_PARAMETER_FORWARD_TYPEDEFS(BOOST_PARAMETER_MAX_ARITY, PS, parameter_spec) - - // - // The function call operator is used to build an arg_list that - // labels the positional parameters and maintains whatever other - // tags may have been specified by the caller. - // - aux::empty_arg_list operator()() const - { - return aux::empty_arg_list(); - } - - template - typename mpl::apply_wrap1< - aux::make_arg_list > - , unnamed_list - >::type - operator()(A0& a0) const - { - typedef typename mpl::apply_wrap1< - aux::make_arg_list > - , unnamed_list - >::type result_type; - - return result_type( - a0 - // , void_(), void_(), void_() ... - BOOST_PP_ENUM_TRAILING_PARAMS( - BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, 1) - , aux::void_reference() BOOST_PP_INTERCEPT) - ); - } - - template - typename mpl::apply_wrap1< - aux::make_arg_list< - PS0,A0,aux::tag_keyword_arg - , aux::make_arg_list< - PS1,A1,aux::tag_keyword_arg - , mpl::always - > - > - , unnamed_list - >::type - operator()(A0& a0, A1& a1) const - { - typedef typename mpl::apply_wrap1< - aux::make_arg_list< - PS0,A0,aux::tag_keyword_arg - , aux::make_arg_list< - PS1,A1,aux::tag_keyword_arg - , mpl::always - > - > - , unnamed_list - >::type result_type; - - return result_type( - a0, a1 - // , void_(), void_() ... - BOOST_PP_ENUM_TRAILING_PARAMS( - BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, 2) - , aux::void_reference() BOOST_PP_INTERCEPT) - ); - } - - // Higher arities are handled by the preprocessor -#define BOOST_PP_ITERATION_PARAMS_1 (3,( \ - 3,BOOST_PARAMETER_MAX_ARITY, \ - )) -#include BOOST_PP_ITERATE() - -}; - -} // namespace parameter - -} // namespace boost - -#endif // BOOST_PARAMETERS_031014_HPP - diff --git a/include/boost/parameter/preprocessor.hpp b/include/boost/parameter/preprocessor.hpp deleted file mode 100755 index fec825f..0000000 --- a/include/boost/parameter/preprocessor.hpp +++ /dev/null @@ -1,930 +0,0 @@ -// Copyright Daniel Wallin 2006. 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) - -#ifndef BOOST_PARAMETER_PREPROCESSOR_060206_HPP -# define BOOST_PARAMETER_PREPROCESSOR_060206_HPP - -# include -# include -# include - -# include -# include -# include - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# include - -# include -# include - -namespace boost { namespace parameter { namespace aux { - -# ifndef BOOST_NO_SFINAE - -// Given Match, which is "void x" where x is an argument matching -// criterion, extract a corresponding MPL predicate. -template -struct unwrap_predicate; - -// Match anything -template <> -struct unwrap_predicate -{ - typedef mpl::always type; -}; - -// A matching predicate is explicitly specified -template -struct unwrap_predicate -{ - typedef Predicate type; -}; - -// A type to which the argument is supposed to be convertible is -// specified -template -struct unwrap_predicate -{ - typedef is_convertible type; -}; - -// Recast the ParameterSpec's nested match metafunction as a free metafunction -template < - class Parameters - , BOOST_PP_ENUM_BINARY_PARAMS( - BOOST_PARAMETER_MAX_ARITY, class A, = boost::parameter::void_ BOOST_PP_INTERCEPT - ) -> -struct match - : Parameters::template match< - BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, A) - > -{}; -# endif - -template < - class Parameters - , BOOST_PP_ENUM_BINARY_PARAMS( - BOOST_PARAMETER_MAX_ARITY, class A, = boost::parameter::void_ BOOST_PP_INTERCEPT - ) -> -struct argument_pack -{ - typedef typename mpl::apply_wrap1< - BOOST_PARAMETER_build_arg_list( - BOOST_PARAMETER_MAX_ARITY, aux::make_partial_arg_list - , typename Parameters::parameter_spec, A, aux::tag_keyword_arg - ) - , typename Parameters::unnamed_list - >::type type; -}; - -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -// Works around VC6 problem where it won't accept rvalues. -template -T& as_lvalue(T& value, long) -{ - return value; -} - -template -T const& as_lvalue(T const& value, int) -{ - return value; -} -# endif - -}}} // namespace boost::parameter::aux - -# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -// From Paul Mensonides -# define BOOST_PARAMETER_IS_NULLARY(x) \ - BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_NULLARY_C x BOOST_PP_COMMA() 0) \ - /**/ -# define BOOST_PARAMETER_IS_NULLARY_C() \ - ~, 1 BOOST_PP_RPAREN() \ - BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~ \ - /**/ -# else -# define BOOST_PARAMETER_IS_NULLARY(x) BOOST_PP_IS_NULLARY(x) -# endif - -# define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static () -# define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \ - BOOST_PARAMETER_IS_NULLARY( \ - BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_,name) \ - ) - -# if !defined(BOOST_MSVC) -# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static -# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \ - BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name) -# else -// Workaround for MSVC preprocessor. -// -// When stripping static from "static f", msvc will produce -// " f". The leading whitespace doesn't go away when pasting -// the token with something else, so this thing is a hack to -// strip the whitespace. -# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static ( -# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \ - BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)) -# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \ - BOOST_PP_SEQ_HEAD( \ - BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \ - ) -# endif - -# define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \ - BOOST_PP_EXPR_IF( \ - BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \ - , static \ - ) - -# define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \ - BOOST_PP_IF( \ - BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \ - , BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC \ - , name BOOST_PP_TUPLE_EAT(1) \ - )(name) - -// Calculates [begin, end) arity range. - -# define BOOST_PARAMETER_ARITY_RANGE_M_optional(state) state -# define BOOST_PARAMETER_ARITY_RANGE_M_required(state) BOOST_PP_INC(state) - -# define BOOST_PARAMETER_ARITY_RANGE_M(s, state, x) \ - BOOST_PP_CAT( \ - BOOST_PARAMETER_ARITY_RANGE_M_ \ - , BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \ - )(state) -/**/ - -# define BOOST_PARAMETER_ARITY_RANGE(args) \ - ( \ - BOOST_PP_SEQ_FOLD_LEFT(BOOST_PARAMETER_ARITY_RANGE_M, 0, args) \ - , BOOST_PP_INC(BOOST_PP_SEQ_SIZE(args)) \ - ) -/**/ - -// Accessor macros for the argument specs tuple. -# define BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \ - BOOST_PP_TUPLE_ELEM(4,0,x) -/**/ - -# define BOOST_PARAMETER_FN_ARG_NAME(x) \ - BOOST_PP_TUPLE_ELEM(4,1,x) -/**/ - -# define BOOST_PARAMETER_FN_ARG_PRED(x) \ - BOOST_PP_TUPLE_ELEM(4,2,x) -/**/ - -# define BOOST_PARAMETER_FN_ARG_DEFAULT(x) \ - BOOST_PP_TUPLE_ELEM(4,3,x) -/**/ - -# define BOOST_PARAMETETER_FUNCTION_EAT_KEYWORD_QUALIFIER_out(x) -# define BOOST_PARAMETETER_FUNCTION_EAT_KEYWORD_QUALIFIER_in_out(x) - -// Returns 1 if x is either "out(k)" or "in_out(k)". -# define BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER(x) \ - BOOST_PP_IS_EMPTY( \ - BOOST_PP_CAT(BOOST_PARAMETETER_FUNCTION_EAT_KEYWORD_QUALIFIER_, x) \ - ) \ -/**/ - -# define BOOST_PARAMETETER_FUNCTION_GET_KEYWORD_QUALIFIER_out(x) x -# define BOOST_PARAMETETER_FUNCTION_GET_KEYWORD_QUALIFIER_in_out(x) x -# define BOOST_PARAMETER_FUNCTION_KEYWORD_GET(x) \ - BOOST_PP_CAT(BOOST_PARAMETETER_FUNCTION_GET_KEYWORD_QUALIFIER_, x) -/**/ - -// Returns the keyword of x, where x is either a keyword qualifier -// or a keyword. -// -// k => k -// out(k) => k -// in_out(k) => k -// -# define BOOST_PARAMETER_FUNCTION_KEYWORD(x) \ - BOOST_PP_IF( \ - BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER(x) \ - , BOOST_PARAMETER_FUNCTION_KEYWORD_GET \ - , x BOOST_PP_TUPLE_EAT(1) \ - )(x) -/**/ - -# define BOOST_PARAMETER_FN_ARG_KEYWORD(x) \ - BOOST_PARAMETER_FUNCTION_KEYWORD( \ - BOOST_PARAMETER_FN_ARG_NAME(x) \ - ) - -// Builds forwarding functions. - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_TEMPLATE_Z(z, n) \ - template -/**/ - -# ifndef BOOST_NO_SFINAE -# define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, name, parameters, n) \ - , typename boost::parameter::aux::match< \ - parameters, BOOST_PP_ENUM_PARAMS(n, ParameterArgumentType) \ - >::type boost_parameter_enabler_argument = parameters() -# else -# define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, name, parameters, n) -# endif -/**/ - -# define BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(base) \ - BOOST_PP_CAT( \ - boost_param_parameters_ \ - , BOOST_PP_CAT(__LINE__, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)) \ - ) - -// Produce a name for a result type metafunction for the function -// named base -# define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base) \ - BOOST_PP_CAT( \ - boost_param_result_ \ - , BOOST_PP_CAT(__LINE__,BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)) \ - ) - -// Can't do boost_param_impl_ ## basee because base might start with an underscore -// daniel: what? how is that relevant? the reason for using CAT() is to make sure -// base is expanded. i'm not sure we need to here, but it's more stable to do it. -# define BOOST_PARAMETER_IMPL(base) \ - BOOST_PP_CAT(boost_param_impl,BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)) - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION00(z, n, r, data, elem) \ - BOOST_PP_IF( \ - n \ - , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_TEMPLATE_Z, BOOST_PP_TUPLE_EAT(2) \ - )(z,n) \ - BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(7,3,data)) \ - inline \ - BOOST_PP_EXPR_IF(n, typename) \ - BOOST_PARAMETER_FUNCTION_RESULT_NAME(BOOST_PP_TUPLE_ELEM(7,3,data))< \ - BOOST_PP_EXPR_IF(n, typename) \ - boost::parameter::aux::argument_pack< \ - BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(BOOST_PP_TUPLE_ELEM(7,3,data)) \ - BOOST_PP_COMMA_IF(n) \ - BOOST_PP_IF( \ - n, BOOST_PP_SEQ_ENUM, BOOST_PP_TUPLE_EAT(1) \ - )(elem) \ - >::type \ - >::type \ - BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(7,3,data))( \ - BOOST_PP_IF( \ - n \ - , BOOST_PP_SEQ_FOR_EACH_I_R \ - , BOOST_PP_TUPLE_EAT(4) \ - )( \ - r \ - , BOOST_PARAMETER_FUNCTION_ARGUMENT \ - , ~ \ - , elem \ - ) \ - BOOST_PP_IF(n, BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z, BOOST_PP_TUPLE_EAT(4))( \ - z \ - , BOOST_PP_TUPLE_ELEM(7,3,data) \ - , BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(BOOST_PP_TUPLE_ELEM(7,3,data)) \ - , n \ - ) \ - ) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(7,4,data), const) \ - { \ - return BOOST_PARAMETER_IMPL(BOOST_PP_TUPLE_ELEM(7,3,data))( \ - BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(BOOST_PP_TUPLE_ELEM(7,3,data))()( \ - BOOST_PP_ENUM_PARAMS_Z(z, n, a) \ - ) \ - ); \ - } -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION0(r, data, elem) \ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTION00( \ - BOOST_PP_TUPLE_ELEM(7,0,data) \ - , BOOST_PP_TUPLE_ELEM(7,1,data) \ - , r \ - , data \ - , elem \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_0(z, n, data) \ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTION00( \ - z, n, BOOST_PP_DEDUCE_R() \ - , (z, n, BOOST_PP_TUPLE_REM(5) data) \ - , ~ \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_N(z, n, data) \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTION0 \ - , (z, n, BOOST_PP_TUPLE_REM(5) data) \ - , BOOST_PP_SEQ_FOR_EACH_PRODUCT( \ - BOOST_PARAMETER_FUNCTION_FWD_PRODUCT \ - , BOOST_PP_SEQ_FIRST_N( \ - n, BOOST_PP_TUPLE_ELEM(5,3,data) \ - ) \ - ) \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION(z, n, data) \ - BOOST_PP_IF( \ - n \ - , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_N \ - , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_0 \ - )(z,n,data) \ -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS0( \ - result,name,args,const_,combinations,range \ -) \ - BOOST_PP_REPEAT_FROM_TO( \ - BOOST_PP_TUPLE_ELEM(2,0,range), BOOST_PP_TUPLE_ELEM(2,1,range) \ - , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION \ - , (result,name,const_,combinations,BOOST_PP_TUPLE_ELEM(2,1,range)) \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS(result,name,args, const_, combinations) \ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS0( \ - result, name, args, const_, combinations, BOOST_PARAMETER_ARITY_RANGE(args) \ - ) -/**/ - -// Builds boost::parameter::parameters<> specialization -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -# define BOOST_PARAMETER_FUNCTION_PARAMETERS_M(r,tag_namespace,i,elem) \ - BOOST_PP_COMMA_IF(i) \ - boost::parameter::BOOST_PARAMETER_FN_ARG_QUALIFIER(elem)< \ - tag_namespace::BOOST_PARAMETER_FUNCTION_KEYWORD( \ - BOOST_PARAMETER_FN_ARG_KEYWORD(elem) \ - ) \ - , typename boost::parameter::aux::unwrap_predicate< \ - void BOOST_PARAMETER_FN_ARG_PRED(elem) \ - >::type \ - > -# else -# define BOOST_PARAMETER_FUNCTION_PARAMETERS_M(r,tag_namespace,i,elem) \ - BOOST_PP_COMMA_IF(i) \ - boost::parameter::BOOST_PARAMETER_FN_ARG_QUALIFIER(elem)< \ - tag_namespace::BOOST_PARAMETER_FUNCTION_KEYWORD( \ - BOOST_PARAMETER_FN_ARG_KEYWORD(elem) \ - ) \ - , boost::mpl::always \ - > -# endif -/**/ - -# define BOOST_PARAMETER_FUNCTION_PARAMETERS(tag_namespace, base, args) \ - template \ - struct BOOST_PP_CAT( \ - BOOST_PP_CAT(boost_param_params_, __LINE__) \ - , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \ - ) : boost::parameter::parameters< \ - BOOST_PP_SEQ_FOR_EACH_I( \ - BOOST_PARAMETER_FUNCTION_PARAMETERS_M, tag_namespace, args \ - ) \ - > \ - {}; \ - \ - typedef BOOST_PP_CAT( \ - BOOST_PP_CAT(boost_param_params_, __LINE__) \ - , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \ - ) - -// Defines result type metafunction -# define BOOST_PARAMETER_FUNCTION_RESULT_ARG(z, _, i, x) \ - BOOST_PP_COMMA_IF(i) class BOOST_PP_TUPLE_ELEM(3,1,x) -/**/ - -# define BOOST_PARAMETER_FUNCTION_RESULT_(result, name, args) \ - template \ - struct BOOST_PARAMETER_FUNCTION_RESULT_NAME(name) \ - { \ - typedef typename BOOST_PARAMETER_PARENTHESIZED_TYPE(result) type; \ - }; - -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - -# define BOOST_PARAMETER_FUNCTION_RESULT(result, name, args) \ - BOOST_PARAMETER_FUNCTION_RESULT_(result, name, args) \ - template <> \ - struct BOOST_PARAMETER_FUNCTION_RESULT_NAME(name) \ - { typedef int type; }; - -# else - -# define BOOST_PARAMETER_FUNCTION_RESULT(result, name, args) \ - BOOST_PARAMETER_FUNCTION_RESULT_(result, name, args) - -# endif - -// Defines implementation function -# define BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name) \ - template \ - typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name)< \ - Args \ - >::type BOOST_PARAMETER_IMPL(name)(Args const& args) - -# define BOOST_PARAMETER_FUNCTION_IMPL_FWD(name) \ - BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name); -/**/ - -# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(state, arg) \ - ( \ - BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4, 0, state)) \ - , BOOST_PP_SEQ_PUSH_BACK(BOOST_PP_TUPLE_ELEM(4, 1, state), arg) \ - , BOOST_PP_TUPLE_ELEM(4, 2, state) \ - , BOOST_PP_TUPLE_ELEM(4, 3, state) \ - ) - -# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(state, arg) \ - ( \ - BOOST_PP_TUPLE_ELEM(4, 0, state) \ - , BOOST_PP_TUPLE_ELEM(4, 1, state) \ - , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4, 2, state)) \ - , BOOST_PP_SEQ_PUSH_BACK(BOOST_PP_TUPLE_ELEM(4, 3, state), arg) \ - ) - -# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG(s, state, arg) \ - BOOST_PP_CAT( \ - BOOST_PARAMETER_FUNCTION_SPLIT_ARG_ \ - , BOOST_PARAMETER_FN_ARG_QUALIFIER(arg) \ - )(state, arg) - -// Returns (required_count, required, optional_count, optionals) tuple -# define BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args) \ - BOOST_PP_SEQ_FOLD_LEFT( \ - BOOST_PARAMETER_FUNCTION_SPLIT_ARG \ - , (0,BOOST_PP_SEQ_NIL, 0,BOOST_PP_SEQ_NIL) \ - , args \ - ) - -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG_NAME(keyword) \ - BOOST_PP_CAT(BOOST_PP_CAT(keyword,_),type) - -// Helpers used as parameters to BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS. -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG(r, _, arg) \ - , class BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG_NAME( \ - BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \ - ) - -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG(r, _, arg) \ - , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG_NAME( \ - BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \ - )& BOOST_PARAMETER_FN_ARG_KEYWORD(arg) - -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_PARAMETER(r, _, arg) \ - , BOOST_PARAMETER_FN_ARG_KEYWORD(arg) - -// Produces a name for the dispatch functions. -# define BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name) \ - BOOST_PP_CAT( \ - boost_param_default_ \ - , BOOST_PP_CAT(__LINE__, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name)) \ - ) - -// Helper macro used below to produce lists based on the keyword argument -// names. macro is applied to every element. n is the number of -// optional arguments that should be included. -# define BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS(macro, n, split_args) \ - BOOST_PP_SEQ_FOR_EACH( \ - macro \ - , ~ \ - , BOOST_PP_TUPLE_ELEM(4,1,split_args) \ - ) \ - BOOST_PP_SEQ_FOR_EACH( \ - macro \ - , ~ \ - , BOOST_PP_SEQ_FIRST_N( \ - BOOST_PP_SUB(BOOST_PP_TUPLE_ELEM(4,2,split_args), n) \ - , BOOST_PP_TUPLE_ELEM(4,3,split_args) \ - ) \ - ) - -// Generates a keyword | default expression. -# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT(arg, tag_namespace) \ - boost::parameter::keyword< \ - tag_namespace::BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \ - >::get() | BOOST_PARAMETER_FN_ARG_DEFAULT(arg) -# else // For some reason, VC6 won't accept rvalues in this context. -# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT(arg, tag_namespace) \ - boost::parameter::keyword< \ - tag_namespace::BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \ - >::get() | boost::parameter::aux::as_lvalue(BOOST_PARAMETER_FN_ARG_DEFAULT(arg), 0L) -# endif - -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG(arg, tag_ns) \ - BOOST_PARAMETER_FUNCTION_CAST( \ - args[ \ - BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT( \ - arg, tag_ns \ - ) \ - ] \ - , BOOST_PARAMETER_FN_ARG_PRED(arg) \ - ) - -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_BODY(name, n, split_args, tag_namespace) \ - { \ - return BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \ - (ResultType(*)())0 \ - , args \ - BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \ - BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_PARAMETER \ - , n \ - , split_args \ - ) \ - , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG( \ - BOOST_PP_SEQ_ELEM( \ - BOOST_PP_SUB(BOOST_PP_TUPLE_ELEM(4,2,split_args), n) \ - , BOOST_PP_TUPLE_ELEM(4,3,split_args) \ - ) \ - , tag_namespace \ - ) \ - ); \ - } - -// Produces a forwarding layer in the default evaluation machine. -// -// data is a tuple: -// -// (name, split_args) -// -// Where name is the base name of the function, and split_args is a tuple: -// -// (required_count, required_args, optional_count, required_args) -// -# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION(z, n, data) \ - template < \ - class ResultType \ - , class Args \ - BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \ - BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG \ - , n \ - , BOOST_PP_TUPLE_ELEM(4,1,data) \ - ) \ - > \ - BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4,0,data)) \ - ResultType BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(BOOST_PP_TUPLE_ELEM(4,0,data))( \ - ResultType(*)() \ - , Args const& args \ - BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \ - BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG \ - , n \ - , BOOST_PP_TUPLE_ELEM(4,1,data) \ - ) \ - ) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4,2,data), const) \ - BOOST_PP_IF( \ - n \ - , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_BODY \ - , ; BOOST_PP_TUPLE_EAT(4) \ - )( \ - BOOST_PP_TUPLE_ELEM(4,0,data) \ - , n \ - , BOOST_PP_TUPLE_ELEM(4,1,data) \ - , BOOST_PP_TUPLE_ELEM(4,3,data) \ - ) - -# define BOOST_PARAMETER_FUNCTION_DEFAULT_GET_ARG(r, tag_ns, arg) \ - , BOOST_PARAMETER_FUNCTION_CAST( \ - args[ \ - boost::parameter::keyword::get() \ - ] \ - , BOOST_PARAMETER_FN_ARG_PRED(arg) \ - ) - -// Generates the function template that recives a ArgumentPack, and then -// goes on to call the layers of overloads generated by -// BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER. -# define BOOST_PARAMETER_FUNCTION_INITIAL_DISPATCH_FUNCTION(name, split_args, const_, tag_ns) \ - template \ - typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name)::type \ - BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \ - BOOST_PARAMETER_IMPL(name)(Args const& args) BOOST_PP_EXPR_IF(const_, const) \ - { \ - return BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \ - (typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name)::type(*)())0 \ - , args \ - \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_PARAMETER_FUNCTION_DEFAULT_GET_ARG \ - , tag_ns \ - , BOOST_PP_TUPLE_ELEM(4,1,split_args) \ - ) \ - \ - ); \ - } - -// Helper for BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER below. -# define BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER_AUX( \ - name, split_args, skip_fwd_decl, const_, tag_namespace \ - ) \ - BOOST_PP_REPEAT_FROM_TO( \ - skip_fwd_decl \ - , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4, 2, split_args)) \ - , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION \ - , (name, split_args, const_, tag_namespace) \ - ) \ - \ - BOOST_PARAMETER_FUNCTION_INITIAL_DISPATCH_FUNCTION(name, split_args, const_, tag_namespace) \ -\ - template < \ - class ResultType \ - , class Args \ - BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \ - BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG \ - , 0 \ - , split_args \ - ) \ - > \ - BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \ - ResultType BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \ - ResultType(*)() \ - , Args const& args \ - BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \ - BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG \ - , 0 \ - , split_args \ - ) \ - ) BOOST_PP_EXPR_IF(const_, const) - -// Generates a bunch of forwarding functions that each extract -// one more argument. -# define BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, skip_fwd_decl, const_, tag_ns) \ - BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER_AUX( \ - name, BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args), skip_fwd_decl, const_, tag_ns \ - ) -/**/ - -// Defines the result metafunction and the parameters specialization. -# define BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \ - BOOST_PARAMETER_FUNCTION_RESULT(result, name, args) \ - \ - BOOST_PARAMETER_FUNCTION_PARAMETERS(tag_namespace, name, args) \ - BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(name); \ - -// Helper for BOOST_PARAMETER_FUNCTION below. -# define BOOST_PARAMETER_FUNCTION_AUX(result, name, tag_namespace, args) \ - BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \ - BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name); \ -\ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \ - result, name, args, 0 \ - , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \ - ) \ - \ - BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, 0, 0, tag_namespace) - -// Defines a Boost.Parameter enabled function with the new syntax. -# define BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, args) \ - BOOST_PARAMETER_FUNCTION_AUX( \ - result, name, tag_namespace \ - , BOOST_PARAMETER_FLATTEN(3, 2, 3, args) \ - ) \ -/**/ - -// Defines a Boost.Parameter enabled function. -# define BOOST_PARAMETER_BASIC_FUNCTION_AUX(result, name, tag_namespace, args) \ - BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \ - \ - BOOST_PARAMETER_FUNCTION_IMPL_FWD(name) \ - \ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \ - result, name, args, 0 \ - , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \ - ) \ - \ - BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name) - -# define BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, args) \ - BOOST_PARAMETER_BASIC_FUNCTION_AUX( \ - result, name, tag_namespace \ - , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \ - ) \ -/**/ - -// Defines a Boost.Parameter enabled member function. -# define BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(result, name, tag_namespace, args, const_) \ - BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \ - \ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \ - result, name, args, const_ \ - , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \ - ) \ - \ - BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name) BOOST_PP_EXPR_IF(const_, const) \ -/**/ - -# define BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_namespace, args) \ - BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX( \ - result, name, tag_namespace \ - , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \ - , 0 \ - ) -/**/ - -# define BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_namespace, args) \ - BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX( \ - result, name, tag_namespace \ - , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \ - , 1 \ - ) -/**/ - - - -# define BOOST_PARAMETER_MEMBER_FUNCTION_AUX(result, name, tag_namespace, const_, args) \ - BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \ -\ - BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \ - result, name, args, const_ \ - , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \ - ) \ - \ - BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, 1, const_, tag_namespace) - -// Defines a Boost.Parameter enabled function with the new syntax. -# define BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, args) \ - BOOST_PARAMETER_MEMBER_FUNCTION_AUX( \ - result, name, tag_namespace, 0 \ - , BOOST_PARAMETER_FLATTEN(3, 2, 3, args) \ - ) \ -/**/ - -# define BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_namespace, args) \ - BOOST_PARAMETER_MEMBER_FUNCTION_AUX( \ - result, name, tag_namespace, 1 \ - , BOOST_PARAMETER_FLATTEN(3, 2, 3, args) \ - ) \ -/**/ - -// Defines a Boost.Parameter enabled constructor. - -# define BOOST_PARAMETER_FUNCTION_ARGUMENT(r, _, i, elem) \ - BOOST_PP_COMMA_IF(i) elem& BOOST_PP_CAT(a, i) -/**/ - -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - -// Older MSVC can't do what's necessary to handle commas in base names; just -// use a typedef instead if you have a base name that contains commas. -# define BOOST_PARAMETER_PARENTHESIZED_BASE(x) BOOST_PP_SEQ_HEAD(x) - -# else - -# define BOOST_PARAMETER_PARENTHESIZED_BASE(x) BOOST_PARAMETER_PARENTHESIZED_TYPE(x) - -# endif - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR00(z, n, r, data, elem) \ - BOOST_PP_IF( \ - n \ - , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_TEMPLATE_Z, BOOST_PP_TUPLE_EAT(2) \ - )(z, n) \ - BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n,1), explicit) \ - BOOST_PP_TUPLE_ELEM(6,2,data)( \ - BOOST_PP_IF( \ - n \ - , BOOST_PP_SEQ_FOR_EACH_I_R \ - , BOOST_PP_TUPLE_EAT(4) \ - )( \ - r \ - , BOOST_PARAMETER_FUNCTION_ARGUMENT \ - , ~ \ - , elem \ - ) \ - BOOST_PP_IF(n, BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z, BOOST_PP_TUPLE_EAT(4))( \ - z \ - , BOOST_PP_TUPLE_ELEM(6,3,data) \ - , BOOST_PP_CAT(constructor_parameters, __LINE__) \ - , n \ - ) \ - ) \ - : BOOST_PARAMETER_PARENTHESIZED_BASE(BOOST_PP_TUPLE_ELEM(6,3,data)) ( \ - BOOST_PP_CAT(constructor_parameters, __LINE__)()( \ - BOOST_PP_ENUM_PARAMS_Z(z, n, a) \ - ) \ - ) \ - {} -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR0(r, data, elem) \ - BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR00( \ - BOOST_PP_TUPLE_ELEM(6,0,data) \ - , BOOST_PP_TUPLE_ELEM(6,1,data) \ - , r \ - , data \ - , elem \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_PRODUCT(r, product) \ - (product) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_0(z, n, data) \ - BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR00( \ - z, n, BOOST_PP_DEDUCE_R() \ - , (z, n, BOOST_PP_TUPLE_REM(4) data) \ - , ~ \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_N(z, n, data) \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR0 \ - , (z, n, BOOST_PP_TUPLE_REM(4) data) \ - , BOOST_PP_SEQ_FOR_EACH_PRODUCT( \ - BOOST_PARAMETER_FUNCTION_FWD_PRODUCT \ - , BOOST_PP_SEQ_FIRST_N( \ - n, BOOST_PP_TUPLE_ELEM(4,2,data) \ - ) \ - ) \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR(z, n, data) \ - BOOST_PP_IF( \ - n \ - , BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_N \ - , BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_0 \ - )(z,n,data) \ -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS0(class_,base,args,combinations,range) \ - BOOST_PP_REPEAT_FROM_TO( \ - BOOST_PP_TUPLE_ELEM(2,0,range), BOOST_PP_TUPLE_ELEM(2,1,range) \ - , BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR \ - , (class_,base,combinations,BOOST_PP_TUPLE_ELEM(2,1,range)) \ - ) -/**/ - -# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS(class_,base,args,combinations) \ - BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS0( \ - class_, base, args, combinations, BOOST_PARAMETER_ARITY_RANGE(args) \ - ) -/**/ - -# define BOOST_PARAMETER_CONSTRUCTOR_AUX(class_, base, tag_namespace, args) \ - BOOST_PARAMETER_FUNCTION_PARAMETERS(tag_namespace, ctor, args) \ - BOOST_PP_CAT(constructor_parameters, __LINE__); \ -\ - BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS( \ - class_, base, args \ - , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \ - ) \ -/**/ - -# define BOOST_PARAMETER_CONSTRUCTOR(class_, base, tag_namespace, args) \ - BOOST_PARAMETER_CONSTRUCTOR_AUX( \ - class_, base, tag_namespace \ - , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \ - ) -/**/ - -# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# define BOOST_PARAMETER_FUNCTION_FWD_COMBINATION(r, _, i, elem) \ - (BOOST_PP_IF( \ - BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER( \ - BOOST_PARAMETER_FN_ARG_NAME(elem) \ - ) \ - , (const ParameterArgumentType ## i)(ParameterArgumentType ## i) \ - , (const ParameterArgumentType ## i) \ - )) -# else -# define BOOST_PARAMETER_FUNCTION_FWD_COMBINATION(r, _, i, elem) \ - (BOOST_PP_IF( \ - BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER( \ - BOOST_PARAMETER_FN_ARG_NAME(elem) \ - ) \ - , (ParameterArgumentType ## i) \ - , (const ParameterArgumentType ## i) \ - )) -# endif - -# define BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \ - BOOST_PP_SEQ_FOR_EACH_I(BOOST_PARAMETER_FUNCTION_FWD_COMBINATION, ~, args) - -#endif // BOOST_PARAMETER_PREPROCESSOR_060206_HPP - diff --git a/include/boost/parameter/python.hpp b/include/boost/parameter/python.hpp deleted file mode 100755 index 252ec03..0000000 --- a/include/boost/parameter/python.hpp +++ /dev/null @@ -1,734 +0,0 @@ -// Copyright Daniel Wallin 2006. 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) - -#ifndef BOOST_PARAMETER_PYTHON_060209_HPP -# define BOOST_PARAMETER_PYTHON_060209_HPP - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -namespace boost { namespace parameter { namespace python -{ - namespace python_ = boost::python; -}}} - -namespace boost { namespace parameter { namespace python { namespace aux -{ - - inline PyObject* unspecified_type() - { - static PyTypeObject unspecified = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "Boost.Parameter.Unspecified", /* tp_name */ - PyType_Type.tp_basicsize, /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - 0, /* tp_doc */ - }; - - if (unspecified.ob_type == 0) - { - unspecified.ob_type = &PyType_Type; - PyType_Ready(&unspecified); - } - - return (PyObject*)&unspecified; - } - - struct empty_tag {}; - - struct empty_tag_to_python - { - static PyObject* convert(empty_tag) - { - return python_::xincref(unspecified_type()); - } - }; - -}}}} // namespace boost::parameter::python::aux - -namespace boost { namespace python -{ - - // Converts a Python value to a maybe - template - struct arg_from_python > - : arg_from_python - { - arg_from_python(PyObject* p) - : arg_from_python(p) - , empty(parameter::python::aux::unspecified_type() == p) - {} - - bool convertible() const - { - return empty || arg_from_python::convertible(); - } - - parameter::aux::maybe operator()() - { - if (empty) - { - return parameter::aux::maybe(); - } - else - { - return parameter::aux::maybe( - arg_from_python::operator()() - ); - } - } - - bool empty; - }; - -}} // namespace boost::python - -namespace boost { namespace parameter { namespace python { - -namespace aux -{ - - template - struct is_optional - : mpl::not_< - mpl::or_ - > - {}; - - template - struct arg_spec - { - typedef K keyword; - typedef Required required; - typedef T type; - typedef Optimized optimized_default; - }; - - template - struct make_arg_spec_impl - { - typedef arg_spec< - typename K::first, typename K::second, Optimized, T - > type; - }; - - template - struct make_arg_spec_impl - { - typedef arg_spec< - typename K::first, typename K::second, typename K::third, T - > type; - }; - - template - struct make_arg_spec - : make_arg_spec_impl - { - }; - - template - struct combinations_op - { - typedef typename State::second bits; - typedef typename State::first result0; - - typedef typename mpl::if_< - mpl::or_< - typename Spec::required - , typename Spec::optimized_default - , mpl::bitand_ > - > - , typename mpl::push_back::type - , result0 - >::type result; - - typedef typename mpl::if_< - mpl::or_< - typename Spec::required - , typename Spec::optimized_default - > - , bits - , typename mpl::shift_right >::type - >::type next_bits; - - typedef mpl::pair< - result - , next_bits - > type; - }; - - // Used as start value in the recursive arg() composition below. - struct no_keywords - { - template - T const& operator,(T const& x) const - { - return x; - } - }; - - template - void def_combination_aux0( - Def def, F f, Iter, End, Keywords const& keywords, mpl::false_) - { - typedef typename mpl::deref::type spec; - typedef typename spec::keyword kw; - - def_combination_aux( - def, f, typename mpl::next::type(), End() - , ( - keywords, boost::python::arg(kw::keyword_name()) - ) - ); - } - - template - void def_combination_aux0( - Def def, F f, Iter, End, Keywords const& keywords, mpl::true_) - { - typedef typename mpl::deref::type spec; - typedef typename spec::keyword kw; - - def_combination_aux( - def, f, typename mpl::next::type(), End() - , ( - keywords, boost::python::arg(kw::keyword_name()) = empty_tag() - ) - ); - } - - inline void initialize_converter() - { - static python_::to_python_converter x; - } - - template - void def_combination_aux( - Def def, F f, Iter, End, Keywords const& keywords) - { - typedef typename mpl::deref::type spec; - - typedef typename mpl::and_< - typename spec::optimized_default - , mpl::not_ - >::type optimized_default; - - def_combination_aux0( - def, f, Iter(), End(), keywords, optimized_default() - ); - } - - template - void def_combination_aux( - Def def, F f, End, End, Keywords const& keywords) - { - def(f, keywords); - } - - template - void def_combination_aux( - Def def, F f, End, End, no_keywords const&) - { - def(f); - } - - template < - class Def, class Specs, class Bits, class Invoker - > - void def_combination( - Def def, Specs*, Bits, Invoker*) - { - typedef typename mpl::fold< - Specs - , mpl::pair, Bits> - , combinations_op - >::type combination0; - - typedef typename combination0::first combination; - - typedef typename mpl::apply_wrap1< - Invoker, combination - >::type invoker; - - def_combination_aux( - def - , &invoker::execute - , typename mpl::begin::type() - , typename mpl::end::type() - , no_keywords() - ); - } - - template < - class Def, class Specs, class Bits, class End, class Invoker - > - void def_combinations( - Def def, Specs*, Bits, End, Invoker*) - { - initialize_converter(); - - def_combination(def, (Specs*)0, Bits(), (Invoker*)0); - - def_combinations( - def - , (Specs*)0 - , mpl::long_() - , End() - , (Invoker*)0 - ); - } - - template < - class Def, class Specs, class End, class Invoker - > - void def_combinations( - Def, Specs*, End, End, Invoker*) - {} - - struct not_specified {}; - - template - struct call_policies_as_options - { - call_policies_as_options(CallPolicies const& call_policies) - : call_policies(call_policies) - {} - - CallPolicies const& policies() const - { - return call_policies; - } - - char const* doc() const - { - return 0; - } - - CallPolicies call_policies; - }; - - template - struct def_class - { - def_class(Class& cl, char const* name, Options options = Options()) - : cl(cl) - , name(name) - , options(options) - {} - - template - void def(F f, not_specified const*) const - { - cl.def(name, f); - } - - template - void def(F f, void const*) const - { - cl.def(name, f, options.doc(), options.policies()); - } - - template - void operator()(F f) const - { - this->def(f, &options); - } - - template - void def(F f, Keywords const& keywords, not_specified const*) const - { - cl.def(name, f, keywords); - } - - template - void def(F f, Keywords const& keywords, void const*) const - { - cl.def(name, f, keywords, options.doc(), options.policies()); - } - - template - void operator()(F f, Keywords const& keywords) const - { - this->def(f, keywords, &options); - } - - Class& cl; - char const* name; - Options options; - }; - - template - struct def_init - { - def_init(Class& cl, CallPolicies call_policies = CallPolicies()) - : cl(cl) - , call_policies(call_policies) - {} - - template - void operator()(F f) const - { - cl.def( - "__init__" - , boost::python::make_constructor(f, call_policies) - ); - } - - template - void operator()(F f, Keywords const& keywords) const - { - cl.def( - "__init__" - , boost::python::make_constructor(f, call_policies, keywords) - ); - } - - Class& cl; - CallPolicies call_policies; - }; - - struct def_function - { - def_function(char const* name) - : name(name) - {} - - template - void operator()(F f) const - { - boost::python::def(name, f); - } - - template - void operator()(F f, Keywords const& keywords) const - { - boost::python::def(name, f, keywords); - } - - char const* name; - }; - -} // namespace aux - -template -void def(char const* name, Signature) -{ - typedef mpl::iterator_range< - typename mpl::next< - typename mpl::begin::type - >::type - , typename mpl::end::type - > arg_types; - - typedef typename mpl::transform< - typename M::keywords - , arg_types - , aux::make_arg_spec - , mpl::back_inserter > - >::type arg_specs; - - typedef typename mpl::count_if< - arg_specs - , aux::is_optional - >::type optional_arity; - - typedef typename mpl::front::type result_type; - typedef typename mpl::shift_left, optional_arity>::type upper; - - aux::def_combinations( - aux::def_function(name) - , (arg_specs*)0 - , mpl::long_<0>() - , mpl::long_() - , (aux::make_invoker*)0 - ); -} - -template -void def(Class& cl, char const* name, Signature) -{ - typedef mpl::iterator_range< - typename mpl::next< - typename mpl::begin::type - >::type - , typename mpl::end::type - > arg_types; - - typedef typename mpl::transform< - typename M::keywords - , arg_types - , aux::make_arg_spec - , mpl::back_inserter > - >::type arg_specs; - - typedef typename mpl::count_if< - arg_specs - , aux::is_optional - >::type optional_arity; - - typedef typename mpl::front::type result_type; - typedef typename mpl::shift_left, optional_arity>::type upper; - - aux::def_combinations( - aux::def_class(cl, name) - , (arg_specs*)0 - , mpl::long_<0>() - , mpl::long_() - , (aux::make_invoker*)0 - ); -} - -namespace aux -{ - - template - struct keyword - { - typedef K type; - }; - - template - struct keyword - { - typedef K type; - }; - - template - struct keyword - { - typedef K type; - }; - - template - struct required - { - typedef mpl::true_ type; - }; - - template - struct required - { - typedef mpl::false_ type; - }; - - template - struct optimized - { - typedef mpl::true_ type; - }; - - template - struct optimized - { - typedef mpl::false_ type; - }; - - template - struct make_kw_spec; - - template - struct make_kw_spec - { - typedef arg_spec< - typename keyword::type - , typename required::type - , typename optimized::type - , T - > type; - }; - -} // namespace aux - -template -struct init - : boost::python::def_visitor > -{ - init(CallPolicies call_policies = CallPolicies()) - : call_policies(call_policies) - {} - - template - init - operator[](CallPolicies1 const& call_policies) const - { - return init(call_policies); - } - - template - void visit_aux(Class& cl, mpl::true_) const - { - cl.def(boost::python::init<>()[call_policies]); - } - - template - void visit_aux(Class& cl, mpl::false_) const - { - typedef typename mpl::transform< - ParameterSpecs - , aux::make_kw_spec - , mpl::back_inserter > - >::type arg_specs; - - typedef typename mpl::count_if< - arg_specs - , aux::is_optional - >::type optional_arity; - - typedef typename mpl::shift_left, optional_arity>::type upper; - - aux::def_combinations( - aux::def_init(cl, call_policies) - , (arg_specs*)0 - , mpl::long_<0>() - , mpl::long_() - , (aux::make_init_invoker*)0 - ); - } - - template - void visit(Class& cl) const - { - visit_aux(cl, mpl::empty()); - } - - CallPolicies call_policies; -}; - -template -struct call - : boost::python::def_visitor > -{ - call(CallPolicies const& call_policies = CallPolicies()) - : call_policies(call_policies) - {} - - template - call - operator[](CallPolicies1 const& call_policies) const - { - return call(call_policies); - } - - template - void visit(Class& cl) const - { - typedef mpl::iterator_range< - typename mpl::next< - typename mpl::begin::type - >::type - , typename mpl::end::type - > arg_types; - - typedef typename mpl::front::type result_type; - - typedef typename mpl::transform< - arg_types - , aux::make_kw_spec - , mpl::back_inserter > - >::type arg_specs; - - typedef typename mpl::count_if< - arg_specs - , aux::is_optional - >::type optional_arity; - - typedef typename mpl::shift_left, optional_arity>::type upper; - - typedef aux::call_policies_as_options options; - - aux::def_combinations( - aux::def_class(cl, "__call__", options(call_policies)) - , (arg_specs*)0 - , mpl::long_<0>() - , mpl::long_() - , (aux::make_call_invoker*)0 - ); - } - - CallPolicies call_policies; -}; - -template -struct function - : boost::python::def_visitor > -{ - template - void visit(Class& cl, char const* name, Options const& options) const - { - typedef mpl::iterator_range< - typename mpl::next< - typename mpl::begin::type - >::type - , typename mpl::end::type - > arg_types; - - typedef typename mpl::front::type result_type; - - typedef typename mpl::transform< - arg_types - , aux::make_kw_spec - , mpl::back_inserter > - >::type arg_specs; - - typedef typename mpl::count_if< - arg_specs - , aux::is_optional - >::type optional_arity; - - typedef typename mpl::shift_left, optional_arity>::type upper; - - aux::def_combinations( - aux::def_class(cl, name, options) - , (arg_specs*)0 - , mpl::long_<0>() - , mpl::long_() - , (aux::make_member_invoker< - Fwd, result_type, typename Class::wrapped_type - >*)0 - ); - } -}; - -}}} // namespace boost::parameter::python - -#endif // BOOST_PARAMETER_PYTHON_060209_HPP -