diff --git a/doc/Jamfile b/doc/Jamfile index 13454575..8348f7eb 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -1,5 +1,5 @@ #============================================================================== -# Copyright (c) 2003-2007 Joel de Guzman +# Copyright (c) 2003-2011 Joel de Guzman # # Use, modification and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/acknowledgements.qbk b/doc/acknowledgements.qbk index fd66c3c5..da059955 100644 --- a/doc/acknowledgements.qbk +++ b/doc/acknowledgements.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/adapted.qbk b/doc/adapted.qbk index ea47a5d1..47e538c5 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt Use, modification and distribution is subject to the Boost Software @@ -243,7 +244,7 @@ __random_access_sequence__. [heading Semantics] -The above macro generates the necessary code to adapt `struct_name` or an +The above macro generates the necessary code to adapt `struct_name` or an arbitrary specialization of `struct_name` as a model of __random_access_sequence__. The sequence `(template_param0)(template_param1)...` declares the names of @@ -286,9 +287,9 @@ namespace qualified name of the struct to be adapted. [section:adapt_struct_named BOOST_FUSION_ADAPT_STRUCT_NAMED] [heading Description] -BOOST_FUSION_ADAPT_STRUCT_NAMED and BOOST_FUSION_ADAPT_STRUCT_NAMED_NS are -macros that can be used to generate all the necessary boilerplate to make an -arbitrary struct a model of __random_access_sequence__. The given struct is +BOOST_FUSION_ADAPT_STRUCT_NAMED and BOOST_FUSION_ADAPT_STRUCT_NAMED_NS are +macros that can be used to generate all the necessary boilerplate to make an +arbitrary struct a model of __random_access_sequence__. The given struct is adapted using the given name. [heading Synopsis] @@ -311,7 +312,7 @@ adapted using the given name. [heading Semantics] The above macros generate the necessary code to adapt `struct_name` -as a model of __random_access_sequence__ while using `adapted_name` as the +as a model of __random_access_sequence__ while using `adapted_name` as the name of the adapted struct. The sequence `(namespace0)(namespace1)...` declares the namespace for `adapted_name`. It yields to a fully qualified name for `adapted_name` of @@ -426,7 +427,7 @@ __random_access_sequence__ and __associative_sequence__. [heading Semantics] -The above macro generates the necessary code to adapt `struct_name` or an +The above macro generates the necessary code to adapt `struct_name` or an arbitrary specialization of `struct_name` as a model of __random_access_sequence__ and __associative_sequence__. The sequence `(template_param0)(template_param1)...` declares the names of @@ -462,7 +463,7 @@ namespace qualified name of the struct to be adapted. struct name; struct age; } - + // Any instantiated demo::employee is now a Fusion sequence. // It is also an associative sequence with // keys keys::name and keys::age present. @@ -477,8 +478,8 @@ namespace qualified name of the struct to be adapted. [section:adapt_assoc_struct_named BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED] [heading Description] -BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED and BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS are -macros that can be used to generate all the necessary boilerplate to make an +BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED and BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS are +macros that can be used to generate all the necessary boilerplate to make an arbitrary struct a model of __random_access_sequence__ and __associative_sequence__. The given struct is adapted using the given name. @@ -538,7 +539,7 @@ namespace qualified name of the struct to be converted. struct name; struct age; } - + // boost::fusion::adapted::adapted_employee is now a Fusion sequence // referring to demo::employee BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( @@ -566,7 +567,7 @@ __random_access_sequence__. [heading Expression Semantics] The above macro generates the necessary code to adapt `type_name` -as a model of __random_access_sequence__. +as a model of __random_access_sequence__. The sequence of [^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N])] quadruples declares the types, const types, get-expressions and set-expressions @@ -599,7 +600,7 @@ namespace qualified name of the class type to be adapted. #include #include - + [heading Example] namespace demo { @@ -608,41 +609,41 @@ namespace qualified name of the class type to be adapted. private: std::string name; int age; - + public: void set_name(std::string const& n) { name=n; } - + void set_age(int a) { age=a; } - + std::string const& get_name()const { return name; } - + int get_age()const { return age; } }; } - + BOOST_FUSION_ADAPT_ADT( demo::employee, (std::string const&, std::string const&, obj.get_name(), obj.set_name(val)) (int, int, obj.get_age(), obj.set_age(val))) - + demo::employee e; front(e)="Edward Norton"; back(e)=41; //Prints 'Edward Norton is 41 years old' std::cout << e.get_name() << " is " << e.get_age() << " years old" << std::endl; - + [heading See also] __adt_attribute_proxy__ @@ -669,7 +670,7 @@ __random_access_sequence__. The above macro generates the necessary code to adapt `type_name` or an arbitrary specialization of `type_name` -as a model of __random_access_sequence__. +as a model of __random_access_sequence__. The sequence `(template_param0)(template_param1)...` declares the names of the template type parameters used. The sequence `(specialization_param0)(specialization_param1)...` @@ -707,40 +708,40 @@ namespace qualified name of the template class type to be adapted. #include #include - + [heading Example] namespace demo - { + { template struct employee { private: Name name; Age age; - + public: void set_name(Name const& n) { name=n; } - + void set_age(Age const& a) { age=a; } - + Name const& get_name()const { return name; } - + Age const& get_age()const { return age; } }; } - + BOOST_FUSION_ADAPT_TPL_ADT( (Name)(Age), (demo::employee) (Name)(Age), @@ -752,7 +753,7 @@ namespace qualified name of the template class type to be adapted. boost::fusion::back(e)=41; //Prints 'Edward Norton is 41 years old' std::cout << e.get_name() << " is " << e.get_age() << " years old" << std::endl; - + [heading See also] __adt_attribute_proxy__ @@ -777,7 +778,7 @@ __random_access_sequence__ and __associative_sequence__. [heading Expression Semantics] The above macro generates the necessary code to adapt `type_name` -as a model of __random_access_sequence__ and __associative_sequence__. +as a model of __random_access_sequence__ and __associative_sequence__. The sequence of [^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N], key_type['N])] 5-tuples declares the types, const types, get-expressions, set-expressions and key types @@ -799,7 +800,7 @@ The actual return type of fusion's intrinsic sequence access (meta-)functions when in invoked with (an instance of) `type_name` is a proxy type. This type is implicitly convertible to the attribute type via [^get_expr['N]] and forwards assignment to the underlying element via [^set_expr['N]]. -The value type (that is the type returned by __result_of_value_of__, __result_of_value_of_data__, +The value type (that is the type returned by __result_of_value_of__, __result_of_value_of_data__, __result_of_value_at__, __result_of_value_at_c__ and __result_of_value_at_key__) of the ['N]th element is [^attribute_type['N]] with const-qualifier and reference removed. @@ -810,7 +811,7 @@ namespace qualified name of the class type to be adapted. #include #include - + [heading Example] namespace demo { @@ -819,47 +820,47 @@ namespace qualified name of the class type to be adapted. private: std::string name; int age; - + public: void set_name(std::string const& n) { name=n; } - + void set_age(int a) { age=a; } - + std::string const& get_name()const { return name; } - + int get_age()const { return age; } }; } - + namespace keys { struct name; struct age; } - + BOOST_FUSION_ADAPT_ASSOC_ADT( demo::employee, (std::string const&, std::string const&, obj.get_name(), obj.set_name(val), keys::name) (int, int, obj.get_age(), obj.set_age(val), keys::age)) - + demo::employee e; at_key(e)="Edward Norton"; at_key(e)=41; //Prints 'Edward Norton is 41 years old' std::cout << e.get_name() << " is " << e.get_age() << " years old" << std::endl; - + [heading See also] __adt_attribute_proxy__ @@ -886,7 +887,7 @@ __random_access_sequence__ and __associative_sequence__. The above macro generates the necessary code to adapt `type_name` or an arbitrary specialization of `type_name` -as a model of __random_access_sequence__ and __associative_sequence__. +as a model of __random_access_sequence__ and __associative_sequence__. The sequence `(template_param0)(template_param1)...` declares the names of the template type parameters used. The sequence `(specialization_param0)(specialization_param1)...` @@ -913,7 +914,7 @@ The actual return type of fusion's intrinsic sequence access (meta-)functions when in invoked with (an instance of) `type_name` is a proxy type. This type is implicitly convertible to the attribute type via [^get_expr['N]] and forwards assignment to the underlying element via [^set_expr['N]]. -The value type (that is the type returned by __result_of_value_of__, __result_of_value_of_data__, +The value type (that is the type returned by __result_of_value_of__, __result_of_value_of_data__, __result_of_value_at__, __result_of_value_at_c__ and __result_of_value_at_key__) of the ['N]th element is [^attribute_type['N]] with const-qualifier and reference removed. @@ -924,7 +925,7 @@ namespace qualified name of the template class type to be adapted. #include #include - + [heading Example] namespace demo { @@ -934,48 +935,48 @@ namespace qualified name of the template class type to be adapted. private: Name name; Age age; - + public: void set_name(Name const& n) { name=n; } - + void set_age(Age const& a) { age=a; } - + Name const& get_name()const { return name; } - + Age const& get_age()const { return age; } }; } - + namespace keys { struct name; struct age; } - + BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( (Name)(Age), (demo::employee) (Name)(Age), (Name const&, Name const&, obj.get_name(), obj.set_name(val), keys::name) (Age const&, Age const&, obj.get_age(), obj.set_age(val), keys::age)) - + demo::employee e; at_key(e)="Edward Norton"; at_key(e)=41; //Prints 'Edward Norton is 41 years old' std::cout << e.get_name() << " is " << e.get_age() << " years old" << std::endl; - + [heading See also] __adt_attribute_proxy__ @@ -1027,14 +1028,14 @@ defined in __random_access_sequence__. [[`struct_name(e0, e1,... en)`] [Creates an instance of `struct_name` with elements `e0`...`en`.]] [[`struct_name(fs)`] [Copy constructs an instance of `struct_name` from a __forward_sequence__ `fs`.]] [[`str = fs`] [Assigns from a __forward_sequence__ `fs`.]] - [[`str.member_nameN`] [Access of struct member `member_nameN`]] + [[`str.member_nameN`] [Access of struct member `member_nameN`]] ] [heading Header] #include #include - + [heading Example] // demo::employee is a Fusion sequence @@ -1096,14 +1097,14 @@ defined in __random_access_sequence__. [[`Str(e0, e1,... en)`] [Creates an instance of `Str` with elements `e0`...`en`.]] [[`Str(fs)`] [Copy constructs an instance of `Str` from a __forward_sequence__ `fs`.]] [[`str = fs`] [Assigns from a __forward_sequence__ `fs`.]] - [[`str.member_nameN`] [Access of struct member `member_nameN`]] + [[`str.member_nameN`] [Access of struct member `member_nameN`]] ] [heading Header] #include #include - + [heading Example] // Any instantiated demo::employee is a Fusion sequence @@ -1161,14 +1162,14 @@ defined in __random_access_sequence__ and __associative_sequence__. [[`struct_name(e0, e1,... en)`] [Creates an instance of `struct_name` with elements `e0`...`en`.]] [[`struct_name(fs)`] [Copy constructs an instance of `struct_name` from a __forward_sequence__ `fs`.]] [[`str = fs`] [Assigns from a __forward_sequence__ `fs`.]] - [[`str.member_nameN`] [Access of struct member `member_nameN`]] + [[`str.member_nameN`] [Access of struct member `member_nameN`]] ] [heading Header] #include #include - + [heading Example] namespace keys @@ -1176,7 +1177,7 @@ defined in __random_access_sequence__ and __associative_sequence__. struct name; struct age; } - + // demo::employee is a Fusion sequence BOOST_FUSION_DEFINE_ASSOC_STRUCT( (demo), employee, @@ -1237,14 +1238,14 @@ defined in __random_access_sequence__ and __associative_sequence__. [[`Str(e0, e1,... en)`] [Creates an instance of `Str` with elements `e0`...`en`.]] [[`Str(fs)`] [Copy constructs an instance of `Str` from a __forward_sequence__ `fs`.]] [[`str = fs`] [Assigns from a __forward_sequence__ `fs`.]] - [[`str.member_nameN`] [Access of struct member `member_nameN`]] + [[`str.member_nameN`] [Access of struct member `member_nameN`]] ] [heading Header] #include #include - + [heading Example] namespace keys @@ -1252,7 +1253,7 @@ defined in __random_access_sequence__ and __associative_sequence__. struct name; struct age; } - + // Any instantiated demo::employee is a Fusion sequence BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( (Name)(Age), (demo), employee, diff --git a/doc/algorithm.qbk b/doc/algorithm.qbk index d60df5fc..fd136f6d 100644 --- a/doc/algorithm.qbk +++ b/doc/algorithm.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt Use, modification and distribution is subject to the Boost Software @@ -10,18 +11,20 @@ [heading Lazy Evaluation] -Unlike __mpl__, Fusion algorithms are lazy and non sequence-type -preserving. What does that mean? It means that when you operate on a -sequence through a Fusion algorithm that returns a sequence, the sequence -returned may not be of the same class as the original. This is by design. -Runtime efficiency is given a high priority. Like __mpl__, and unlike -__stl__, fusion algorithms are functional in nature such that algorithms +Unlike __mpl__, Fusion algorithms are lazy[footnote Except for some +special cases such as __for_each__ and __copy__ which are inherently +imperative algorithms.] and non sequence-type preserving [footnote What +does that mean? It means that when you operate on a sequence through a +Fusion algorithm that returns a sequence, the sequence returned may not +be of the same class as the original]. This is by design. Runtime +efficiency is given a high priority. Like __mpl__, and unlike __stl__, +fusion algorithms are mostly functional in nature such that algorithms are non mutating (no side effects). However, due to the high cost of returning full sequences such as vectors and lists, /Views/ are returned from Fusion algorithms instead. For example, the __transform__ algorithm does not actually return a transformed version of the original sequence. -__transform__ returns a __transform_view__. This view holds a reference to -the original sequence plus the transform function. Iteration over the +__transform__ returns a __transform_view__. This view holds a reference +to the original sequence plus the transform function. Iteration over the __transform_view__ will apply the transform function over the sequence elements on demand. This /lazy/ evaluation scheme allows us to chain as many algorithms as we want without incurring a high runtime penalty. @@ -37,6 +40,7 @@ the original sequence `s` and the value `x`. Functions that were once sequence specific and need to be implemented N times over N different sequences are now implemented only once. That is to say that Fusion sequences are cheaply extensible. + To regain the original sequence, __conversion__ functions are provided. You may use one of the __conversion__ functions to convert back to the original sequence type. @@ -46,6 +50,61 @@ sequence type. #include #include +[section Auxiliary] + +The auxiliary algorithms provide the utility algorithms for sequences. + +[heading Header] + + #include + #include + +[section Functions] + +[section copy] + +[heading Description] +Copy a sequence `src` to a sequence `dest`. +It is also used to convert sequence into other. + +[heading Synopsis] + template + void copy(Seq1 const& src, Seq2& dest); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`src`][A model of __forward_sequence__, all elements contained in the `src` sequence should be convertible into the element contained in the `dest` sequence.][Operation's argument]] + [[`dest`][A model of __forward_sequence__, `e2 = e1` is valid expression for each pair of elements `e1` of `src` and `e2` of `dest`.][Operation's argument]] +] + +[heading Expression Semantics] + __copy__(src, dest); + +[*Return type]: `void` + +[*Semantics]: `e2 = e1` for each element `e1` in `src` and `e2` in `dest`. + +[heading Complexity] +Linear, exactly `__result_of_size__::value`. + +[heading Header] + + #include + #include + +[heading Example] + __vector__ vec(1,2); + __list__ ls; + __copy__(vec, ls); + assert(ls == __make_list__(1,2)); + +[endsect] + +[endsect] + +[endsect] + + [section Iteration] The iteration algorithms provide the fundamental algorithms for traversing @@ -75,7 +134,7 @@ the first call) and [arg_desc] of `seq`. > typename result_of_name_macro::type name_macro( Sequence& seq, State const& initial_state, F f); - + template< typename Sequence, typename State, diff --git a/doc/changelog.qbk b/doc/changelog.qbk index 67a65d0e..9bccc0c0 100644 --- a/doc/changelog.qbk +++ b/doc/changelog.qbk @@ -1,5 +1,7 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden + Copyright (C) 2006 Tobias Schwinger Copyright (C) 2010 Christopher Schmidt Use, modification and distribution is subject to the Boost Software @@ -37,6 +39,11 @@ This section summarizes significant changes to the Fusion library. (Christopher Schmidt) * October 7, 2010: Added __adapt_adt__, __adapt_tpl_adt__, __adapt_assoc_adt__ and __adapt_assoc_tpl_adt__ (Joel de Guzman, - Hartmut Kaiser and Christopher Schmidt) + Hartmut Kaiser and Christopher Schmidt) +* August 29, 2011: Added support for segmented sequences and iterators (Eric Niebler) +* September 16, 2011: Added preprocessed files (using wave) to speed up + compilation (Joel de Guzman) +* October 8, 2011: Added adaptor for std::tuple (Joel de Guzman) +* October 10, 2011: Made map random access (Brandon Kohn) [endsect] diff --git a/doc/container.qbk b/doc/container.qbk index 83c10c1a..fe55beda 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -419,7 +420,7 @@ including any Fusion header to change the default. Example: [heading Model of] * __associative_sequence__ -* __forward_sequence__ +* __random_access_sequence__ [variablelist Notation [[`M`] [A `map` type]] @@ -431,7 +432,7 @@ including any Fusion header to change the default. Example: [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not -defined in __random_access_sequence__ and __associative_sequence__. +defined in __forward_sequence__ and __associative_sequence__. [table [[Expression] [Semantics]] @@ -681,7 +682,7 @@ Create a __map__ from one or more key/data pairs. , typename T0, typename T1,... typename TN> typename __result_of_make_map__::type make_map(T0 const& x0, T1 const& x1... TN const& xN); - + The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant diff --git a/doc/extension.qbk b/doc/extension.qbk index b0159072..354bc13e 100644 --- a/doc/extension.qbk +++ b/doc/extension.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -390,7 +391,7 @@ for a variety of types. [heading Description] The __sequence_facade__ template provides an intrusive mechanism for -producing a conforming Fusion iterator. +producing a conforming Fusion sequence. [heading Synopsis] template @@ -415,6 +416,8 @@ The user must the implement the key expressions required by their sequence type. [[`sequence::template end::call(seq)`][An iterator to the end of sequence `seq`]] [[`sequence::template size::type`][The size of a sequence of type `Seq` as an __mpl_integral_constant__]] [[`sequence::template size::call(seq)`][The size of sequence `seq`]] +[[`sequence::template empty::type`][Returns `mpl::true_` if `Seq` has zero elements, `mpl::false_` otherwise.]] +[[`sequence::template empty::call`][Returns a type convertible to `bool` that evaluates to true if the sequence is empty, else, evaluates to false. ]] [[`sequence::template at::type`][The type of element `N` in a sequence of type `Seq`]] [[`sequence::template at::call(seq)`][Element `N` in sequence `seq`]] [[`sequence::template value_at::type`][The type of the `N`th element in a sequence of type `Seq`]] @@ -465,8 +468,8 @@ The user must the implement the key expressions required by their iterator type. [[`iterator::template advance::call(it)`][An iterator advanced `N` elements from `it`][Implemented in terms of `next` and `prior`]] [[`iterator::template distance::type`][The distance between iterators of type `It1` and `It2` as an __mpl_integral_constant__][None]] [[`iterator::template distance::call(it1, it2)`][The distance between iterator `it1` and `it2`][None]] -[[`iterator::template equal_to::type`][The distance between iterators of type `It1` and `It2`][`boost::same_type::type`]] -[[`iterator::template equal_to::call(it1, it2)`][The distance between iterators `it1` and `it2`][`boost::same_type::type()`]] +[[`iterator::template equal_to::type`][Returns `mpl::true_` if `It1` is equal to `It2`, `mpl::false_` otherwise.][`boost::same_type::type`]] +[[`iterator::template equal_to::call(it1, it2)`][Returns a type convertible to `bool` that evaluates to `true` if `It1` is equal to `It2`, `false` otherwise.][`boost::same_type::type()`]] [[`iterator::template key_of::type`][The key type associated with the element from `It`][None]] [[`iterator::template value_of_data::type`][The type of the data property associated with the element from `It`][None]] [[`iterator::template deref_data::type`][The type that will be returned by dereferencing the data property of the element from `It`][None]] diff --git a/doc/functional.qbk b/doc/functional.qbk index 120ae0d2..19205527 100644 --- a/doc/functional.qbk +++ b/doc/functional.qbk @@ -1,5 +1,5 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2006 Tobias Schwinger Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -66,9 +66,9 @@ function objects to accept arbitrary calls. In other words, an unary function object can be implemented instead of (maybe heavily overloaded) function templates or function call operators. -The library provides both a strictly typed and a generic variant for this +The library provides both a strictly typed and a generic variant for this transformation. The latter should be used in combination with -__boost_func_forward__ to attack __the_forwarding_problem__. +__boost_func_forward__ to attack __the_forwarding_problem__. Both variants have a corresponding generator function template that returns an adapter instance for the given argument. @@ -546,7 +546,7 @@ Returns the result type of __invoke_function_object__. [heading Macros] -The following macros can be defined to change the maximum arity. +The following macros can be defined to change the maximum arity. The default is 6. * BOOST_FUSION_INVOKE_MAX_ARITY @@ -1060,7 +1060,7 @@ signature is optimized automatically to avoid by-value parameters.] [heading Macros] -The following macros can be defined to change the maximum arity. +The following macros can be defined to change the maximum arity. The value used for these macros must not exceed `FUSION_MAX_VECTOR_SIZE`. The default is 6. diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 4b9bea03..ce0141b8 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt Use, modification and distribution is subject to the Boost Software @@ -8,9 +9,9 @@ ===============================================================================/] [library Fusion [quickbook 1.3] - [version 2.0] + [version 2.2] [authors [de Guzman, Joel], [Marsden, Dan], [Schwinger, Tobias]] - [copyright 2001 2002 2003 2004 2005 2006 2007 Joel de Guzman, Dan Marsden, Tobias Schwinger] + [copyright 2001 2002 2003 2004 2005 2006 2011 Joel de Guzman, Dan Marsden, Tobias Schwinger] [purpose Statically Typed Heterogeneous Data Structures and Algorithms] [license Distributed under the Boost Software License, Version 1.0. @@ -215,6 +216,7 @@ [def __algorithm__ [link fusion.algorithm Algorithm]] [def __algorithms__ [link fusion.algorithm Algorithms]] +[def __copy__ [link fusion.algorithm.auxiliary.functions.copy `copy`]] [def __fold__ [link fusion.algorithm.iteration.functions.fold `fold`]] [def __result_of_fold__ [link fusion.algorithm.iteration.metafunctions.fold `result_of::fold`]] [def __reverse_fold__ [link fusion.algorithm.iteration.functions.reverse_fold `reverse_fold`]] diff --git a/doc/html/index.html b/doc/html/index.html index 299e4f36..eba1b61e 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -1,270 +1,16 @@ + - - -Chapter 1. Fusion 2.0 - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
Next
-
-
-

-Chapter 1. Fusion 2.0

-

-Joel de Guzman -

-

-Dan Marsden -

-

-Tobias Schwinger -

-
-
-

- 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) -

-
-
-
-

Table of Contents

-
-
Preface
-
Introduction
-
Quick Start
-
Organization
-
Support
-
-
is_sequence
-
is_view
-
tag_of
-
category_of
-
deduce
-
deduce_sequence
-
pair
-
-
Iterator
-
-
Concepts
-
-
Forward - Iterator
-
Bidirectional - Iterator
-
Random - Access Iterator
-
Associative - Iterator
-
-
Functions
-
-
deref
-
next
-
prior
-
distance
-
advance
-
advance_c
-
deref_data
-
-
Operator
-
-
Operator - *
-
Operator - ==
-
Operator - !=
-
-
Metafunctions
-
-
value_of
-
deref
-
next
-
prior
-
equal_to
-
distance
-
advance
-
advance_c
-
key_of
-
value_of_data
-
deref_data
-
-
-
Sequence
-
-
Concepts
-
-
Forward - Sequence
-
Bidirectional - Sequence
-
Random - Access Sequence
-
Associative - Sequence
-
-
Intrinsic
-
-
Functions
-
Metafunctions
-
-
Operator
-
-
I/O
-
Comparison
-
-
-
Container
-
-
vector
-
cons
-
list
-
set
-
map
-
Generation
-
-
Functions
-
MetaFunctions
-
-
Conversion
-
-
Functions
-
Metafunctions
-
-
-
View
-
-
single_view
-
filter_view
-
iterator_range
-
joint_view
-
zip_view
-
transform_view
-
reverse_view
-
nview
-
repetitive_view
-
-
Adapted
-
-
Array
-
std::pair
-
mpl sequence
-
boost::array
-
boost::tuple
-
BOOST_FUSION_ADAPT_STRUCT
-
BOOST_FUSION_ADAPT_TPL_STRUCT
-
BOOST_FUSION_ADAPT_STRUCT_NAMED
-
BOOST_FUSION_ADAPT_ASSOC_STRUCT
-
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT
-
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED
-
BOOST_FUSION_ADAPT_ADT
-
BOOST_FUSION_ADAPT_TPL_ADT
-
BOOST_FUSION_ADAPT_ASSOC_ADT
-
BOOST_FUSION_ADAPT_ASSOC_TPL_ADT
-
BOOST_FUSION_DEFINE_STRUCT
-
BOOST_FUSION_DEFINE_TPL_STRUCT
-
BOOST_FUSION_DEFINE_ASSOC_STRUCT
-
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT
-
-
Algorithm
-
-
Iteration
-
-
Functions
-
Metafunctions
-
-
Query
-
-
Functions
-
Metafunctions
-
-
Transformation
-
-
Functions
-
Metafunctions
-
-
-
Tuple
-
-
Class template tuple
-
-
Construction
-
Tuple - creation functions
-
Tuple - helper classes
-
Element - access
-
Relational - operators
-
-
Pairs
-
-
Extension
-
-
The Full Extension Mechanism
-
Sequence Facade
-
Iterator Facade
-
-
Functional
-
-
Concepts
-
-
Callable Object
-
Regular Callable - Object
-
Deferred - Callable Object
-
Polymorphic Function - Object
-
-
Invocation
-
-
Functions
-
Metafunctions
-
Limits
-
-
Adapters
-
-
fused
-
fused_procedure
-
fused_function_object
-
unfused
-
unfused_typed
-
Limits
-
-
Generation
-
-
Functions
-
Metafunctions
-
-
-
Notes
-
Change log
-
Acknowledgements
-
References
-
-
-
- - - -

Last revised: March 21, 2011 at 04:01:58 GMT

-
-
Next
- + + + Redirect to generated documentation + + + + Automatic redirection failed, please go to + http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/ + diff --git a/doc/introduction.qbk b/doc/introduction.qbk index 066f5a33..f8979bfc 100644 --- a/doc/introduction.qbk +++ b/doc/introduction.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/iterator.qbk b/doc/iterator.qbk index 5a706c5a..8efecda9 100644 --- a/doc/iterator.qbk +++ b/doc/iterator.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -160,6 +161,8 @@ the following invariants always hold: * __std_pair__ iterator * __boost_array__ iterator * __vector__ iterator +* __map__ iterator +* __single_view__ iterator * __iterator_range__ (where adapted sequence is a __bidirectional_sequence__) * __transform_view__ (where adapted sequence is a __bidirectional_sequence__) * __reverse_view__ @@ -204,8 +207,10 @@ the following expressions must be valid: [heading Models] * __vector__ iterator +* __map__ iterator * __std_pair__ iterator * __boost_array__ iterator +* __single_view__ iterator * __iterator_range__ iterator (where adapted sequence is a __random_access_sequence__) * __transform_view__ iterator (where adapted sequence is a __random_access_sequence__) * __reverse_view__ iterator (where adapted sequence is a __random_access_sequence__) @@ -990,9 +995,9 @@ Returns the key type associated with the element referenced by an associative it [heading Example] typedef __map__<__pair__ > vec; typedef __result_of_begin__::type first; - + BOOST_MPL_ASSERT((boost::is_same<__result_of_key_of__::type, float>)); - + [endsect] [section value_of_data] @@ -1029,9 +1034,9 @@ Returns the type of the data property associated with the element referenced by [heading Example] typedef __map__<__pair__ > vec; typedef __result_of_begin__::type first; - + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of_data__::type, int>)); - + [endsect] [section deref_data] diff --git a/doc/notes.qbk b/doc/notes.qbk index f8255733..85ccd98d 100644 --- a/doc/notes.qbk +++ b/doc/notes.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt Use, modification and distribution is subject to the Boost Software @@ -167,7 +168,7 @@ and __deref_data__) is a proxy type, an instance of has three template arguments: namespace boost { namespace fusion { namespace extension - { + { template< typename Type , int Index @@ -175,14 +176,14 @@ has three template arguments: > struct adt_attribute_proxy; }}} - + When adapting a class type, `adt_attribute_proxy` is specialized for every element of the adapted sequence, with `Type` being the class type that is adapted, `Index` the 0-based indices of the elements, and `Const` both `true` and `false`. The return type of fusion's intrinsic sequence access functions for the ['N]th element of an adapted class type `type_name` is [^adt_attribute_proxy], with [^['Const]] being `true` -for constant instances of `type_name` and `false` for non-constant ones. +for constant instances of `type_name` and `false` for non-constant ones. [variablelist Notation [[`type_name`] @@ -204,7 +205,7 @@ for constant instances of `type_name` and `false` for non-constant ones. ] [*Expression Semantics] - + [table [[Expression] [Semantics]] [[[^proxy_type['N](inst)]] [Creates an instance of [^proxy_type['N]] with underlying object `inst`]] diff --git a/doc/organization.qbk b/doc/organization.qbk index 8b81fbfc..e3dd7fb4 100644 --- a/doc/organization.qbk +++ b/doc/organization.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/preface.qbk b/doc/preface.qbk index 5686642a..cdf0114f 100644 --- a/doc/preface.qbk +++ b/doc/preface.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/quick_start.qbk b/doc/quick_start.qbk index c0d69f1e..e6e6c3c1 100644 --- a/doc/quick_start.qbk +++ b/doc/quick_start.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/references.qbk b/doc/references.qbk index 5b6c21a1..d0d63019 100644 --- a/doc/references.qbk +++ b/doc/references.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/sequence.qbk b/doc/sequence.qbk index e40f20c1..f76eee5a 100644 --- a/doc/sequence.qbk +++ b/doc/sequence.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -188,7 +189,9 @@ are not defined in __forward_sequence__. * __std_pair__ * __boost_array__ * __vector__ +* __map__ * __reverse_view__ +* __single_view__ * __iterator_range__ (where adapted sequence is a Bidirectional Sequence) * __transform_view__ (where adapted sequence is a Bidirectional Sequence) * __zip_view__ (where adapted sequences are models of Bidirectional Sequence) @@ -263,7 +266,9 @@ are not defined in __bidirectional_sequence__. * __std_pair__ * __boost_array__ * __vector__ +* __map__ * __reverse_view__ +* __single_view__ * __iterator_range__ (where adapted sequence is a Random Access Sequence) * __transform_view__ (where adapted sequence is a Random Access Sequence) * __zip_view__ (where adapted sequences are models of Random Access Sequence) @@ -1423,12 +1428,19 @@ operators for free. [section I/O] -The I/O operators: `<<` and `>>` work generically on all Fusion sequences. -The global `operator<<` has been overloaded for generic output streams such -that __sequence__(s) are output by recursively calling `operator<<` for each -element. Analogously, the global `operator>>` has been overloaded to -extract __sequence__(s) from generic input streams by recursively calling -`operator>>` for each element. +The I/O operators: `<<` and `>>` work generically on all Fusion +sequences. The I/O operators are overloaded in namespace `boost::fusion` +[footnote __sequences__ and __views__ residing in different namespaces +will have to either provide their own I/O operators (possibly forwarding +to fusion's I/O operators) or hoist fusion's I/O operators (using +declaration), in their own namespaces for proper argument dependent +lookup.] + +The `operator<<` has been overloaded for generic output streams such +that __sequence__(s) are output by recursively calling `operator<<` for +each element. Analogously, the global `operator>>` has been overloaded +to extract __sequence__(s) from generic input streams by recursively +calling `operator>>` for each element. The default delimiter between the elements is space, and the __sequence__ is enclosed in parenthesis. For Example: diff --git a/doc/support.qbk b/doc/support.qbk index dae8d031..4a040015 100644 --- a/doc/support.qbk +++ b/doc/support.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/tuple.qbk b/doc/tuple.qbk index 97a0aa46..3be81bbe 100644 --- a/doc/tuple.qbk +++ b/doc/tuple.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/view.qbk b/doc/view.qbk index f4a00a78..62539830 100644 --- a/doc/view.qbk +++ b/doc/view.qbk @@ -1,5 +1,6 @@ [/============================================================================== - Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger + Copyright (C) 2001-2011 Joel de Guzman + Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -43,7 +44,7 @@ lazy nature make them very cheap to copy and be passed around by value. [heading Model of] -* __forward_sequence__ +* __random_access_sequence__ [variablelist Notation [[`S`] [A `single_view` type]] @@ -54,7 +55,7 @@ lazy nature make them very cheap to copy and be passed around by value. [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not -defined in __forward_sequence__. +defined in __random_access_sequence__. [table [[Expression] [Semantics]] @@ -482,7 +483,7 @@ defined in the implemented models. [heading Description] -`nview` presents a view which iterates over a given __sequence__ in a specified order. +`nview` presents a view which iterates over a given __sequence__ in a specified order. An `nview` is constructed from an arbitrary __sequence__ and a list of indicies specifying the elements to iterate over. @@ -506,15 +507,15 @@ the elements to iterate over. [[Parameter] [Description] [Default]] [[`Sequence`] [An arbitrary Fusion __forward_sequence__] []] - [[`Indicies`] [A `mpl::vector_c` holding the indicies defining + [[`Indicies`] [A `mpl::vector_c` holding the indicies defining the required iteration order.] []] - [[`I1`, `I2`, `I3`...] [A list of integers specifying the required + [[`I1`, `I2`, `I3`...] [A list of integers specifying the required iteration order.] [`INT_MAX` for `I2`, `I3`...]] ] [heading Model of] -* __random_access_sequence__ (see __traversal_concept__) +* __random_access_sequence__ (see __traversal_concept__) [variablelist Notation [[`NV`] [A `nview` type]] diff --git a/example/cookbook/fill_em_up.cpp b/example/cookbook/fill_em_up.cpp index 69576612..9b37aec8 100644 --- a/example/cookbook/fill_em_up.cpp +++ b/example/cookbook/fill_em_up.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2006 Joel de Guzman + Copyright (c) 2011 Joel de Guzman 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) diff --git a/example/extension/detail/advance_impl.hpp b/example/extension/detail/advance_impl.hpp index 3d3691b2..0d778123 100644 --- a/example/extension/detail/advance_impl.hpp +++ b/example/extension/detail/advance_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/at_impl.hpp b/example/extension/detail/at_impl.hpp index c65650d1..60558930 100644 --- a/example/extension/detail/at_impl.hpp +++ b/example/extension/detail/at_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/at_key_impl.hpp b/example/extension/detail/at_key_impl.hpp index 0af810e1..e925c62a 100644 --- a/example/extension/detail/at_key_impl.hpp +++ b/example/extension/detail/at_key_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/begin_impl.hpp b/example/extension/detail/begin_impl.hpp index 3e1f0802..a4296c59 100644 --- a/example/extension/detail/begin_impl.hpp +++ b/example/extension/detail/begin_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/category_of_impl.hpp b/example/extension/detail/category_of_impl.hpp index 8420cbac..b0bc7d90 100644 --- a/example/extension/detail/category_of_impl.hpp +++ b/example/extension/detail/category_of_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/deref_impl.hpp b/example/extension/detail/deref_impl.hpp index a65a7fae..7e515e9d 100644 --- a/example/extension/detail/deref_impl.hpp +++ b/example/extension/detail/deref_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/distance_impl.hpp b/example/extension/detail/distance_impl.hpp index 5768ec5e..b138cc4a 100644 --- a/example/extension/detail/distance_impl.hpp +++ b/example/extension/detail/distance_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/end_impl.hpp b/example/extension/detail/end_impl.hpp index 789e7c1b..749bb33a 100644 --- a/example/extension/detail/end_impl.hpp +++ b/example/extension/detail/end_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/equal_to_impl.hpp b/example/extension/detail/equal_to_impl.hpp index d5decf35..8ab27649 100644 --- a/example/extension/detail/equal_to_impl.hpp +++ b/example/extension/detail/equal_to_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/has_key_impl.hpp b/example/extension/detail/has_key_impl.hpp index 20c663d7..596827ce 100644 --- a/example/extension/detail/has_key_impl.hpp +++ b/example/extension/detail/has_key_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/is_sequence_impl.hpp b/example/extension/detail/is_sequence_impl.hpp index e15c08a0..e373342a 100644 --- a/example/extension/detail/is_sequence_impl.hpp +++ b/example/extension/detail/is_sequence_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/is_view_impl.hpp b/example/extension/detail/is_view_impl.hpp index a9b05657..b2344bf2 100644 --- a/example/extension/detail/is_view_impl.hpp +++ b/example/extension/detail/is_view_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/next_impl.hpp b/example/extension/detail/next_impl.hpp index b8aa3f0d..8fbaa8b1 100644 --- a/example/extension/detail/next_impl.hpp +++ b/example/extension/detail/next_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/prior_impl.hpp b/example/extension/detail/prior_impl.hpp index 3577485a..415692ce 100644 --- a/example/extension/detail/prior_impl.hpp +++ b/example/extension/detail/prior_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/size_impl.hpp b/example/extension/detail/size_impl.hpp index 877b4847..4dc6ec93 100644 --- a/example/extension/detail/size_impl.hpp +++ b/example/extension/detail/size_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/value_at_impl.hpp b/example/extension/detail/value_at_impl.hpp index f2599dfd..6a1d63ef 100644 --- a/example/extension/detail/value_at_impl.hpp +++ b/example/extension/detail/value_at_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/value_at_key_impl.hpp b/example/extension/detail/value_at_key_impl.hpp index e30ba9ba..cabc59aa 100644 --- a/example/extension/detail/value_at_key_impl.hpp +++ b/example/extension/detail/value_at_key_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/detail/value_of_impl.hpp b/example/extension/detail/value_of_impl.hpp index 2d0b78aa..6fc7e161 100644 --- a/example/extension/detail/value_of_impl.hpp +++ b/example/extension/detail/value_of_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/example_struct.hpp b/example/extension/example_struct.hpp index 73e52d39..cbb058f5 100644 --- a/example/extension/example_struct.hpp +++ b/example/extension/example_struct.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/example_struct_iterator.hpp b/example/extension/example_struct_iterator.hpp index a6b1e6db..fa04f085 100644 --- a/example/extension/example_struct_iterator.hpp +++ b/example/extension/example_struct_iterator.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/example_struct_type.hpp b/example/extension/example_struct_type.hpp index 0e8abdfb..e1d8e175 100644 --- a/example/extension/example_struct_type.hpp +++ b/example/extension/example_struct_type.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/tag_of.hpp b/example/extension/tag_of.hpp index 55777bab..083b730c 100644 --- a/example/extension/tag_of.hpp +++ b/example/extension/tag_of.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/test_example.cpp b/example/extension/test_example.cpp index 7d87f21a..581e2300 100644 --- a/example/extension/test_example.cpp +++ b/example/extension/test_example.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/extension/triple.cpp b/example/extension/triple.cpp index ee247439..ac8f18e0 100644 --- a/example/extension/triple.cpp +++ b/example/extension/triple.cpp @@ -1,8 +1,9 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Nathan Ridge Copyright (c) 2006 Dan Marsden - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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) ==============================================================================*/ @@ -17,11 +18,10 @@ #include #include - #include #include - #include +#include #include #include @@ -40,7 +40,8 @@ namespace demo { template struct triple_iterator - : fusion::iterator_facade, fusion::random_access_traversal_tag> + : fusion::iterator_facade, + fusion::random_access_traversal_tag> { typedef mpl::int_ index; typedef Seq sequence_type; @@ -74,13 +75,19 @@ namespace demo template struct deref > { - typedef typename - mpl::if_< - boost::is_const - , typename Sq::t0_type const& - , typename Sq::t0_type& - >::type - type; + typedef typename Sq::t0_type& type; + + static type + call(triple_iterator const& iter) + { + return iter.seq_.t0; + } + }; + + template + struct deref const> + { + typedef typename Sq::t0_type const& type; static type call(triple_iterator const& iter) @@ -92,13 +99,19 @@ namespace demo template struct deref > { - typedef typename - mpl::if_< - boost::is_const - , typename Sq::t1_type const& - , typename Sq::t1_type& - >::type - type; + typedef typename Sq::t1_type& type; + + static type + call(triple_iterator const& iter) + { + return iter.seq_.t1; + } + }; + + template + struct deref const> + { + typedef typename Sq::t1_type const& type; static type call(triple_iterator const& iter) @@ -110,13 +123,19 @@ namespace demo template struct deref > { - typedef typename - mpl::if_< - boost::is_const - , typename Sq::t2_type const& - , typename Sq::t2_type& - >::type - type; + typedef typename Sq::t2_type& type; + + static type + call(triple_iterator const& iter) + { + return iter.seq_.t2; + } + }; + + template + struct deref const> + { + typedef typename Sq::t2_type const& type; static type call(triple_iterator const& iter) @@ -129,7 +148,8 @@ namespace demo struct next { typedef triple_iterator< - typename It::sequence_type, It::index::value + 1> type; + typename It::sequence_type, It::index::value + 1> + type; static type call(It const& it) { @@ -141,7 +161,8 @@ namespace demo struct prior { typedef triple_iterator< - typename It::sequence_type, It::index::value - 1> type; + typename It::sequence_type, It::index::value - 1> + type; static type call(It const& it) { @@ -152,7 +173,9 @@ namespace demo template struct distance { - typedef typename mpl::minus::type type; + typedef typename mpl::minus< + typename It2::index, typename It1::index>::type + type; static type call(It1 const& it1, It2 const& it2) { @@ -165,7 +188,8 @@ namespace demo { typedef triple_iterator< typename It::sequence_type, - It::index::value + M::value> type; + It::index::value + M::value> + type; static type call(It const& it) { @@ -176,7 +200,8 @@ namespace demo template struct triple - : fusion::sequence_facade, fusion::random_access_traversal_tag> + : fusion::sequence_facade, + fusion::random_access_traversal_tag> { triple(T0 const& t0, T1 const& t1, T2 const& t2) : t0(t0), t1(t1), t2(t2) @@ -185,8 +210,7 @@ namespace demo template struct begin { - typedef demo::triple_iterator< - Sq, 0> type; + typedef demo::triple_iterator type; static type call(Sq& sq) { @@ -197,8 +221,7 @@ namespace demo template struct end { - typedef demo::triple_iterator< - Sq, 3> type; + typedef demo::triple_iterator type; static type call(Sq& sq) { @@ -300,6 +323,36 @@ namespace demo }; } +struct modifying_fold_functor +{ + template + struct result + { + typedef bool type; + }; + + template + bool operator()(bool b, T&) + { + return b; + } +}; + +struct nonmodifying_fold_functor +{ + template + struct result + { + typedef bool type; + }; + + template + bool operator()(bool b, const T&) + { + return b; + } +}; + int main() { typedef demo::triple my_triple; @@ -309,11 +362,16 @@ int main() BOOST_TEST(*fusion::prior(fusion::end(t)) == "hello"); BOOST_TEST(fusion::distance(fusion::begin(t), fusion::end(t)) == 3); BOOST_TEST(fusion::size(t) == 3); - BOOST_MPL_ASSERT((boost::is_same::type>)); - BOOST_MPL_ASSERT((boost::is_same::type>)); - BOOST_MPL_ASSERT((boost::is_same::type>)); + BOOST_MPL_ASSERT((boost::is_same< + int, fusion::result_of::value_at_c::type>)); + BOOST_MPL_ASSERT((boost::is_same< + char, fusion::result_of::value_at_c::type>)); + BOOST_MPL_ASSERT((boost::is_same< + std::string, fusion::result_of::value_at_c::type>)); BOOST_TEST(fusion::at_c<0>(t) == 101); BOOST_TEST(fusion::at_c<1>(t) == 'a'); BOOST_TEST(fusion::at_c<2>(t) == "hello"); + BOOST_TEST(fusion::fold(t, true, modifying_fold_functor()) == true); + BOOST_TEST(fusion::fold(t, true, nonmodifying_fold_functor()) == true); return boost::report_errors(); } diff --git a/example/performance/accumulate.cpp b/example/performance/accumulate.cpp index 849161b0..176dc458 100644 --- a/example/performance/accumulate.cpp +++ b/example/performance/accumulate.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/performance/functional.cpp b/example/performance/functional.cpp index 8f7b3ecd..9207a90d 100644 --- a/example/performance/functional.cpp +++ b/example/performance/functional.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006-2007 Tobias Schwinger Use modification and distribution are subject to the Boost Software diff --git a/example/performance/inner_product.cpp b/example/performance/inner_product.cpp index 9b9937eb..c9f22c7c 100644 --- a/example/performance/inner_product.cpp +++ b/example/performance/inner_product.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/performance/inner_product2.cpp b/example/performance/inner_product2.cpp index f4e920ff..f1d536af 100644 --- a/example/performance/inner_product2.cpp +++ b/example/performance/inner_product2.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/example/performance/sequence_efficiency.cpp b/example/performance/sequence_efficiency.cpp index 28b5ec82..307ecdf3 100644 --- a/example/performance/sequence_efficiency.cpp +++ b/example/performance/sequence_efficiency.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/example/performance/zip_efficiency.cpp b/example/performance/zip_efficiency.cpp index 36ded283..6d240f2c 100644 --- a/example/performance/zip_efficiency.cpp +++ b/example/performance/zip_efficiency.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/preprocess/preprocess.bat b/preprocess/preprocess.bat new file mode 100644 index 00000000..f5c94977 --- /dev/null +++ b/preprocess/preprocess.bat @@ -0,0 +1,7 @@ + + +wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=10 -DFUSION_MAX_LIST_SIZE=10 -DFUSION_MAX_ZIP_SEQUENCES=10 preprocess.cpp +wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=20 -DFUSION_MAX_LIST_SIZE=20 -DFUSION_MAX_ZIP_SEQUENCES=20 preprocess.cpp +wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=30 -DFUSION_MAX_LIST_SIZE=30 -DFUSION_MAX_ZIP_SEQUENCES=30 preprocess.cpp +wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=40 -DFUSION_MAX_LIST_SIZE=40 -DFUSION_MAX_ZIP_SEQUENCES=40 preprocess.cpp +wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=50 -DFUSION_MAX_LIST_SIZE=50 -DFUSION_MAX_ZIP_SEQUENCES=50 preprocess.cpp diff --git a/preprocess/preprocess.cpp b/preprocess/preprocess.cpp new file mode 100644 index 00000000..1cc59ef3 --- /dev/null +++ b/preprocess/preprocess.cpp @@ -0,0 +1,10 @@ +/*============================================================================= + Copyright (c) 2011 Joel de Guzman + + 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) +==============================================================================*/ +#include +#include +#include + diff --git a/preprocess/wave.cfg b/preprocess/wave.cfg new file mode 100644 index 00000000..6d13cf63 --- /dev/null +++ b/preprocess/wave.cfg @@ -0,0 +1,14 @@ +-DBOOST_FUSION_DONT_USE_PREPROCESSED_FILES +-DBOOST_FUSION_CREATE_PREPROCESSED_FILES +-SC:/dev/boost +-SC:/dev/tools/mingw/include +-SC:/dev/tools/mingw/lib/gcc/mingw32/4.5.2/include +-SC:/dev/tools/mingw/lib/gcc/mingw32/4.5.2/include/c++ +-SC:/dev/tools/mingw/lib/gcc/mingw32/4.5.2/include/c++/mingw32 +--variadics +-NBOOST_FUSION_ADAPT_TPL_STRUCT_NO_PARTIAL +-NBOOST_PROTO_USE_GET_POINTER +-NBOOST_PROTO_GET_POINTER +--timer + + diff --git a/test/Jamfile b/test/Jamfile index fe8829e6..3cea5ecf 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -41,6 +41,10 @@ import testing ; [ run algorithm/reverse_fold.cpp : : : : ] [ run algorithm/reverse_iter_fold.cpp : : : : ] [ run algorithm/reverse.cpp : : : : ] + [ run algorithm/segmented_for_each.cpp : : : : ] + [ run algorithm/segmented_find.cpp : : : : ] + [ run algorithm/segmented_find_if.cpp : : : : ] + [ run algorithm/segmented_fold.cpp : : : : ] [ run algorithm/transform.cpp : : : : ] [ run algorithm/join.cpp : : : : ] [ run algorithm/zip.cpp : : : : ] @@ -83,6 +87,7 @@ import testing ; [ run sequence/map_tie.cpp : : : : ] [ run sequence/nview.cpp : : : : ] [ run sequence/reverse_view.cpp : : : : ] + [ run sequence/segmented_iterator_range.cpp : : : : ] [ run sequence/set.cpp : : : : ] [ run sequence/single_view.cpp : : : : ] [ run sequence/std_pair.cpp : : : : ] @@ -130,6 +135,7 @@ import testing ; [ run sequence/define_assoc_struct.cpp : : : : ] [ run sequence/define_tpl_struct.cpp : : : : ] [ run sequence/define_assoc_tpl_struct.cpp : : : : ] + [ run sequence/std_tuple_iterator.cpp : : : : ] [ run functional/fused.cpp : : : : ] [ run functional/fused_function_object.cpp : : : : ] @@ -149,17 +155,3 @@ import testing ; ; } - -{ - # Text for extension features, must be explicitly specified on the command line to be run - # TODO these are not in a test-suite because currently test-suites cannot be marked "explicit" - - run algorithm/ext_/for_each_s.cpp ; - explicit for_each_s ; - - run algorithm/ext_/find_if_s.cpp ; - explicit find_if_s ; - - run sequence/ext_/iterator_range_s.cpp ; - explicit iterator_range_s ; -} diff --git a/test/algorithm/all.cpp b/test/algorithm/all.cpp index 7bfefdaa..7b555073 100644 --- a/test/algorithm/all.cpp +++ b/test/algorithm/all.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2007 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/any.cpp b/test/algorithm/any.cpp index e2c42f8d..da0aa793 100644 --- a/test/algorithm/any.cpp +++ b/test/algorithm/any.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005 Eric Niebler Copyright (c) Dan Marsden diff --git a/test/algorithm/clear.cpp b/test/algorithm/clear.cpp index 9122af2c..f90f5c0a 100644 --- a/test/algorithm/clear.cpp +++ b/test/algorithm/clear.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/count.cpp b/test/algorithm/count.cpp index e87ff9d8..13aaad1a 100644 --- a/test/algorithm/count.cpp +++ b/test/algorithm/count.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005 Eric Niebler Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/count_if.cpp b/test/algorithm/count_if.cpp index d67e464c..d7062890 100644 --- a/test/algorithm/count_if.cpp +++ b/test/algorithm/count_if.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005 Eric Niebler Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/erase.cpp b/test/algorithm/erase.cpp index 310c7260..f376ba2a 100644 --- a/test/algorithm/erase.cpp +++ b/test/algorithm/erase.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/erase_key.cpp b/test/algorithm/erase_key.cpp index 418b5d77..34f69248 100644 --- a/test/algorithm/erase_key.cpp +++ b/test/algorithm/erase_key.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -30,7 +30,7 @@ void test_set(Set const& set) using namespace boost::fusion; std::cout << set << std::endl; - BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_TEST((*find(set) == 1)); BOOST_TEST((*find(set) == 1.5)); BOOST_TEST((*find(set) == "hello")); @@ -47,7 +47,7 @@ void test_map(Map const& map) using namespace boost::fusion; std::cout << map << std::endl; - BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_TEST(((*find<_1>(map)).second == 1)); BOOST_TEST(((*find<_3>(map)).second == 1.5)); BOOST_TEST(((*find<_4>(map)).second == std::string("hello"))); diff --git a/test/algorithm/filter.cpp b/test/algorithm/filter.cpp index 5bca82bf..e762e432 100644 --- a/test/algorithm/filter.cpp +++ b/test/algorithm/filter.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/filter_if.cpp b/test/algorithm/filter_if.cpp index f5f1b190..830813de 100644 --- a/test/algorithm/filter_if.cpp +++ b/test/algorithm/filter_if.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/find.cpp b/test/algorithm/find.cpp index 25a61e94..83a86f1d 100644 --- a/test/algorithm/find.cpp +++ b/test/algorithm/find.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/find_if.cpp b/test/algorithm/find_if.cpp index 2b402b9f..c4dfafa2 100644 --- a/test/algorithm/find_if.cpp +++ b/test/algorithm/find_if.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/fold.cpp b/test/algorithm/fold.cpp index 38178c75..1db08181 100644 --- a/test/algorithm/fold.cpp +++ b/test/algorithm/fold.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2007 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/fold.hpp b/test/algorithm/fold.hpp index df42d7d7..87a81a7c 100644 --- a/test/algorithm/fold.hpp +++ b/test/algorithm/fold.hpp @@ -59,7 +59,7 @@ struct sum template struct result - : fusion::result_of::make_pair< + : boost::fusion::result_of::make_pair< mpl::int_< boost::remove_reference< State @@ -108,7 +108,7 @@ struct meta_sum #ifdef BOOST_FUSION_TEST_ITER_FOLD typedef typename - fusion::result_of::value_of< + boost::fusion::result_of::value_of< typename boost::remove_reference::type >::type t; @@ -144,7 +144,7 @@ struct fold_test_n { mpl::range_c init_range; - typename fusion::result_of::as_vector< + typename boost::fusion::result_of::as_vector< typename mpl::transform< range , mpl::always @@ -169,20 +169,20 @@ struct fold_test_n { typedef typename #ifdef BOOST_FUSION_TEST_REVERSE_FOLD - fusion::result_of::as_vector< + boost::fusion::result_of::as_vector< typename mpl::copy< mpl::range_c , mpl::front_inserter > >::type >::type #else - fusion::result_of::as_vector >::type + boost::fusion::result_of::as_vector >::type #endif vec; typedef boost::is_same< - typename fusion::result_of::BOOST_FUSION_TEST_FOLD_NAME< + typename boost::fusion::result_of::BOOST_FUSION_TEST_FOLD_NAME< vec , mpl::vector, mpl::int_<0> > , meta_sum diff --git a/test/algorithm/for_each.cpp b/test/algorithm/for_each.cpp index a0054fad..c0bc441c 100644 --- a/test/algorithm/for_each.cpp +++ b/test/algorithm/for_each.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/insert.cpp b/test/algorithm/insert.cpp index a489d630..a4239a8d 100644 --- a/test/algorithm/insert.cpp +++ b/test/algorithm/insert.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/insert_range.cpp b/test/algorithm/insert_range.cpp index f4dccb05..28a02219 100644 --- a/test/algorithm/insert_range.cpp +++ b/test/algorithm/insert_range.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/join.cpp b/test/algorithm/join.cpp index 186876fb..c0de1896 100644 --- a/test/algorithm/join.cpp +++ b/test/algorithm/join.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/none.cpp b/test/algorithm/none.cpp index 148ad652..83dfa752 100644 --- a/test/algorithm/none.cpp +++ b/test/algorithm/none.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2007 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/pop_back.cpp b/test/algorithm/pop_back.cpp index 3bd98248..a96106d1 100644 --- a/test/algorithm/pop_back.cpp +++ b/test/algorithm/pop_back.cpp @@ -1,16 +1,23 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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) ==============================================================================*/ #include #include +#include #include #include #include #include +#include #include +#include +#include +#include +#include +#include #include int @@ -41,6 +48,57 @@ main() BOOST_TEST((boost::fusion::pop_back(mpl_vec()) == make_vector(1, 2, 3, 4))); } + { + list l(1, 2); + std::cout << pop_back(l) << std::endl; + BOOST_TEST((pop_back(l) == make_list(1))); + } + + { // make sure empty sequences are OK + list l(1); + std::cout << pop_back(l) << std::endl; + BOOST_TEST((pop_back(l) == make_list())); + } + + { + single_view sv(1); + std::cout << pop_back(sv) << std::endl; + + // Compile check only + begin(pop_back(sv)) == end(sv); + end(pop_back(sv)) == begin(sv); + } + + // $$$ JDG: TODO add compile fail facility $$$ + //~ { // compile fail check (Disabled for now) + //~ list<> l; + //~ std::cout << pop_back(l) << std::endl; + //~ } + +#ifndef BOOST_NO_AUTO_DECLARATIONS + { + auto vec = make_vector(1, 3.14, "hello"); + + // Compile check only + auto popv = pop_back(vec); + std::cout << popv << std::endl; + + auto push = push_back(vec, 42); + auto pop = pop_back(vec); + auto i1 = find(popv); + auto i2 = find(pop); + + BOOST_TEST(i1 != end(pop)); + BOOST_TEST(i2 != end(pop)); + BOOST_TEST(i1 != i2); + } +#endif + + { + boost::array a = { 10, 50 }; + BOOST_TEST(back(pop_back(a)) == 10); + } + return boost::report_errors(); } diff --git a/test/algorithm/pop_front.cpp b/test/algorithm/pop_front.cpp index 1d187592..df95b38c 100644 --- a/test/algorithm/pop_front.cpp +++ b/test/algorithm/pop_front.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/push_back.cpp b/test/algorithm/push_back.cpp index 420ca3c4..b53007fc 100644 --- a/test/algorithm/push_back.cpp +++ b/test/algorithm/push_back.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/push_front.cpp b/test/algorithm/push_front.cpp index 380ddc0c..8c63c5c3 100644 --- a/test/algorithm/push_front.cpp +++ b/test/algorithm/push_front.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/remove.cpp b/test/algorithm/remove.cpp index 479ed56a..76e0c737 100644 --- a/test/algorithm/remove.cpp +++ b/test/algorithm/remove.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/remove_if.cpp b/test/algorithm/remove_if.cpp index aa7250d3..62313d3a 100644 --- a/test/algorithm/remove_if.cpp +++ b/test/algorithm/remove_if.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/replace.cpp b/test/algorithm/replace.cpp index 11525220..ddd65130 100644 --- a/test/algorithm/replace.cpp +++ b/test/algorithm/replace.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/replace_if.cpp b/test/algorithm/replace_if.cpp index 322c3028..7327632f 100644 --- a/test/algorithm/replace_if.cpp +++ b/test/algorithm/replace_if.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/reverse.cpp b/test/algorithm/reverse.cpp index 3c06d21a..718d5b24 100644 --- a/test/algorithm/reverse.cpp +++ b/test/algorithm/reverse.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/algorithm/segmented_find.cpp b/test/algorithm/segmented_find.cpp new file mode 100644 index 00000000..8ce0b6d5 --- /dev/null +++ b/test/algorithm/segmented_find.cpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include "../sequence/tree.hpp" + +struct not_there {}; + +template +void +process_tree(Tree const &tree) +{ + using namespace boost; + + typedef typename boost::fusion::result_of::find::type short_iter; + typedef typename boost::fusion::result_of::find::type float_iter; + typedef typename boost::fusion::result_of::find::type not_there_iter; + + // find_if_s of a segmented data structure returns generic + // segmented iterators + short_iter si = fusion::find(tree); + float_iter fi = fusion::find(tree); + + // they behave like ordinary Fusion iterators ... + BOOST_TEST((*si == short('d'))); + BOOST_TEST((*fi == float(1))); + + // Searching for something that's not there should return the end iterator. + not_there_iter nti = fusion::find(tree); + BOOST_TEST((nti == fusion::end(tree))); +} + +int +main() +{ + using namespace boost::fusion; + process_tree( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + ); + + return boost::report_errors(); +} + diff --git a/test/algorithm/segmented_find_if.cpp b/test/algorithm/segmented_find_if.cpp new file mode 100644 index 00000000..98d963cf --- /dev/null +++ b/test/algorithm/segmented_find_if.cpp @@ -0,0 +1,65 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include "../sequence/tree.hpp" + +struct not_there {}; + +template +void +process_tree(Tree const &tree) +{ + using namespace boost; + using mpl::_; + + typedef typename boost::fusion::result_of::find_if >::type short_iter; + typedef typename boost::fusion::result_of::find_if >::type float_iter; + typedef typename boost::fusion::result_of::find_if >::type not_there_iter; + + // find_if of a segmented data structure returns generic + // segmented iterators + short_iter si = fusion::find_if >(tree); + float_iter fi = fusion::find_if >(tree); + + // they behave like ordinary Fusion iterators ... + BOOST_TEST((*si == short('d'))); + BOOST_TEST((*fi == float(1))); + + // Searching for something that's not there should return the end iterator. + not_there_iter nti = fusion::find_if >(tree); + BOOST_TEST((nti == fusion::end(tree))); +} + +int +main() +{ + using namespace boost::fusion; + process_tree( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + ); + + return boost::report_errors(); +} + diff --git a/test/algorithm/segmented_fold.cpp b/test/algorithm/segmented_fold.cpp new file mode 100644 index 00000000..af51ca89 --- /dev/null +++ b/test/algorithm/segmented_fold.cpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include "../sequence/tree.hpp" + +struct write_string +{ + typedef std::ostream* result_type; + + template + std::ostream* operator()(std::ostream* sout, T const& t) const + { + return &(*sout << t << " "); + } +}; + +template +void +process_tree(Tree const &tree) +{ + using namespace boost; + + std::stringstream str; + fusion::fold(tree, &str, write_string()); + std::string res = str.str(); + + BOOST_TEST_EQ(res, "a b c 1 2 3 100 e f 0 B 1 h i 4 5 6 j k l "); +} + +int +main() +{ + using namespace boost::fusion; + process_tree( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + ); + + return boost::report_errors(); +} + diff --git a/test/algorithm/segmented_for_each.cpp b/test/algorithm/segmented_for_each.cpp new file mode 100644 index 00000000..84260a68 --- /dev/null +++ b/test/algorithm/segmented_for_each.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include "../sequence/tree.hpp" + +struct print +{ + template + void operator()(T const& v) const + { + std::cout << "[ " << v << " ] "; + } +}; + +int +main() +{ + using namespace boost::fusion; + + { + for_each( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + , print() + ); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/transform.cpp b/test/algorithm/transform.cpp index fac0c92a..8609f61c 100644 --- a/test/algorithm/transform.cpp +++ b/test/algorithm/transform.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2007 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -109,46 +109,46 @@ main() { typedef range_c sequence_type; sequence_type sequence; - std::cout << transform(sequence, square()) << std::endl; - BOOST_TEST((transform(sequence, square()) == make_vector(25, 36, 49, 64))); + std::cout << boost::fusion::transform(sequence, square()) << std::endl; + BOOST_TEST((boost::fusion::transform(sequence, square()) == make_vector(25, 36, 49, 64))); } { typedef range_c mpl_list1; - std::cout << transform(mpl_list1(), square()) << std::endl; - BOOST_TEST((transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64))); + std::cout << boost::fusion::transform(mpl_list1(), square()) << std::endl; + BOOST_TEST((boost::fusion::transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64))); } { vector tup(1, 2, 3); - std::cout << transform(tup, square()) << std::endl; - BOOST_TEST((transform(tup, square()) == make_vector(1, 4, 9))); + std::cout << boost::fusion::transform(tup, square()) << std::endl; + BOOST_TEST((boost::fusion::transform(tup, square()) == make_vector(1, 4, 9))); } { vector tup1(1, 2, 3); vector tup2(4, 5, 6); - std::cout << transform(tup1, tup2, add()) << std::endl; - BOOST_TEST((transform(tup1, tup2, add()) == make_vector(5, 7, 9))); + std::cout << boost::fusion::transform(tup1, tup2, add()) << std::endl; + BOOST_TEST((boost::fusion::transform(tup1, tup2, add()) == make_vector(5, 7, 9))); } { // Unary transform that requires lvalues, just check compilation vector tup1(1, 2, 3); - BOOST_TEST(at_c<0>(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); - BOOST_TEST(*begin(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(at_c<0>(boost::fusion::transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(*begin(boost::fusion::transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); } { vector tup1(1, 2, 3); vector tup2(4, 5, 6); - BOOST_TEST(at_c<0>(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); - BOOST_TEST(*begin(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(at_c<0>(boost::fusion::transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(*begin(boost::fusion::transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); } { vector tup1(1, 2, 3); - BOOST_TEST(transform(tup1, twice) == make_vector(2,4,6)); + BOOST_TEST(boost::fusion::transform(tup1, twice) == make_vector(2,4,6)); } diff --git a/test/algorithm/zip.cpp b/test/algorithm/zip.cpp index df7eb599..b6a4f097 100644 --- a/test/algorithm/zip.cpp +++ b/test/algorithm/zip.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/algorithm/zip2.cpp b/test/algorithm/zip2.cpp index c8007117..f35e4d5d 100644 --- a/test/algorithm/zip2.cpp +++ b/test/algorithm/zip2.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/compile_time/vector_intrinsic.cpp b/test/compile_time/vector_intrinsic.cpp index 3fa3a77e..3690a496 100644 --- a/test/compile_time/vector_intrinsic.cpp +++ b/test/compile_time/vector_intrinsic.cpp @@ -38,17 +38,17 @@ namespace fusion::at_c<8>(v); fusion::at_c<9>(v); - typedef typename fusion::result_of::value_at_c::type va0; - typedef typename fusion::result_of::value_at_c::type va1; - typedef typename fusion::result_of::value_at_c::type va2; - typedef typename fusion::result_of::value_at_c::type va3; - typedef typename fusion::result_of::value_at_c::type va4; + typedef typename boost::fusion::result_of::value_at_c::type va0; + typedef typename boost::fusion::result_of::value_at_c::type va1; + typedef typename boost::fusion::result_of::value_at_c::type va2; + typedef typename boost::fusion::result_of::value_at_c::type va3; + typedef typename boost::fusion::result_of::value_at_c::type va4; - typedef typename fusion::result_of::value_at_c::type va5; - typedef typename fusion::result_of::value_at_c::type va6; - typedef typename fusion::result_of::value_at_c::type va7; - typedef typename fusion::result_of::value_at_c::type va8; - typedef typename fusion::result_of::value_at_c::type va9; + typedef typename boost::fusion::result_of::value_at_c::type va5; + typedef typename boost::fusion::result_of::value_at_c::type va6; + typedef typename boost::fusion::result_of::value_at_c::type va7; + typedef typename boost::fusion::result_of::value_at_c::type va8; + typedef typename boost::fusion::result_of::value_at_c::type va9; fusion::begin(v); fusion::end(v); diff --git a/test/functional/invoke.cpp b/test/functional/invoke.cpp index 460e1e29..52740eec 100644 --- a/test/functional/invoke.cpp +++ b/test/functional/invoke.cpp @@ -331,7 +331,7 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>) template void test_sequence(Sequence & seq) { - test_sequence_n(seq, mpl::int_::value>()); + test_sequence_n(seq, mpl::int_::value>()); } @@ -340,18 +340,18 @@ void result_type_tests() using boost::is_same; BOOST_TEST(( is_same< - fusion::result_of::invoke >::type, int + boost::fusion::result_of::invoke >::type, int >::value )); // disabled until boost::result_of supports it // BOOST_TEST(( is_same< -// fusion::result_of::invoke >::type, int +// boost::fusion::result_of::invoke >::type, int // >::value )); BOOST_TEST(( is_same< - fusion::result_of::invoke >::type, int + boost::fusion::result_of::invoke >::type, int >::value )); // disabled until boost::result_of supports it // BOOST_TEST(( is_same< -// fusion::result_of::invoke >::type, int +// boost::fusion::result_of::invoke >::type, int // >::value )); } diff --git a/test/functional/invoke_function_object.cpp b/test/functional/invoke_function_object.cpp index 375bc4c5..31357aa8 100644 --- a/test/functional/invoke_function_object.cpp +++ b/test/functional/invoke_function_object.cpp @@ -182,16 +182,16 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>) template void test_sequence(Sequence & seq) { - test_sequence_n(seq, mpl::int_::value>()); + test_sequence_n(seq, mpl::int_::value>()); } void result_type_tests() { using boost::is_same; - BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value )); - BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); - BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); + BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value )); + BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); + BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); } diff --git a/test/functional/invoke_procedure.cpp b/test/functional/invoke_procedure.cpp index 2dc93c5a..f8db06cc 100644 --- a/test/functional/invoke_procedure.cpp +++ b/test/functional/invoke_procedure.cpp @@ -244,7 +244,7 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>) template void test_sequence(Sequence & seq) { - test_sequence_n(seq, mpl::int_::value>()); + test_sequence_n(seq, mpl::int_::value>()); } int main() diff --git a/test/functional/make_fused.cpp b/test/functional/make_fused.cpp index aab7928a..a207359c 100644 --- a/test/functional/make_fused.cpp +++ b/test/functional/make_fused.cpp @@ -63,7 +63,7 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_fused< test_func<> >::type fused_func + boost::fusion::result_of::make_fused< test_func<> >::type fused_func = fusion::make_fused(f); BOOST_TEST(fused_func(lv_vec) == 1); diff --git a/test/functional/make_fused_function_object.cpp b/test/functional/make_fused_function_object.cpp index dec2411a..87ee8e23 100644 --- a/test/functional/make_fused_function_object.cpp +++ b/test/functional/make_fused_function_object.cpp @@ -73,7 +73,7 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_fused_function_object< test_func<> >::type fused_func + boost::fusion::result_of::make_fused_function_object< test_func<> >::type fused_func = fusion::make_fused_function_object(f); BOOST_TEST(fused_func(lv_vec) == 1); diff --git a/test/functional/make_fused_procedure.cpp b/test/functional/make_fused_procedure.cpp index 754c17bc..ce7e267c 100644 --- a/test/functional/make_fused_procedure.cpp +++ b/test/functional/make_fused_procedure.cpp @@ -69,7 +69,7 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_fused_procedure< test_func<> >::type fused_func + boost::fusion::result_of::make_fused_procedure< test_func<> >::type fused_func = fusion::make_fused_procedure(f); CHECK_EFFECT(fused_func(lv_vec), 1); diff --git a/test/functional/make_unfused.cpp b/test/functional/make_unfused.cpp index ff52e54f..1e286918 100644 --- a/test/functional/make_unfused.cpp +++ b/test/functional/make_unfused.cpp @@ -42,7 +42,7 @@ struct test_func template struct result< Self(Seq &) > - : mpl::if_< mpl::and_< fusion::result_of::empty, RemoveNullary >, + : mpl::if_< mpl::and_< boost::fusion::result_of::empty, RemoveNullary >, boost::blank, mpl::identity >::type { }; @@ -86,14 +86,14 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_unfused< test_func<> >::type unfused_func = + boost::fusion::result_of::make_unfused< test_func<> >::type unfused_func = fusion::make_unfused(f); - fusion::result_of::make_unfused< boost::reference_wrapper< + boost::fusion::result_of::make_unfused< boost::reference_wrapper< test_func > >::type unfused_func_ref = fusion::make_unfused(ref(f_nc)); - fusion::result_of::make_unfused< boost::reference_wrapper< + boost::fusion::result_of::make_unfused< boost::reference_wrapper< test_func const> >::type unfused_func_c_ref = fusion::make_unfused(cref(f_nc)); diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index e0693568..73868367 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -92,7 +92,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -111,8 +110,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -149,7 +148,7 @@ main() { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } @@ -167,8 +166,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -178,22 +177,22 @@ main() { BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type, + boost::fusion::result_of::front::type, boost::fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type::type, + boost::fusion::result_of::front::type::type, int >)); BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type, + boost::fusion::result_of::front::type, boost::fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type::type, + boost::fusion::result_of::front::type::type, int >)); } diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index 7ec88df8..38415633 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -64,7 +64,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -84,8 +83,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -128,7 +127,7 @@ main() { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index 2d6a07f0..c97e84b0 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -55,7 +55,6 @@ int main() { using namespace boost::fusion; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -74,8 +73,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -118,12 +117,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p(5, 3); diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index 844bec7e..d68d9904 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -56,7 +56,6 @@ int main() { using namespace boost::fusion; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -76,8 +75,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -123,12 +122,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point basep(5, 3); adapted::point p(basep); diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 2e3f14ea..62574a7e 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -61,7 +61,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -80,8 +79,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -117,12 +116,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((fusion::result_of::has_key)); - BOOST_MPL_ASSERT((fusion::result_of::has_key)); - BOOST_MPL_ASSERT((mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p = {5, 3}; @@ -133,7 +132,7 @@ main() { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index 3ae0a380..f24dadd9 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -61,8 +61,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -102,12 +102,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point basep = {5, 3}; adapted::point p(basep); diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index 92d9df60..15e2124c 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -57,7 +57,6 @@ int main() { using namespace boost::fusion; - using namespace std; typedef ns::point point; @@ -78,8 +77,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -122,12 +121,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); point p(5, 3); diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index ca751283..a327f9e8 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -78,8 +78,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -115,12 +115,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); point p = {5, 3}; diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 10b7a89a..68240463 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -78,7 +78,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -97,8 +96,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -136,16 +135,16 @@ main() using namespace boost::fusion; using boost::is_same; - typedef result_of::begin::type b; - typedef result_of::end::type e; + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; // this fails - BOOST_MPL_ASSERT((is_same::type, e>)); + BOOST_MPL_ASSERT((is_same::type, e>)); } { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index ec803854..ef859655 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -56,7 +56,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -76,8 +75,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -119,17 +118,17 @@ main() using namespace boost::fusion; using boost::is_same; - typedef result_of::begin::type b; - typedef result_of::end::type e; + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; // this fails - BOOST_MPL_ASSERT((is_same::type, e>)); + BOOST_MPL_ASSERT((is_same::type, e>)); } { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index babb3370..2f0d4c6b 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -65,7 +65,6 @@ int main() { using namespace boost::fusion; - using namespace std; typedef ns::point point; @@ -86,8 +85,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 7db3bd8a..352cf995 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -73,8 +73,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -111,10 +111,10 @@ main() { // begin/end using namespace boost::fusion; - typedef result_of::begin >::type b; - typedef result_of::end >::type e; + typedef boost::fusion::result_of::begin >::type b; + typedef boost::fusion::result_of::end >::type e; // this fails - BOOST_MPL_ASSERT((boost::is_same::type, e>)); + BOOST_MPL_ASSERT((boost::is_same::type, e>)); } return boost::report_errors(); diff --git a/test/sequence/adt_attribute_proxy.cpp b/test/sequence/adt_attribute_proxy.cpp index 4535bb92..d5a947af 100644 --- a/test/sequence/adt_attribute_proxy.cpp +++ b/test/sequence/adt_attribute_proxy.cpp @@ -82,65 +82,65 @@ int main() BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_key::type, std::string >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_c::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_key::type, int >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_c::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::front::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::front::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::back::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::back::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::front::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::front::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::back::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::back::type >)); BOOST_MPL_ASSERT(( diff --git a/test/sequence/as_list.cpp b/test/sequence/as_list.cpp index cf282741..8ee8bf12 100644 --- a/test/sequence/as_list.cpp +++ b/test/sequence/as_list.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/as_map.cpp b/test/sequence/as_map.cpp index 6c18a3cc..d2a89cc6 100644 --- a/test/sequence/as_map.cpp +++ b/test/sequence/as_map.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -36,7 +36,7 @@ main() { typedef pair p1; typedef pair p2; - result_of::as_map >::type map(make_pair('X'), make_pair("Men")); + boost::fusion::result_of::as_map >::type map(make_pair('X'), make_pair("Men")); std::cout << at_key(map) << std::endl; std::cout << at_key(map) << std::endl; BOOST_TEST(at_key(map) == 'X'); diff --git a/test/sequence/as_set.cpp b/test/sequence/as_set.cpp index 935da42d..97dd89e8 100644 --- a/test/sequence/as_set.cpp +++ b/test/sequence/as_set.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -40,7 +40,7 @@ main() } { - result_of::as_set >::type set(1, 1.23, "harru"); + boost::fusion::result_of::as_set >::type set(1, 1.23, "harru"); std::cout << at_key(set) << std::endl; BOOST_TEST(at_key(set) == 1); } diff --git a/test/sequence/as_vector.cpp b/test/sequence/as_vector.cpp index 2bcc2b32..af1aaffb 100644 --- a/test/sequence/as_vector.cpp +++ b/test/sequence/as_vector.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/back_extended_deque.cpp b/test/sequence/back_extended_deque.cpp index 61d8ece7..edae9276 100644 --- a/test/sequence/back_extended_deque.cpp +++ b/test/sequence/back_extended_deque.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/boost_array.cpp b/test/sequence/boost_array.cpp index fbe11761..a1bb6542 100644 --- a/test/sequence/boost_array.cpp +++ b/test/sequence/boost_array.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2010 Christopher Schmidt diff --git a/test/sequence/boost_tuple.cpp b/test/sequence/boost_tuple.cpp index ef5dfa3b..c16c0894 100644 --- a/test/sequence/boost_tuple.cpp +++ b/test/sequence/boost_tuple.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -37,7 +37,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -57,8 +56,8 @@ main() at_c<1>(t) = "mama mia"; BOOST_TEST(t == make_vector(6, "mama mia")); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(t) == 6); } diff --git a/test/sequence/comparison.hpp b/test/sequence/comparison.hpp index 0fd30d9d..2dfe6550 100644 --- a/test/sequence/comparison.hpp +++ b/test/sequence/comparison.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/cons.cpp b/test/sequence/cons.cpp index 8df03a63..cb74af61 100644 --- a/test/sequence/cons.cpp +++ b/test/sequence/cons.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2005 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2005 Eric Niebler Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/construction.hpp b/test/sequence/construction.hpp index 5c6abdf2..380a9eed 100644 --- a/test/sequence/construction.hpp +++ b/test/sequence/construction.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/copy.hpp b/test/sequence/copy.hpp index 29f8baac..cb9384ab 100644 --- a/test/sequence/copy.hpp +++ b/test/sequence/copy.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/define_assoc_struct.cpp b/test/sequence/define_assoc_struct.cpp index 6f6326ec..ed8dfbe0 100644 --- a/test/sequence/define_assoc_struct.cpp +++ b/test/sequence/define_assoc_struct.cpp @@ -51,8 +51,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -88,12 +88,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p(5, 3); diff --git a/test/sequence/define_assoc_tpl_struct.cpp b/test/sequence/define_assoc_tpl_struct.cpp index ec3c7f3b..6d0b5bdb 100644 --- a/test/sequence/define_assoc_tpl_struct.cpp +++ b/test/sequence/define_assoc_tpl_struct.cpp @@ -55,8 +55,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -92,12 +92,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); point p(5, 3); diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index 8d839781..795fdf6e 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -48,8 +48,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -86,10 +86,10 @@ main() { // begin/end using namespace boost::fusion; - typedef result_of::begin::type b; - typedef result_of::end::type e; + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; // this fails - BOOST_MPL_ASSERT((boost::is_same::type, e>)); + BOOST_MPL_ASSERT((boost::is_same::type, e>)); } { diff --git a/test/sequence/define_tpl_struct.cpp b/test/sequence/define_tpl_struct.cpp index a2193709..9896493c 100644 --- a/test/sequence/define_tpl_struct.cpp +++ b/test/sequence/define_tpl_struct.cpp @@ -51,8 +51,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -89,10 +89,10 @@ main() { // begin/end using namespace boost::fusion; - typedef result_of::begin >::type b; - typedef result_of::end >::type e; + typedef boost::fusion::result_of::begin >::type b; + typedef boost::fusion::result_of::end >::type e; // this fails - BOOST_MPL_ASSERT((boost::is_same::type, e>)); + BOOST_MPL_ASSERT((boost::is_same::type, e>)); } diff --git a/test/sequence/deque_comparison.cpp b/test/sequence/deque_comparison.cpp index 604a82e5..9bbf4fd9 100644 --- a/test/sequence/deque_comparison.cpp +++ b/test/sequence/deque_comparison.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_construction.cpp b/test/sequence/deque_construction.cpp index 9f605ed5..4fc8c883 100644 --- a/test/sequence/deque_construction.cpp +++ b/test/sequence/deque_construction.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_copy.cpp b/test/sequence/deque_copy.cpp index 712c42c7..2cf4a8eb 100644 --- a/test/sequence/deque_copy.cpp +++ b/test/sequence/deque_copy.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_iterator.cpp b/test/sequence/deque_iterator.cpp index baf6f827..f10f9b9e 100644 --- a/test/sequence/deque_iterator.cpp +++ b/test/sequence/deque_iterator.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_make.cpp b/test/sequence/deque_make.cpp index 334ea029..fe570533 100644 --- a/test/sequence/deque_make.cpp +++ b/test/sequence/deque_make.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_misc.cpp b/test/sequence/deque_misc.cpp index f3063079..c9b880ea 100644 --- a/test/sequence/deque_misc.cpp +++ b/test/sequence/deque_misc.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_mutate.cpp b/test/sequence/deque_mutate.cpp index 39bdc381..1564ade9 100644 --- a/test/sequence/deque_mutate.cpp +++ b/test/sequence/deque_mutate.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_tie.cpp b/test/sequence/deque_tie.cpp index d6bd4926..f6ee9160 100644 --- a/test/sequence/deque_tie.cpp +++ b/test/sequence/deque_tie.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/deque_value_at.cpp b/test/sequence/deque_value_at.cpp index 7e528b79..5b31504f 100644 --- a/test/sequence/deque_value_at.cpp +++ b/test/sequence/deque_value_at.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/filter_view.cpp b/test/sequence/filter_view.cpp index c052a37b..8ebe1476 100644 --- a/test/sequence/filter_view.cpp +++ b/test/sequence/filter_view.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -77,7 +77,7 @@ main() filter_view_type view(v); std::cout << view << std::endl; BOOST_TEST((view == make_vector('@', 987654, true, 6.6))); - BOOST_STATIC_ASSERT(result_of::size::value == 4); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 4); } //cschmidt: This is illegal C++. ADL instantiates less<_, int_<3> > - which @@ -94,7 +94,7 @@ main() filter_view_type view(v); std::cout << view << std::endl; BOOST_TEST((view == make_vector(1, 2, 0, -1))); - BOOST_STATIC_ASSERT(result_of::size::value == 4); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 4); #endif }*/ @@ -104,7 +104,7 @@ main() typedef vector vec; typedef filter_view filter_view_type; - BOOST_MPL_ASSERT((result_of::equal_to::type, result_of::end::type>)); + BOOST_MPL_ASSERT((boost::fusion::result_of::equal_to::type, boost::fusion::result_of::end::type>)); } { @@ -114,11 +114,11 @@ main() typedef filter_view > > filter_view_type; filter_view_type f(m); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT_NOT((result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT_NOT((boost::fusion::result_of::has_key::type)); - BOOST_MPL_ASSERT((is_same::type>::type, double>)); - BOOST_MPL_ASSERT((is_same::type>::type, std::string>)); + BOOST_MPL_ASSERT((is_same::type>::type, double>)); + BOOST_MPL_ASSERT((is_same::type>::type, std::string>)); std::cout << deref_data(begin(f)) << std::endl; BOOST_TEST((deref_data(begin(f)) == "Bond")); diff --git a/test/sequence/front_extended_deque.cpp b/test/sequence/front_extended_deque.cpp index 7234e955..d1c90343 100644 --- a/test/sequence/front_extended_deque.cpp +++ b/test/sequence/front_extended_deque.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/iterator.hpp b/test/sequence/iterator.hpp index 118bb347..ab29b8a0 100644 --- a/test/sequence/iterator.hpp +++ b/test/sequence/iterator.hpp @@ -1,7 +1,7 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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) ==============================================================================*/ #include @@ -30,7 +30,7 @@ void test() char const* s = "Hello"; typedef FUSION_SEQUENCE seq_type; seq_type v(1, 'x', 3.3, s); - result_of::begin::type i(v); + boost::fusion::result_of::begin::type i(v); BOOST_TEST(*i == 1); BOOST_TEST(*next(i) == 'x'); @@ -62,7 +62,7 @@ void test() char const* s = "Hello"; typedef FUSION_SEQUENCE const seq_type; seq_type t(1, 'x', 3.3, s); - result_of::begin::type i(t); + boost::fusion::result_of::begin::type i(t); BOOST_TEST(*i == 1); BOOST_TEST(*next(i) == 'x'); @@ -80,22 +80,22 @@ void test() typedef FUSION_SEQUENCE seq_type; typedef FUSION_SEQUENCE const cseq_type; - typedef result_of::begin::type vi1; - typedef result_of::begin::type vi2; - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); + typedef boost::fusion::result_of::begin::type vi1; + typedef boost::fusion::result_of::begin::type vi2; + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); } { typedef FUSION_SEQUENCE seq_type; - typedef result_of::begin::type begin_type; - typedef result_of::end::type end_type; - typedef result_of::next::type i1; - typedef result_of::next::type i2; + typedef boost::fusion::result_of::begin::type begin_type; + typedef boost::fusion::result_of::end::type end_type; + typedef boost::fusion::result_of::next::type i1; + typedef boost::fusion::result_of::next::type i2; BOOST_STATIC_ASSERT((is_same::value)); } @@ -105,7 +105,7 @@ void test() char const* s = "Hello"; typedef FUSION_SEQUENCE seq_type; seq_type t(1, 'x', 3.3, s); - result_of::begin::type i(t); + boost::fusion::result_of::begin::type i(t); BOOST_TEST(*i == 1); BOOST_TEST(*next(i) == 'x'); @@ -113,7 +113,7 @@ void test() BOOST_TEST(*next(next(next(i))) == s); next(next(next(next(i)))); // end - + #ifdef FUSION_TEST_FAIL next(next(next(next(next(i))))); // past the end: must not compile #endif @@ -138,34 +138,34 @@ void test() typedef FUSION_SEQUENCE seq_type; seq_type t(1, 'x', 3.3, "Hello"); - BOOST_STATIC_ASSERT((result_of::distance< - result_of::begin::type - , result_of::end::type >::value == 4)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::distance< + boost::fusion::result_of::begin::type + , boost::fusion::result_of::end::type >::value == 4)); BOOST_TEST(distance(begin(t), end(t)).value == 4); } - { // Testing tuple iterator result_of::value_of, result_of::deref, result_of::value_at + { // Testing tuple iterator boost::fusion::result_of::value_of, boost::fusion::result_of::deref, boost::fusion::result_of::value_at typedef FUSION_SEQUENCE seq_type; - typedef result_of::begin::type i0; - typedef result_of::next::type i1; - typedef result_of::next::type>::type i2; + typedef boost::fusion::result_of::begin::type i0; + typedef boost::fusion::result_of::next::type i1; + typedef boost::fusion::result_of::next::type>::type i2; BOOST_STATIC_ASSERT(( - is_same::type, int>::value)); + is_same::type, int>::value)); BOOST_STATIC_ASSERT(( - is_same::type, char&>::value)); + is_same::type, char&>::value)); BOOST_STATIC_ASSERT(( is_same::type, FUSION_TRAVERSAL_TAG>::value)); - BOOST_STATIC_ASSERT((is_same::type, int&>::value)); - BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + BOOST_STATIC_ASSERT((is_same::type, int&>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); - BOOST_STATIC_ASSERT((is_same::type, int>::value)); - BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); } { // Testing advance diff --git a/test/sequence/iterator_range.cpp b/test/sequence/iterator_range.cpp index 51288dbd..18f91af0 100644 --- a/test/sequence/iterator_range.cpp +++ b/test/sequence/iterator_range.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -50,7 +50,7 @@ main() slice_t slice(i1, i3); std::cout << slice << std::endl; BOOST_TEST((slice == make_vector('x', 3.3))); - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); } { @@ -64,7 +64,7 @@ main() slice_t slice(i1, i3); std::cout << slice << std::endl; BOOST_TEST(slice == make_vector()); - BOOST_STATIC_ASSERT(result_of::size::value == 0); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 0); } } @@ -82,7 +82,7 @@ main() slice_t slice(f, l); std::cout << slice << std::endl; BOOST_TEST((slice == make_vector(3, 4))); - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); } { @@ -90,19 +90,19 @@ main() map_type m(make_pair("foo"), make_pair('x'), make_pair(2)); typedef iterator_range< - result_of::begin::type - , result_of::advance_c::type,2>::type + boost::fusion::result_of::begin::type + , boost::fusion::result_of::advance_c::type,2>::type > range_type; range_type r(begin(m), advance_c<2>(begin(m))); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT((result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, double>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, double>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, std::string>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, char>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, char>)); std::cout << deref_data(begin(r)) << std::endl; std::cout << deref_data(fusion::next(begin(r))) << std::endl; diff --git a/test/sequence/joint_view.cpp b/test/sequence/joint_view.cpp index 900b9a68..ba5659b7 100644 --- a/test/sequence/joint_view.cpp +++ b/test/sequence/joint_view.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -159,20 +159,20 @@ main() typedef joint_view joint_view_type; joint_view_type j(m,s); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT((result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); BOOST_MPL_ASSERT((boost::is_same< - result_of::key_of::type>::type>::type>::type + boost::fusion::result_of::key_of::type>::type>::type>::type , float>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); BOOST_MPL_ASSERT((boost::is_same< - result_of::value_of_data::type>::type>::type>::type + boost::fusion::result_of::value_of_data::type>::type>::type>::type , float>)); std::cout << deref_data(begin(j)) << std::endl; diff --git a/test/sequence/list_comparison.cpp b/test/sequence/list_comparison.cpp index 9e379acf..2a02eba0 100644 --- a/test/sequence/list_comparison.cpp +++ b/test/sequence/list_comparison.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_construction.cpp b/test/sequence/list_construction.cpp index 2d9f0f19..a10b1e1a 100644 --- a/test/sequence/list_construction.cpp +++ b/test/sequence/list_construction.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_copy.cpp b/test/sequence/list_copy.cpp index 1decdc25..adb58814 100644 --- a/test/sequence/list_copy.cpp +++ b/test/sequence/list_copy.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_iterator.cpp b/test/sequence/list_iterator.cpp index f7cc6e1d..62d67087 100644 --- a/test/sequence/list_iterator.cpp +++ b/test/sequence/list_iterator.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_make.cpp b/test/sequence/list_make.cpp index 58463ca9..296b6063 100644 --- a/test/sequence/list_make.cpp +++ b/test/sequence/list_make.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_misc.cpp b/test/sequence/list_misc.cpp index d9f8eb43..28d84854 100644 --- a/test/sequence/list_misc.cpp +++ b/test/sequence/list_misc.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_mutate.cpp b/test/sequence/list_mutate.cpp index 15afff64..b2736679 100644 --- a/test/sequence/list_mutate.cpp +++ b/test/sequence/list_mutate.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_tie.cpp b/test/sequence/list_tie.cpp index e858dc99..30c8ed83 100644 --- a/test/sequence/list_tie.cpp +++ b/test/sequence/list_tie.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/list_value_at.cpp b/test/sequence/list_value_at.cpp index d0fec91a..487968da 100644 --- a/test/sequence/list_value_at.cpp +++ b/test/sequence/list_value_at.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/make.hpp b/test/sequence/make.hpp index 37d847ac..00eaed2c 100644 --- a/test/sequence/make.hpp +++ b/test/sequence/make.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/make_list.cpp b/test/sequence/make_list.cpp index 58463ca9..296b6063 100644 --- a/test/sequence/make_list.cpp +++ b/test/sequence/make_list.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/make_vector.cpp b/test/sequence/make_vector.cpp index 4e5ea89e..8a687354 100644 --- a/test/sequence/make_vector.cpp +++ b/test/sequence/make_vector.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/map.cpp b/test/sequence/map.cpp index e419a7e0..265510f6 100644 --- a/test/sequence/map.cpp +++ b/test/sequence/map.cpp @@ -1,7 +1,7 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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) ==============================================================================*/ #include @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include @@ -28,7 +30,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; namespace fusion = boost::fusion; using boost::fusion::pair; using boost::fusion::make_pair; @@ -40,31 +41,32 @@ main() { typedef map< pair - , pair > + , pair > map_type; BOOST_MPL_ASSERT((traits::is_associative)); - + BOOST_MPL_ASSERT((traits::is_random_access)); + map_type m( make_pair('X') , make_pair("Men")); - + std::cout << at_key(m) << std::endl; std::cout << at_key(m) << std::endl; - + BOOST_TEST(at_key(m) == 'X'); BOOST_TEST(at_key(m) == "Men"); BOOST_STATIC_ASSERT(( - boost::is_same::type, char>::value)); + boost::is_same::type, char>::value)); BOOST_STATIC_ASSERT(( - boost::is_same::type, std::string>::value)); - + boost::is_same::type, std::string>::value)); + std::cout << m << std::endl; - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((!result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key::value)); std::cout << deref_data(begin(m)) << std::endl; std::cout << deref_data(fusion::next(begin(m))) << std::endl; @@ -72,12 +74,47 @@ main() BOOST_TEST(deref_data(begin(m)) == 'X'); BOOST_TEST(deref_data(fusion::next(begin(m))) == "Men"); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, double>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, char>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, double>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, char>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + + //! Test random access interface. + pair a = at_c<0>(m); + pair b = at_c<1>(m); } - + + //! iterators & random access interface. + { + typedef pair, std::string> pair0; + typedef pair, std::string> pair1; + typedef pair, std::string> pair2; + typedef pair, std::string> pair3; + typedef pair, std::string> pair4; + + typedef map< pair0, pair1, pair2, pair3, pair4 > map_type; + map_type m( pair0("zero"), pair1("one"), pair2("two"), pair3("three"), pair4("four") ); + BOOST_AUTO( it0, begin(m) ); + BOOST_TEST((deref(it0) == pair0("zero"))); + BOOST_AUTO( it1, fusion::next(it0) ); + BOOST_TEST((deref(it1) == pair1("one"))); + BOOST_AUTO( it2, fusion::next(it1) ); + BOOST_TEST((deref(it2) == pair2("two"))); + BOOST_AUTO( it3, fusion::next(it2) ); + BOOST_TEST((deref(it3) == pair3("three"))); + BOOST_AUTO( it4, fusion::next(it3) ); + BOOST_TEST((deref(it4) == pair4("four"))); + + BOOST_TEST((deref(fusion::advance_c<4>(it0)) == deref(it4))); + + //! Bi-directional + BOOST_TEST((deref(fusion::prior(it4)) == deref(it3) )); + BOOST_TEST((deref(fusion::prior(it3)) == deref(it2) )); + BOOST_TEST((deref(fusion::prior(it2)) == deref(it1) )); + BOOST_TEST((deref(fusion::prior(it1)) == deref(it0) )); + + } + { std::cout << make_map('X', 123) << std::endl; BOOST_TEST(at_key(make_map('X', 123)) == 'X'); diff --git a/test/sequence/map_tie.cpp b/test/sequence/map_tie.cpp index 1232812d..a3547375 100644 --- a/test/sequence/map_tie.cpp +++ b/test/sequence/map_tie.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/misc.hpp b/test/sequence/misc.hpp index c5b58b45..610b107a 100644 --- a/test/sequence/misc.hpp +++ b/test/sequence/misc.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (C) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -21,7 +21,7 @@ #endif #if !defined(FUSION_SIZE) -#define FUSION_SIZE result_of::size +#define FUSION_SIZE boost::fusion::result_of::size #endif template @@ -144,8 +144,8 @@ test() BOOST_STATIC_ASSERT(FUSION_SIZE::value == 3); BOOST_STATIC_ASSERT(FUSION_SIZE::value == 0); - BOOST_STATIC_ASSERT(!result_of::empty::value); - BOOST_STATIC_ASSERT(result_of::empty::value); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::empty::value); } { // testing front & back diff --git a/test/sequence/mutate.hpp b/test/sequence/mutate.hpp index a2388786..9bc9be8a 100644 --- a/test/sequence/mutate.hpp +++ b/test/sequence/mutate.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index 980bdc78..fb96275d 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -1,11 +1,12 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) ==============================================================================*/ #include #include +#include #include #include #include @@ -54,9 +55,9 @@ main() std::cout << rev << std::endl; BOOST_TEST((rev == make_vector(s, 123456789, 'x', 123))); - typedef result_of::begin::type first_type; + typedef boost::fusion::result_of::begin::type first_type; first_type first_it(begin(rev)); - typedef result_of::next::type second_type; + typedef boost::fusion::result_of::next::type second_type; second_type second_it(next(first_it)); BOOST_TEST((*second_it == 123456789)); BOOST_TEST((*prior(second_it) == s)); @@ -69,19 +70,40 @@ main() BOOST_TEST((at_c<3>(rev)==123)); BOOST_MPL_ASSERT(( - boost::is_same::type,char const*> + boost::is_same::type,char const*> )); BOOST_MPL_ASSERT(( - boost::is_same::type,long> + boost::is_same::type,long> )); BOOST_MPL_ASSERT(( - boost::is_same::type,char> + boost::is_same::type,char> )); BOOST_MPL_ASSERT(( - boost::is_same::type,int> + boost::is_same::type,int> )); } + //! Map + { + typedef pair, std::string> pair0; + typedef pair, std::string> pair1; + typedef pair, std::string> pair2; + typedef pair, std::string> pair3; + typedef pair, std::string> pair4; + + typedef map< pair0, pair1, pair2, pair3, pair4 > map_type; + map_type m( pair0("zero"), pair1("one"), pair2("two"), pair3("three"), pair4("four") ); + typedef reverse_view view_type; + view_type rev(m); + std::cout << rev << std::endl; + BOOST_TEST((rev == make_vector( pair4("four"), pair3("three"), pair2("two"), pair1("one"), pair0("zero")))); + BOOST_TEST((at_c<0>(rev) == pair4("four"))); + BOOST_TEST((at_c<1>(rev) == pair3("three"))); + BOOST_TEST((at_c<2>(rev) == pair2("two"))); + BOOST_TEST((at_c<3>(rev) == pair1("one"))); + BOOST_TEST((at_c<4>(rev) == pair0("zero"))); + } + return boost::report_errors(); } diff --git a/test/sequence/segmented_iterator_range.cpp b/test/sequence/segmented_iterator_range.cpp new file mode 100644 index 00000000..df49407a --- /dev/null +++ b/test/sequence/segmented_iterator_range.cpp @@ -0,0 +1,146 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "tree.hpp" + +struct ostream_fun +{ + ostream_fun(std::ostream &sout) + : sout_(sout) + {} + template + void operator ()(T const &t) const + { + sout_ << t << ' '; + } +private: + std::ostream & sout_; +}; + +template +void +process_tree(Tree const &tree) +{ + using namespace boost; + using namespace fusion; + using mpl::_; + + typedef typename boost::fusion::result_of::find_if >::type short_iter; + typedef typename boost::fusion::result_of::find_if >::type float_iter; + + typedef iterator_range slice_t; + BOOST_STATIC_ASSERT(traits::is_segmented::value); + + // find_if of a segmented data structure returns generic + // segmented iterators + short_iter si = find_if >(tree); + float_iter fi = find_if >(tree); + + // If you put them in an iterator range, the range + // is automatically a segmented data structure. + slice_t slice(si, fi); + + std::stringstream sout; + fusion::for_each(slice, ostream_fun(sout)); + BOOST_TEST((sout.str() == "100 e f 0 B ")); +} + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type vec(1, 'x', 3.3, s); + + { + typedef vector_iterator i1t; + typedef vector_iterator i3t; + + i1t i1(vec); + i3t i3(vec); + + typedef iterator_range slice_t; + slice_t slice(i1, i3); + std::cout << slice << std::endl; + BOOST_TEST((slice == make_vector('x', 3.3))); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + } + + { + typedef vector_iterator i1t; + typedef vector_iterator i3t; + + i1t i1(vec); + i3t i3(vec); + + typedef iterator_range slice_t; + slice_t slice(i1, i3); + std::cout << slice << std::endl; + BOOST_TEST(slice == make_vector()); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 0); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + typedef boost::mpl::begin::type it0; + typedef boost::mpl::next::type it1; + typedef boost::mpl::next::type it2; + typedef boost::mpl::next::type it3; + + it1 f; + it3 l; + + typedef iterator_range slice_t; + slice_t slice(f, l); + std::cout << slice << std::endl; + BOOST_TEST((slice == make_vector(3, 4))); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + } + + { + process_tree( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + ); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/set.cpp b/test/sequence/set.cpp index 4a39c89a..1ea6ba24 100644 --- a/test/sequence/set.cpp +++ b/test/sequence/set.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -28,7 +28,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; namespace fusion = boost::fusion; using boost::fusion::pair; using boost::fusion::make_pair; @@ -51,15 +50,15 @@ main() BOOST_TEST(at_key(m) == "Hola"); BOOST_STATIC_ASSERT(( - boost::is_same::type, int>::value)); + boost::is_same::type, int>::value)); BOOST_STATIC_ASSERT(( - boost::is_same::type, std::string>::value)); + boost::is_same::type, std::string>::value)); std::cout << m << std::endl; - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((!result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key::value)); std::cout << deref_data(begin(m)) << std::endl; std::cout << deref_data(fusion::next(begin(m))) << std::endl; @@ -67,10 +66,10 @@ main() BOOST_TEST(deref_data(begin(m)) == 123); BOOST_TEST(deref_data(fusion::next(begin(m))) == "Hola"); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); } { diff --git a/test/sequence/single_view.cpp b/test/sequence/single_view.cpp index e3faa26a..6fa51755 100644 --- a/test/sequence/single_view.cpp +++ b/test/sequence/single_view.cpp @@ -1,5 +1,6 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,8 +8,22 @@ #include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include struct X {}; @@ -40,7 +55,28 @@ main() #endif std::cout << view1 << std::endl; BOOST_TEST(*begin(view1) == 3); + BOOST_TEST(at >(view1) == 3); BOOST_TEST(view1.val == 3); + BOOST_TEST(3 == front(view1)); + BOOST_TEST(3 == back(view1)); + BOOST_TEST(!empty(view1)); + BOOST_TEST(next(begin(view1)) == end(view1)); + BOOST_TEST(prior(end(view1)) == begin(view1)); + BOOST_TEST(!(next(begin(view1)) != end(view1))); + BOOST_TEST(!(prior(end(view1)) != begin(view1))); + BOOST_TEST(1 == distance(begin(view1), end(view1))); + BOOST_TEST(0 == distance(end(view1), end(view1))); + BOOST_TEST(0 == distance(begin(view1), begin(view1))); + BOOST_TEST(end(view1) == advance >(begin(view1))); + BOOST_TEST(begin(view1) == advance >(begin(view1))); + BOOST_TEST(end(view1) == advance >(end(view1))); + BOOST_TEST(begin(view1) == advance >(end(view1))); + BOOST_TEST(end(view1) == advance_c<1>(begin(view1))); + BOOST_TEST(begin(view1) == advance_c<0>(begin(view1))); + BOOST_TEST(end(view1) == advance_c<0>(end(view1))); + BOOST_TEST(begin(view1) == advance_c<-1>(end(view1))); + BOOST_TEST(1 == size(view1)); + BOOST_MPL_ASSERT((boost::is_same, boost::mpl::int_<0> >::type>)); single_view view2; std::cout << view2 << std::endl; diff --git a/test/sequence/std_pair.cpp b/test/sequence/std_pair.cpp index 0a704753..19f8e2a3 100644 --- a/test/sequence/std_pair.cpp +++ b/test/sequence/std_pair.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -36,7 +36,6 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -56,8 +55,8 @@ main() at_c<1>(p) = "mama mia"; BOOST_TEST(p == make_vector(6, "mama mia")); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == "mama mia"); diff --git a/test/sequence/std_tuple_iterator.cpp b/test/sequence/std_tuple_iterator.cpp new file mode 100644 index 00000000..1592eef5 --- /dev/null +++ b/test/sequence/std_tuple_iterator.cpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) +==============================================================================*/ +#include + +// The std_tuple_iterator adaptor only supports implementations +// using variadic templates +#if !defined(BOOST_NO_VARIADIC_TEMPLATES) + +#include + +#define FUSION_SEQUENCE std::tuple +#define FUSION_TRAVERSAL_TAG random_access_traversal_tag +#include "./iterator.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + +#else + +int +main() +{ + return 0; +} + +#endif + diff --git a/test/sequence/swap.cpp b/test/sequence/swap.cpp index 7df7b822..cac832b4 100644 --- a/test/sequence/swap.cpp +++ b/test/sequence/swap.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -22,7 +22,7 @@ int main() namespace fusion = boost::fusion; { typedef fusion::vector, char> test_vector; - BOOST_MPL_ASSERT((boost::is_same::type>)); + BOOST_MPL_ASSERT((boost::is_same::type>)); test_vector v1(std::vector(1, 101), 'a'), v2(std::vector(1, 202), 'b'); diff --git a/test/sequence/tie.hpp b/test/sequence/tie.hpp index cb928906..536af1e9 100644 --- a/test/sequence/tie.hpp +++ b/test/sequence/tie.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/transform_view.cpp b/test/sequence/transform_view.cpp index b1a48073..b9e3f943 100644 --- a/test/sequence/transform_view.cpp +++ b/test/sequence/transform_view.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tree.hpp b/test/sequence/tree.hpp new file mode 100644 index 00000000..a345a8f1 --- /dev/null +++ b/test/sequence/tree.hpp @@ -0,0 +1,100 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + 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 FUSION_BINARY_TREE_EAN_05032006_1027 +#define FUSION_BINARY_TREE_EAN_05032006_1027 + +#include +#include +#include +#include +#include +#include +#include +#include // for nil +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct tree_tag; + + template + struct tree + : sequence_base > + { + typedef Data data_type; + typedef Left left_type; + typedef Right right_type; + typedef tree_tag fusion_tag; + typedef forward_traversal_tag category; + typedef mpl::false_ is_view; + + typedef typename mpl::if_< + traits::is_sequence + , Data + , single_view + >::type data_view; + + explicit tree( + typename fusion::detail::call_param::type data_ + , typename fusion::detail::call_param::type left_ = Left() + , typename fusion::detail::call_param::type right_ = Right() + ) + : segments(left_, data_view(data_), right_) + {} + + typedef vector3 segments_type; + segments_type segments; + }; + + template + tree make_tree(Data const &data) + { + return tree(data); + } + + template + tree make_tree(Data const &data, Left const &left, Right const &right) + { + return tree(data, left, right); + } + + namespace extension + { + template <> + struct is_segmented_impl + { + template + struct apply : mpl::true_ {}; + }; + + template <> + struct segments_impl + { + template + struct apply + { + typedef typename mpl::if_< + is_const + , typename Sequence::segments_type const & + , typename Sequence::segments_type & + >::type type; + + static type call(Sequence &seq) + { + return seq.segments; + } + }; + }; + } +}} + +#endif diff --git a/test/sequence/tuple_comparison.cpp b/test/sequence/tuple_comparison.cpp index aa2ed73f..2b443306 100644 --- a/test/sequence/tuple_comparison.cpp +++ b/test/sequence/tuple_comparison.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tuple_construction.cpp b/test/sequence/tuple_construction.cpp index ec602abb..b35233ab 100644 --- a/test/sequence/tuple_construction.cpp +++ b/test/sequence/tuple_construction.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tuple_copy.cpp b/test/sequence/tuple_copy.cpp index 4332efbe..c41117e7 100644 --- a/test/sequence/tuple_copy.cpp +++ b/test/sequence/tuple_copy.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tuple_element.cpp b/test/sequence/tuple_element.cpp index ccf61f6e..0932e627 100644 --- a/test/sequence/tuple_element.cpp +++ b/test/sequence/tuple_element.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tuple_make.cpp b/test/sequence/tuple_make.cpp index e05aee34..1a453b62 100644 --- a/test/sequence/tuple_make.cpp +++ b/test/sequence/tuple_make.cpp @@ -1,15 +1,15 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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) ==============================================================================*/ #include -#define FUSION_SEQUENCE tuple +#define FUSION_SEQUENCE boost::fusion::tuple #define FUSION_AT get -#define FUSION_MAKE make_tuple +#define FUSION_MAKE boost::fusion::make_tuple #include "make.hpp" int diff --git a/test/sequence/tuple_misc.cpp b/test/sequence/tuple_misc.cpp index 7d9ab0e7..473efb61 100644 --- a/test/sequence/tuple_misc.cpp +++ b/test/sequence/tuple_misc.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tuple_mutate.cpp b/test/sequence/tuple_mutate.cpp index bba3a33e..b6e72a61 100644 --- a/test/sequence/tuple_mutate.cpp +++ b/test/sequence/tuple_mutate.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/tuple_tie.cpp b/test/sequence/tuple_tie.cpp index 0db9153e..2d5ec24f 100644 --- a/test/sequence/tuple_tie.cpp +++ b/test/sequence/tuple_tie.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/value_at.hpp b/test/sequence/value_at.hpp index d791fb5e..9fe3a198 100644 --- a/test/sequence/value_at.hpp +++ b/test/sequence/value_at.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -16,7 +16,7 @@ #endif #if !defined(FUSION_VALUE_AT) -#define FUSION_VALUE_AT(S, N) result_of::value_at_c +#define FUSION_VALUE_AT(S, N) boost::fusion::result_of::value_at_c #endif namespace test_detail diff --git a/test/sequence/vector_comparison.cpp b/test/sequence/vector_comparison.cpp index bb7c3c34..c23db833 100644 --- a/test/sequence/vector_comparison.cpp +++ b/test/sequence/vector_comparison.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_construction.cpp b/test/sequence/vector_construction.cpp index 0f672a45..8af5bc04 100644 --- a/test/sequence/vector_construction.cpp +++ b/test/sequence/vector_construction.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_copy.cpp b/test/sequence/vector_copy.cpp index 12769353..d21f5c9c 100644 --- a/test/sequence/vector_copy.cpp +++ b/test/sequence/vector_copy.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_iterator.cpp b/test/sequence/vector_iterator.cpp index bcf15c69..a2ca7df7 100644 --- a/test/sequence/vector_iterator.cpp +++ b/test/sequence/vector_iterator.cpp @@ -1,7 +1,7 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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) ==============================================================================*/ #include diff --git a/test/sequence/vector_make.cpp b/test/sequence/vector_make.cpp index 4e5ea89e..8a687354 100644 --- a/test/sequence/vector_make.cpp +++ b/test/sequence/vector_make.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_misc.cpp b/test/sequence/vector_misc.cpp index c23b539d..e2b27396 100644 --- a/test/sequence/vector_misc.cpp +++ b/test/sequence/vector_misc.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_mutate.cpp b/test/sequence/vector_mutate.cpp index dc242f07..448bbf76 100644 --- a/test/sequence/vector_mutate.cpp +++ b/test/sequence/vector_mutate.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_n.cpp b/test/sequence/vector_n.cpp index a536affb..05c07ce4 100644 --- a/test/sequence/vector_n.cpp +++ b/test/sequence/vector_n.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) @@ -30,22 +30,21 @@ main() { using namespace boost::fusion; using namespace boost; - using namespace std; { vector0<> vec; (void) vec; - cout << "(): " << sizeof(vec) << endl; - cout << (boost::is_empty >::value ? "is empty" : "is not empty") << endl; + std::cout << "(): " << sizeof(vec) << std::endl; + std::cout << (boost::is_empty >::value ? "is empty" : "is not empty") << std::endl; } { typedef vector1 type; type vec; - BOOST_STATIC_ASSERT(result_of::size::value == 1); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 1); BOOST_TEST(at_c<0>(vec) == 0); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); // prove that it is mutable at_c<0>(vec) = 987; @@ -56,7 +55,7 @@ main() typedef vector1 type; type vec(123); BOOST_TEST(at_c<0>(vec) == 123); - cout << "(int): " << sizeof(vec) << endl; + std::cout << "(int): " << sizeof(vec) << std::endl; } { // testing const vector @@ -77,13 +76,13 @@ main() { typedef vector2 type; type vec; - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); BOOST_TEST(at_c<0>(vec) == 0); BOOST_TEST(at_c<1>(vec) == char()); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); } { @@ -91,7 +90,7 @@ main() type vec(123, 'x'); BOOST_TEST(at_c<0>(vec) == 123); BOOST_TEST(at_c<1>(vec) == 'x'); - cout << "(int, char): " << sizeof(vec) << endl; + std::cout << "(int, char): " << sizeof(vec) << std::endl; } { @@ -103,15 +102,15 @@ main() { typedef vector3 type; type vec; - BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_TEST(at_c<0>(vec) == 0); BOOST_TEST(at_c<1>(vec) == char()); BOOST_TEST(at_c<2>(vec) == double()); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); } { @@ -120,19 +119,19 @@ main() BOOST_TEST(at_c<0>(vec) == 123); BOOST_TEST(at_c<1>(vec) == 'x'); BOOST_TEST(at_c<2>(vec) >= 123.455 && at_c<2>(vec) <= 123.457); - cout << "(int, char, double): " << sizeof(vec) << endl; + std::cout << "(int, char, double): " << sizeof(vec) << std::endl; } { typedef vector4 type; type vec(123, 'x', 123.456, true); - cout << "(int, char, double, bool): " << sizeof(vec) << endl; + std::cout << "(int, char, double, bool): " << sizeof(vec) << std::endl; } { typedef vector4 type; type vec(123, 'x', true, 123.456); - cout << "(int, char, bool, double): " << sizeof(vec) << endl; + std::cout << "(int, char, bool, double): " << sizeof(vec) << std::endl; } { @@ -147,20 +146,20 @@ main() BOOST_TEST(at_c<5>(vec) >= 5.9 && at_c<5>(vec) <= 6.1); BOOST_TEST(at_c<6>(vec) >= 6.9 && at_c<6>(vec) <= 7.1); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - cout << "(bool, char, short, int, long, float, double): " << sizeof(vec) << endl; + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + std::cout << "(bool, char, short, int, long, float, double): " << sizeof(vec) << std::endl; } { typedef vector10 type; type vec; // compile check only - cout << "vector10 of int: " << sizeof(vec) << endl; + std::cout << "vector10 of int: " << sizeof(vec) << std::endl; } { @@ -169,7 +168,7 @@ main() , int, int, int, int, int, int, int, int, int, int> type; type vec; // compile check only - cout << "vector20 of int: " << sizeof(vec) << endl; + std::cout << "vector20 of int: " << sizeof(vec) << std::endl; } { @@ -179,7 +178,7 @@ main() , int, int, int, int, int, int, int, int, int, int> type; type vec; // compile check only - cout << "vector30 of int: " << sizeof(vec) << endl; + std::cout << "vector30 of int: " << sizeof(vec) << std::endl; } { @@ -190,7 +189,7 @@ main() , int, int, int, int, int, int, int, int, int, int> type; type vec; // compile check only - cout << "vector40 of int: " << sizeof(vec) << endl; + std::cout << "vector40 of int: " << sizeof(vec) << std::endl; } { @@ -202,7 +201,7 @@ main() , int, int, int, int, int, int, int, int, int, int> type; type vec; // compile check only - cout << "vector50 of int: " << sizeof(vec) << endl; + std::cout << "vector50 of int: " << sizeof(vec) << std::endl; } { diff --git a/test/sequence/vector_tie.cpp b/test/sequence/vector_tie.cpp index 066dad87..123bf888 100644 --- a/test/sequence/vector_tie.cpp +++ b/test/sequence/vector_tie.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/vector_value_at.cpp b/test/sequence/vector_value_at.cpp index ffd84b34..191da4cf 100644 --- a/test/sequence/vector_value_at.cpp +++ b/test/sequence/vector_value_at.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman 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) diff --git a/test/sequence/zip_view.cpp b/test/sequence/zip_view.cpp index 8409711a..83bfa879 100644 --- a/test/sequence/zip_view.cpp +++ b/test/sequence/zip_view.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/zip_view2.cpp b/test/sequence/zip_view2.cpp index 38075f07..b63a2744 100644 --- a/test/sequence/zip_view2.cpp +++ b/test/sequence/zip_view2.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/test/sequence/zip_view_ignore.cpp b/test/sequence/zip_view_ignore.cpp index 2a300809..d22bf70f 100644 --- a/test/sequence/zip_view_ignore.cpp +++ b/test/sequence/zip_view_ignore.cpp @@ -34,19 +34,19 @@ int main() BOOST_TEST(at_c<0>(back(v)) == 2); BOOST_TEST(at_c<2>(back(v)) == 'b'); - typedef result_of::begin::type first_iterator; - typedef result_of::value_of::type first_element; + typedef boost::fusion::result_of::begin::type first_iterator; + typedef boost::fusion::result_of::value_of::type first_element; - typedef result_of::at_c::type e0; - typedef result_of::at_c::type e2; + typedef boost::fusion::result_of::at_c::type e0; + typedef boost::fusion::result_of::at_c::type e2; BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); BOOST_TEST(size(front(v)) == 3); - typedef result_of::value_at_c::type first_value_at; - typedef result_of::value_at_c::type v0; - typedef result_of::value_at_c::type v2; + typedef boost::fusion::result_of::value_at_c::type first_value_at; + typedef boost::fusion::result_of::value_at_c::type v0; + typedef boost::fusion::result_of::value_at_c::type v2; BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same));