forked from boostorg/fusion
Compare commits
17 Commits
boost-1.50
...
sandbox-br
Author | SHA1 | Date | |
---|---|---|---|
642c201bdd | |||
38cd16639d | |||
1c51ad943a | |||
a25a7092d8 | |||
48e4118768 | |||
0a520f6021 | |||
bbf10066bc | |||
c2052a3c0c | |||
480183059e | |||
fd82b51cec | |||
24bca52c5e | |||
459a1dba3d | |||
10274e7884 | |||
b6df98e86c | |||
4be9e08af7 | |||
f46b2aeb73 | |||
21301c93dc |
120
doc/adapted.qbk
120
doc/adapted.qbk
@ -244,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
|
||||
@ -287,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]
|
||||
@ -312,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
|
||||
@ -427,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
|
||||
@ -463,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.
|
||||
@ -478,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.
|
||||
|
||||
@ -539,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(
|
||||
@ -567,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
|
||||
@ -600,7 +600,7 @@ namespace qualified name of the class type to be adapted.
|
||||
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/include/adapt_adt.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
namespace demo
|
||||
{
|
||||
@ -609,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__
|
||||
@ -670,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)...`
|
||||
@ -708,40 +708,40 @@ namespace qualified name of the template class type to be adapted.
|
||||
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/include/adapt_adt.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
namespace demo
|
||||
{
|
||||
{
|
||||
template<typename Name, typename Age>
|
||||
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),
|
||||
@ -753,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__
|
||||
@ -778,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
|
||||
@ -800,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.
|
||||
|
||||
@ -811,7 +811,7 @@ namespace qualified name of the class type to be adapted.
|
||||
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/include/adapt_assoc_adt.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
namespace demo
|
||||
{
|
||||
@ -820,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<keys::name>(e)="Edward Norton";
|
||||
at_key<keys::age>(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__
|
||||
@ -887,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)...`
|
||||
@ -914,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.
|
||||
|
||||
@ -925,7 +925,7 @@ namespace qualified name of the template class type to be adapted.
|
||||
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/include/adapt_assoc_adt.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
namespace demo
|
||||
{
|
||||
@ -935,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<std::string, int> e;
|
||||
at_key<keys::name>(e)="Edward Norton";
|
||||
at_key<keys::age>(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__
|
||||
@ -1028,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 <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <boost/fusion/include/define_struct.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
|
||||
// demo::employee is a Fusion sequence
|
||||
@ -1097,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 <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <boost/fusion/include/define_struct.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
|
||||
// Any instantiated demo::employee is a Fusion sequence
|
||||
@ -1162,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 <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <boost/fusion/include/define_assoc_struct.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
|
||||
namespace keys
|
||||
@ -1177,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,
|
||||
@ -1238,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 <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <boost/fusion/include/define_assoc_struct.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
|
||||
namespace keys
|
||||
@ -1253,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,
|
||||
|
@ -134,7 +134,7 @@ the first call) and [arg_desc] of `seq`.
|
||||
>
|
||||
typename result_of_name_macro<Sequence, State const, F>::type name_macro(
|
||||
Sequence& seq, State const& initial_state, F f);
|
||||
|
||||
|
||||
template<
|
||||
typename Sequence,
|
||||
typename State,
|
||||
|
@ -44,5 +44,6 @@ This section summarizes significant changes to the Fusion library.
|
||||
* 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]
|
||||
|
@ -21,11 +21,10 @@ __views__. These containers are more or less counterparts of those in __stl__.
|
||||
|
||||
[heading Description]
|
||||
|
||||
`vector` is a __random_access_sequence__ of heterogenous typed data
|
||||
structured as a simple `struct` where each element is held as a member
|
||||
variable. `vector` is the simplest of the Fusion sequence container (a
|
||||
vector with N elements is just a struct with N members), and in many
|
||||
cases the most efficient.
|
||||
`vector` is a __random_access_sequence__ of heterogenous typed
|
||||
data structured as a simple `struct` where each element is held
|
||||
as a member variable. `vector` is the simplest of the Fusion
|
||||
sequence container, and in many cases the most efficient.
|
||||
|
||||
[heading Header]
|
||||
|
||||
@ -96,7 +95,7 @@ including any Fusion header to change the default. Example:
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`T0`...`TN`] [Element types] [__unspecified__]]
|
||||
[[`T0`...`TN`] [Element types] [['unspecified]]]
|
||||
]
|
||||
|
||||
[heading Model of]
|
||||
@ -157,7 +156,7 @@ time). The runtime cost of access to each element is peculiarly constant
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`Car`] [Head type] [ ]]
|
||||
[[`Car`] [Head type] []]
|
||||
[[`Cdr`] [Tail type] [`nil`]]
|
||||
]
|
||||
|
||||
@ -247,7 +246,7 @@ including any Fusion header to change the default. Example:
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`T0`...`TN`] [Element types] [__unspecified__]]
|
||||
[[`T0`...`TN`] [Element types] [['unspecified-type]]]
|
||||
]
|
||||
|
||||
[heading Model of]
|
||||
@ -290,220 +289,6 @@ constant (see __recursive_inline__).]
|
||||
|
||||
[endsect]
|
||||
|
||||
[section deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
`deque` is a simple __bidirectional_sequence__ that supports
|
||||
constant-time insertion and removal of elements at both ends. Like the
|
||||
__list__ and __cons__, `deque` is more efficient than __vector__
|
||||
(especially at compile time) when the target sequence is constructed
|
||||
piecemeal (a data at a time, e.g. when constructing expression
|
||||
templates). Like the __list__ and __cons__, runtime cost of access to
|
||||
each element is peculiarly constant (see __recursive_inline__).
|
||||
|
||||
Element insertion and removal are done by special `deque` helper classes
|
||||
__front_extended_deque__ and __back_extended_deque__.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/deque.hpp>
|
||||
#include <boost/fusion/include/deque.hpp>
|
||||
#include <boost/fusion/container/list/deque_fwd.hpp>
|
||||
#include <boost/fusion/include/deque_fwd.hpp>
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename ...Elements>
|
||||
struct deque;
|
||||
|
||||
For C++11 compilers, the variadic class interface has no upper bound.
|
||||
|
||||
For C++03 compilers, the variadic class interface accepts `0` to
|
||||
`FUSION_MAX_DEQUE_SIZE` elements, where `FUSION_MAX_DEQUE_SIZE` is a
|
||||
user definable predefined maximum that defaults to `10`. Example:
|
||||
|
||||
deque<int, char, double>
|
||||
|
||||
You may define the preprocessor constant `FUSION_MAX_DEQUE_SIZE` before
|
||||
including any Fusion header to change the default. Example:
|
||||
|
||||
#define FUSION_MAX_DEQUE_SIZE 20
|
||||
|
||||
[heading Template parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`Elements`] [Element types] [ ]]
|
||||
]
|
||||
|
||||
[heading Model of]
|
||||
|
||||
* __bidirectional_sequence__
|
||||
|
||||
[variablelist Notation
|
||||
[[`D`] [A `deque` type]]
|
||||
[[`d`, `d2`] [Instances of `deque`]]
|
||||
[[`e0`...`en`] [Heterogeneous values]]
|
||||
[[`s`] [A __forward_sequence__]]
|
||||
[[`N`] [An __mpl_integral_constant__]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
Semantics of an expression is defined only where it differs from, or is not
|
||||
defined in __bidirectional_sequence__.
|
||||
|
||||
[table
|
||||
[[Expression] [Semantics]]
|
||||
[[`D()`] [Creates a deque with default constructed elements.]]
|
||||
[[`D(e0, e1,... en)`] [Creates a deque with elements `e0`...`en`.]]
|
||||
[[`D(s)`] [Copy constructs a deque from a __forward_sequence__, `s`.]]
|
||||
[[`d = s`] [Assigns to a deque, `d`, from a __forward_sequence__, `s`.]]
|
||||
[[`__at__<N>(d)`] [The Nth element from the beginning of the sequence; see __at__.]]
|
||||
]
|
||||
|
||||
[blurb __note__ `__at__<N>(d)` is provided for convenience, despite
|
||||
`deque` being a __bidirectional_sequence__ only (`at` is supposed to be
|
||||
a __random_access_sequence__ requirement). The runtime complexity of
|
||||
__at__ is constant (see __recursive_inline__). `deque` element access
|
||||
utilizes operator overloading with argument dependent lookup (ADL) of
|
||||
the proper element getter function given a static constant index
|
||||
parameter. Interestingly, with modern C++ compilers, this lookup is very
|
||||
fast and rivals recursive template instantiations in compile time-speed,
|
||||
so much so that `deque` relies on ADL for all element access (indexing)
|
||||
as well as iteration.]
|
||||
|
||||
[heading Example]
|
||||
|
||||
deque<int, float> d(12, 5.5f);
|
||||
std::cout << __at_c__<0>(d) << std::endl;
|
||||
std::cout << __at_c__<1>(d) << std::endl;
|
||||
|
||||
[endsect]
|
||||
|
||||
[section front_extended_deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
`front_extended_deque` allows a __deque__ to be front extended. It shares
|
||||
the same properties as the __deque__.
|
||||
|
||||
[heading Header]
|
||||
|
||||
See __deque__
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename Deque, typename T>
|
||||
struct front_extended_deque;
|
||||
|
||||
[heading Template parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`Deque`] [Deque type] [ ]]
|
||||
[[`T`] [Element type] [ ]]
|
||||
]
|
||||
|
||||
[blurb __note__ `Deque` can be a __deque__, a __front_extended_deque__ or a
|
||||
__back_extended_deque__]
|
||||
|
||||
[heading Model of]
|
||||
|
||||
* __bidirectional_sequence__
|
||||
|
||||
[variablelist Notation
|
||||
[[`D`] [A `front_extended_deque` type]]
|
||||
[[`e`] [Heterogeneous value]]
|
||||
[[`N`] [An __mpl_integral_constant__]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
Semantics of an expression is defined only where it differs from, or is
|
||||
not defined in __bidirectional_sequence__.
|
||||
|
||||
[table
|
||||
[[Expression] [Semantics]]
|
||||
[[`D(d, e)`] [Extend `d` prepending `e` to its front.]]
|
||||
[[`__at__<N>(d)`] [The Nth element from the beginning of the sequence; see __at__.]]
|
||||
]
|
||||
|
||||
[blurb __note__ See __deque__ for further details.]
|
||||
|
||||
[heading Example]
|
||||
|
||||
typedef deque<int, float> initial_deque;
|
||||
initial_deque d(12, 5.5f);
|
||||
front_extended_deque<initial_deque, int> d2(d, 999);
|
||||
std::cout << __at_c__<0>(d2) << std::endl;
|
||||
std::cout << __at_c__<1>(d2) << std::endl;
|
||||
std::cout << __at_c__<2>(d2) << std::endl;
|
||||
|
||||
[endsect]
|
||||
|
||||
[section back_extended_deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
`back_extended_deque` allows a __deque__ to be back extended. It shares
|
||||
the same properties as the __deque__.
|
||||
|
||||
[heading Header]
|
||||
|
||||
See __deque__
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename Deque, typename T>
|
||||
struct back_extended_deque;
|
||||
|
||||
[heading Template parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`Deque`] [Deque type] [ ]]
|
||||
[[`T`] [Element type] [ ]]
|
||||
]
|
||||
|
||||
[blurb __note__ `Deque` can be a __deque__, a __back_extended_deque__ or a
|
||||
__back_extended_deque__]
|
||||
|
||||
[heading Model of]
|
||||
|
||||
* __bidirectional_sequence__
|
||||
|
||||
[variablelist Notation
|
||||
[[`D`] [A `back_extended_deque` type]]
|
||||
[[`e`] [Heterogeneous value]]
|
||||
[[`N`] [An __mpl_integral_constant__]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
Semantics of an expression is defined only where it differs from, or is
|
||||
not defined in __bidirectional_sequence__.
|
||||
|
||||
[table
|
||||
[[Expression] [Semantics]]
|
||||
[[`D(d, e)`] [Extend `d` prepending `e` to its back.]]
|
||||
[[`__at__<N>(d)`] [The Nth element from the beginning of the sequence; see __at__.]]
|
||||
]
|
||||
|
||||
[blurb __note__ See __deque__ for further details.]
|
||||
|
||||
[heading Example]
|
||||
|
||||
typedef deque<int, float> initial_deque;
|
||||
initial_deque d(12, 5.5f);
|
||||
back_extended_deque<initial_deque, int> d2(d, 999);
|
||||
std::cout << __at_c__<0>(d2) << std::endl;
|
||||
std::cout << __at_c__<1>(d2) << std::endl;
|
||||
std::cout << __at_c__<2>(d2) << std::endl;
|
||||
|
||||
[endsect]
|
||||
|
||||
[section set]
|
||||
|
||||
[heading Description]
|
||||
@ -547,7 +332,7 @@ including any Fusion header to change the default. Example:
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`T0`...`TN`] [Element types] [__unspecified__]]
|
||||
[[`T0`...`TN`] [Element types] [['unspecified-type]]]
|
||||
]
|
||||
|
||||
[heading Model of]
|
||||
@ -629,13 +414,13 @@ including any Fusion header to change the default. Example:
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`T0`...`TN`] [Element types] [__unspecified__]]
|
||||
[[`T0`...`TN`] [Element types] [['unspecified-type]]]
|
||||
]
|
||||
|
||||
[heading Model of]
|
||||
|
||||
* __associative_sequence__
|
||||
* __forward_sequence__
|
||||
* __random_access_sequence__
|
||||
|
||||
[variablelist Notation
|
||||
[[`M`] [A `map` type]]
|
||||
@ -647,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]]
|
||||
@ -832,58 +617,6 @@ __note_boost_ref__
|
||||
|
||||
[endsect]
|
||||
|
||||
[section make_deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
Create a __deque__ from one or more values.
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename ...Elements>
|
||||
typename __result_of_make_deque__<Elements...>::type
|
||||
make_deque(Elements const&... elements);
|
||||
|
||||
For C++11 compilers, the variadic function interface has no upper bound.
|
||||
|
||||
For C++11 compilers, the variadic function accepts `0` to
|
||||
`FUSION_MAX_DEQUE_SIZE` elements, where `FUSION_MAX_DEQUE_SIZE` is a
|
||||
user definable predefined maximum that defaults to `10`. You may define
|
||||
the preprocessor constant `FUSION_MAX_DEQUE_SIZE` before including any
|
||||
Fusion header to change the default. Example:
|
||||
|
||||
#define FUSION_MAX_DEQUE_SIZE 20
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Description]]
|
||||
[[`elements`] [Instances of `Elements`] [The arguments to `make_deque`]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
make_deque(elements...);
|
||||
|
||||
[*Return type]: __result_of_make_deque__`<Elements...>::type`
|
||||
|
||||
[*Semantics]: Create a __deque__ from `elements...`.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/generation/make_deque.hpp>
|
||||
#include <boost/fusion/include/make_deque.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
make_deque(123, "hello", 12.5)
|
||||
|
||||
[heading See also]
|
||||
|
||||
__note_boost_ref__
|
||||
|
||||
[endsect]
|
||||
|
||||
[section make_set]
|
||||
|
||||
[heading Description]
|
||||
@ -949,7 +682,7 @@ Create a __map__ from one or more key/data pairs.
|
||||
, typename T0, typename T1,... typename TN>
|
||||
typename __result_of_make_map__<K0, K0,... KN, T0, T1,... TN>::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
|
||||
@ -1001,7 +734,6 @@ succeeding sections document the various /tier/ flavors.
|
||||
* __list_tie__
|
||||
* __vector_tie__
|
||||
* __map_tie__
|
||||
* __deque_tie__
|
||||
|
||||
Example:
|
||||
|
||||
@ -1182,56 +914,6 @@ including any Fusion header to change the default. Example:
|
||||
|
||||
[endsect]
|
||||
|
||||
[section deque_tie]
|
||||
|
||||
[heading Description]
|
||||
|
||||
Constructs a tie using a __deque__ sequence.
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename ...Elements>
|
||||
__deque__<Elements&...>
|
||||
deque_tie(Elements&... elements);
|
||||
|
||||
For C++11 compilers, the variadic function interface has no upper bound.
|
||||
|
||||
For C++03 compilers, the variadic function accepts `0` to
|
||||
`FUSION_MAX_DEQUE_SIZE` elements, where `FUSION_MAX_DEQUE_SIZE` is a
|
||||
user definable predefined maximum that defaults to `10`. You may define
|
||||
the preprocessor constant `FUSION_MAX_DEQUE_SIZE` before including any
|
||||
Fusion header to change the default. Example:
|
||||
|
||||
#define FUSION_MAX_DEQUE_SIZE 20
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Description] [Description]]
|
||||
[[`elements`] [Instances of `Elements`] [The arguments to `deque_tie`]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
deque_tie(elements...);
|
||||
|
||||
[*Return type]: __deque__<Elements&...>
|
||||
|
||||
[*Semantics]: Create a __deque__ of references from `elements...`.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/generation/deque_tie.hpp>
|
||||
#include <boost/fusion/include/deque_tie.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
int i = 123;
|
||||
double d = 123.456;
|
||||
deque_tie(i, d)
|
||||
|
||||
[endsect]
|
||||
|
||||
[endsect]
|
||||
|
||||
[section MetaFunctions]
|
||||
@ -1366,54 +1048,6 @@ rules for __element_conversion__.
|
||||
|
||||
[endsect]
|
||||
|
||||
[section make_deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
Returns the result type of __make_deque__.
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename ...Elements>
|
||||
struct make_deque;
|
||||
|
||||
For C++11 compilers, the variadic template interface has no upper bound.
|
||||
|
||||
For C++03 The variadic function accepts `0` to `FUSION_MAX_DEQUE_SIZE`
|
||||
elements, where `FUSION_MAX_DEQUE_SIZE` is a user definable predefined
|
||||
maximum that defaults to `10`. You may define the preprocessor constant
|
||||
`FUSION_MAX_DEQUE_SIZE` before including any Fusion header to change the
|
||||
default. Example:
|
||||
|
||||
#define FUSION_MAX_DEQUE_SIZE 20
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Requirement] [Description]]
|
||||
[[`Elements`] [Variadic template types] [Template arguments to `make_deque`]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
result_of::make_deque<Elements...>::type
|
||||
|
||||
[*Return type]: A __deque__ with elements of types converted following the
|
||||
rules for __element_conversion__.
|
||||
|
||||
[*Semantics]: Create a __deque__ from `Elements...`.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/generation/make_deque.hpp>
|
||||
#include <boost/fusion/include/make_deque.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
result_of::make_deque<int, const char(&)[7], double>::type
|
||||
|
||||
[endsect]
|
||||
|
||||
[section make_set]
|
||||
|
||||
[heading Description]
|
||||
@ -1606,53 +1240,6 @@ default. Example:
|
||||
|
||||
[endsect]
|
||||
|
||||
[section deque_tie]
|
||||
|
||||
[heading Description]
|
||||
|
||||
Returns the result type of __deque_tie__.
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename ...Elements>
|
||||
struct deque_tie;
|
||||
|
||||
For C++11 compilers, the variadic template interface has no upper bound.
|
||||
|
||||
For C++03 compilers, the variadic function accepts `0` to
|
||||
`FUSION_MAX_DEQUE_SIZE` elements, where `FUSION_MAX_DEQUE_SIZE` is a
|
||||
user definable predefined maximum that defaults to `10`. You may define
|
||||
the preprocessor constant `FUSION_MAX_DEQUE_SIZE` before including any
|
||||
Fusion header to change the default. Example:
|
||||
|
||||
#define FUSION_MAX_DEQUE_SIZE 20
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Requirement] [Description]]
|
||||
[[`Elements`] [Variadic template types] [Template arguments to `deque_tie`]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
result_of::deque_tie<Elements...>::type;
|
||||
|
||||
[*Return type]: __deque__<Elements&...>
|
||||
|
||||
[*Semantics]: Create a __deque__ of references from `Elements...`.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/generation/deque_tie.hpp>
|
||||
#include <boost/fusion/include/deque_tie.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
result_of::deque_tie<int, double>::type
|
||||
|
||||
[endsect]
|
||||
|
||||
[section map_tie]
|
||||
|
||||
[heading Description]
|
||||
@ -1801,48 +1388,6 @@ Convert a fusion sequence to a __vector__.
|
||||
|
||||
[endsect]
|
||||
|
||||
[section as_deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
Convert a fusion sequence to a __deque__.
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename Sequence>
|
||||
typename result_of::as_deque<Sequence>::type
|
||||
as_deque(Sequence& seq);
|
||||
|
||||
template <typename Sequence>
|
||||
typename result_of::as_deque<Sequence const>::type
|
||||
as_deque(Sequence const& seq);
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Requirement] [Description]]
|
||||
[[`seq`] [An instance of Sequence] [The sequence to convert.]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
as_deque(seq);
|
||||
|
||||
[*Return type]: __result_of_as_deque__`<Sequence>::type`
|
||||
|
||||
[*Semantics]: Convert a fusion sequence, `seq`, to a __deque__.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/deque/convert.hpp>
|
||||
#include <boost/fusion/include/as_deque.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
as_deque(__make_vector__('x', 123, "hello"))
|
||||
|
||||
[endsect]
|
||||
|
||||
[section as_set]
|
||||
|
||||
[heading Description]
|
||||
@ -2014,44 +1559,6 @@ Returns the result type of __as_vector__.
|
||||
|
||||
[endsect]
|
||||
|
||||
[section as_deque]
|
||||
|
||||
[heading Description]
|
||||
|
||||
Returns the result type of __as_deque__.
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <typename Sequence>
|
||||
struct as_deque;
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
[[Parameter] [Requirement] [Description]]
|
||||
[[`Sequence`] [A fusion __sequence__] [The sequence type to convert.]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
result_of::as_deque<Sequence>::type;
|
||||
|
||||
[*Return type]: A __deque__ with same elements as the input sequence,
|
||||
`Sequence`.
|
||||
|
||||
[*Semantics]: Convert a fusion sequence, `Sequence`, to a __deque__.
|
||||
|
||||
[heading Header]
|
||||
|
||||
#include <boost/fusion/container/deque/convert.hpp>
|
||||
#include <boost/fusion/include/as_deque.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
result_of::as_deque<__vector__<char, int> >::type
|
||||
|
||||
[endsect]
|
||||
|
||||
[section as_set]
|
||||
|
||||
[heading Description]
|
||||
|
@ -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.
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
===============================================================================/]
|
||||
[library Fusion
|
||||
[quickbook 1.3]
|
||||
[version 2.1]
|
||||
[version 2.2]
|
||||
[authors [de Guzman, Joel], [Marsden, Dan], [Schwinger, Tobias]]
|
||||
[copyright 2001 2002 2003 2004 2005 2006 2011 2012 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.
|
||||
@ -116,9 +116,6 @@
|
||||
[def __vector__ [link fusion.container.vector `vector`]]
|
||||
[def __cons__ [link fusion.container.cons `cons`]]
|
||||
[def __list__ [link fusion.container.list `list`]]
|
||||
[def __deque__ [link fusion.container.deque `deque`]]
|
||||
[def __front_extended_deque__ [link fusion.container.front_extended_deque `front_extended_deque`]]
|
||||
[def __back_extended_deque__ [link fusion.container.back_extended_deque `back_extended_deque`]]
|
||||
[def __set__ [link fusion.container.set `set`]]
|
||||
[def __map__ [link fusion.container.map `map`]]
|
||||
|
||||
@ -201,16 +198,12 @@
|
||||
[def __result_of_make_cons__ [link fusion.container.generation.metafunctions.make_cons `result_of::make_cons`]]
|
||||
[def __make_list__ [link fusion.container.generation.functions.make_list `make_list`]]
|
||||
[def __result_of_make_list__ [link fusion.container.generation.metafunctions.make_list `result_of::make_list`]]
|
||||
[def __make_deque__ [link fusion.container.generation.functions.make_deque `make_deque`]]
|
||||
[def __result_of_make_deque__ [link fusion.container.generation.metafunctions.make_deque `result_of::make_deque`]]
|
||||
[def __make_set__ [link fusion.container.generation.functions.make_set `make_set`]]
|
||||
[def __result_of_make_set__ [link fusion.container.generation.metafunctions.make_set `result_of::make_set`]]
|
||||
[def __make_map__ [link fusion.container.generation.functions.make_map `make_map`]]
|
||||
[def __result_of_make_map__ [link fusion.container.generation.metafunctions.make_map `result_of::make_map`]]
|
||||
[def __list_tie__ [link fusion.container.generation.functions.list_tie `list_tie`]]
|
||||
[def __result_of_list_tie__ [link fusion.container.generation.metafunctions.list_tie `result_of::list_tie`]]
|
||||
[def __deque_tie__ [link fusion.container.generation.functions.deque_tie `deque_tie`]]
|
||||
[def __result_of_deque_tie__ [link fusion.container.generation.metafunctions.deque_tie `result_of::deque_tie`]]
|
||||
|
||||
[def __out__ [link fusion.sequence.operator.i_o.out out]]
|
||||
[def __in__ [link fusion.sequence.operator.i_o.in in]]
|
||||
|
@ -1,6 +1,6 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<head>
|
||||
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
@ -8,9 +8,9 @@
|
||||
http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<title>Redirect to generated documentation</title>
|
||||
<meta http-equiv="refresh" content="0; URL=http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/">
|
||||
</head>
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/">http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/</a>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -161,6 +161,7 @@ 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__)
|
||||
@ -206,6 +207,7 @@ the following expressions must be valid:
|
||||
|
||||
[heading Models]
|
||||
* __vector__ iterator
|
||||
* __map__ iterator
|
||||
* __std_pair__ iterator
|
||||
* __boost_array__ iterator
|
||||
* __single_view__ iterator
|
||||
@ -993,9 +995,9 @@ Returns the key type associated with the element referenced by an associative it
|
||||
[heading Example]
|
||||
typedef __map__<__pair__<float,int> > vec;
|
||||
typedef __result_of_begin__<vec>::type first;
|
||||
|
||||
|
||||
BOOST_MPL_ASSERT((boost::is_same<__result_of_key_of__<first>::type, float>));
|
||||
|
||||
|
||||
[endsect]
|
||||
|
||||
[section value_of_data]
|
||||
@ -1032,9 +1034,9 @@ Returns the type of the data property associated with the element referenced by
|
||||
[heading Example]
|
||||
typedef __map__<__pair__<float,int> > vec;
|
||||
typedef __result_of_begin__<vec>::type first;
|
||||
|
||||
|
||||
BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of_data__<first>::type, int>));
|
||||
|
||||
|
||||
[endsect]
|
||||
|
||||
[section deref_data]
|
||||
|
@ -168,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
|
||||
@ -176,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<type_name, ['N], ['Const]>], 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`]
|
||||
@ -205,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`]]
|
||||
|
@ -189,6 +189,7 @@ 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)
|
||||
@ -265,6 +266,7 @@ 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)
|
||||
@ -848,7 +850,7 @@ Performs an element by element swap of the elements in 2 sequences.
|
||||
|
||||
[table
|
||||
[[Parameters] [Requirement] [Description]]
|
||||
[[`seq1`, `seq2`] [Models of __forward_sequence__][The sequences whos elements we wish to swap.]]
|
||||
[[`seq1`, `seq2`][Models of __forward_sequence__][The sequences whos elements we wish to swap.]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
@ -1376,7 +1378,7 @@ Returns the actual element type associated with a Key from the __sequence__.
|
||||
|
||||
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
|
||||
#include <boost/fusion/include/value_at_key.hpp>
|
||||
|
||||
|
||||
[heading Example]
|
||||
typedef __map__<__pair__<int, char>, __pair__<char, char>, __pair__<double, char> > mymap;
|
||||
BOOST_MPL_ASSERT((boost::is_same<__result_of_at_key__<mymap, int>::type, char>));
|
||||
|
@ -483,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.
|
||||
|
||||
@ -507,15 +507,15 @@ the elements to iterate over.
|
||||
[[Parameter] [Description] [Default]]
|
||||
[[`Sequence`] [An arbitrary Fusion __forward_sequence__]
|
||||
[]]
|
||||
[[`Indicies`] [A `mpl::vector_c<int, ...>` holding the indicies defining
|
||||
[[`Indicies`] [A `mpl::vector_c<int, ...>` 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]]
|
||||
|
@ -3,7 +3,7 @@
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
@ -29,13 +29,13 @@ namespace boost { namespace fusion
|
||||
struct apply
|
||||
{
|
||||
typedef typename remove_const<Sequence>::type seq_type;
|
||||
typedef typename std::tuple_element<N::value, seq_type>::type element;
|
||||
typedef std::tuple_element<N::value, seq_type> element;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
mpl::eval_if<
|
||||
is_const<Sequence>
|
||||
, typename fusion::detail::cref_result<element>::type
|
||||
, typename fusion::detail::ref_result<element>::type
|
||||
, fusion::detail::cref_result<element>
|
||||
, fusion::detail::ref_result<element>
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
@ -48,12 +48,12 @@ namespace boost { namespace fusion
|
||||
template <typename Iterator>
|
||||
struct deref
|
||||
{
|
||||
typedef typename value_of<Iterator>::type element;
|
||||
typedef value_of<Iterator> element;
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
mpl::eval_if<
|
||||
is_const<typename Iterator::tuple_type>
|
||||
, typename fusion::detail::cref_result<element>::type
|
||||
, typename fusion::detail::ref_result<element>::type
|
||||
, fusion::detail::cref_result<element>
|
||||
, fusion::detail::ref_result<element>
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@ -10,6 +10,12 @@
|
||||
#include <tuple>
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template <typename... Elements>
|
||||
class tuple;
|
||||
}
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct std_tuple_tag;
|
||||
|
@ -22,25 +22,6 @@
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// With no decltype and variadics, we will use the C++03 version
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if (defined(BOOST_NO_DECLTYPE) \
|
||||
|| defined(BOOST_NO_VARIADIC_TEMPLATES) \
|
||||
|| defined(BOOST_NO_RVALUE_REFERENCES))
|
||||
# include <boost/fusion/container/deque/detail/cpp03_deque.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
#include <boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp>
|
||||
#include <boost/fusion/container/deque/deque_fwd.hpp>
|
||||
#include <boost/fusion/container/deque/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/at_impl.hpp>
|
||||
@ -48,67 +29,93 @@
|
||||
#include <boost/fusion/container/deque/detail/end_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/void.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
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)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct deque_tag;
|
||||
|
||||
template <typename ...Elements>
|
||||
struct deque : detail::nil_keyed_element
|
||||
{
|
||||
};
|
||||
|
||||
template <typename Head, typename ...Tail>
|
||||
struct deque<Head, Tail...>
|
||||
: detail::deque_keyed_values<Head, Tail...>::type
|
||||
, sequence_base<deque<Head, Tail...>>
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
|
||||
struct deque
|
||||
:
|
||||
detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
|
||||
sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
|
||||
{
|
||||
typedef deque_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef typename detail::deque_keyed_values<Head, Tail...>::type base;
|
||||
typedef mpl::int_<(sizeof ...(Tail) + 1)> size;
|
||||
typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
|
||||
typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
|
||||
typedef mpl::int_<size::value> next_up;
|
||||
typedef mpl::int_<mpl::int_<((size::value == 0) ? 0 : -1)>::type::value> next_down;
|
||||
typedef mpl::int_<
|
||||
mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
|
||||
typedef mpl::false_ is_view;
|
||||
|
||||
#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
|
||||
|
||||
deque()
|
||||
{}
|
||||
{}
|
||||
|
||||
template <typename ...Elements>
|
||||
deque(deque<Elements...> const& seq)
|
||||
: base(seq)
|
||||
{}
|
||||
explicit deque(typename add_reference<typename add_const<T0>::type>::type t0)
|
||||
: base(t0, detail::nil_keyed_element())
|
||||
{}
|
||||
|
||||
explicit deque(typename detail::call_param<Head>::type head
|
||||
, typename detail::call_param<Tail>::type... tail)
|
||||
: base(detail::deque_keyed_values<Head, Tail...>::call(head, tail...))
|
||||
{}
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
|
||||
: base(seq)
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
explicit deque(Sequence const& seq
|
||||
, typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
template<typename Sequence>
|
||||
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
|
||||
template <typename ...Elements>
|
||||
deque& operator=(deque<Elements...> const& rhs)
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
deque&
|
||||
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
deque& operator=(T const& rhs)
|
||||
deque&
|
||||
operator=(T const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
||||
|
@ -11,26 +11,40 @@
|
||||
#include <boost/fusion/container/deque/limits.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// With no decltype and variadics, we will use the C++03 version
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if (defined(BOOST_NO_DECLTYPE) \
|
||||
|| defined(BOOST_NO_VARIADIC_TEMPLATES) \
|
||||
|| defined(BOOST_NO_RVALUE_REFERENCES))
|
||||
# include <boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp>
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/*=============================================================================
|
||||
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)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template <typename ...T>
|
||||
struct void_;
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
FUSION_MAX_DEQUE_SIZE, typename T, void_)>
|
||||
struct deque;
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
||||
|
@ -1,125 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_CPP03_FUSION_DEQUE_26112006_1649)
|
||||
#define BOOST_CPP03_FUSION_DEQUE_26112006_1649
|
||||
|
||||
#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
|
||||
#error "C++03 only! This file should not have been included"
|
||||
#endif
|
||||
|
||||
#include <boost/fusion/container/deque/limits.hpp>
|
||||
#include <boost/fusion/container/deque/front_extended_deque.hpp>
|
||||
#include <boost/fusion/container/deque/back_extended_deque.hpp>
|
||||
#include <boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp>
|
||||
#include <boost/fusion/container/deque/detail/deque_initial_size.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#include <boost/fusion/container/deque/deque_fwd.hpp>
|
||||
#include <boost/fusion/container/deque/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/at_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/end_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/void.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
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)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct deque_tag;
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
|
||||
struct deque
|
||||
:
|
||||
detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
|
||||
sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
|
||||
{
|
||||
typedef deque_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
|
||||
typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
|
||||
typedef mpl::int_<size::value> next_up;
|
||||
typedef mpl::int_<
|
||||
mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
|
||||
typedef mpl::false_ is_view;
|
||||
|
||||
#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
|
||||
|
||||
deque()
|
||||
{}
|
||||
|
||||
explicit deque(typename add_reference<typename add_const<T0>::type>::type t0)
|
||||
: base(t0, detail::nil_keyed_element())
|
||||
{}
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
|
||||
: base(seq)
|
||||
{}
|
||||
|
||||
template<typename Sequence>
|
||||
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
deque&
|
||||
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
deque&
|
||||
operator=(T const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2007 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_CPP03_DEQUE_FORWARD_02092007_0749)
|
||||
#define FUSION_CPP03_DEQUE_FORWARD_02092007_0749
|
||||
|
||||
#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
|
||||
#error "C++03 only! This file should not have been included"
|
||||
#endif
|
||||
|
||||
#include <boost/fusion/container/deque/limits.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
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)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
FUSION_MAX_DEQUE_SIZE, typename T, void_)>
|
||||
struct deque;
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
@ -1,106 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330)
|
||||
#define BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330
|
||||
|
||||
#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
|
||||
#error "C++03 only! This file should not have been included"
|
||||
#endif
|
||||
|
||||
#include <boost/fusion/container/deque/limits.hpp>
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/print.hpp>
|
||||
|
||||
#define FUSION_VOID(z, n, _) void_
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
}}
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/deque/detail/preprocessed/deque_keyed_values.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/deque_keyed_values" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
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)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template<typename Key, typename Value, typename Rest>
|
||||
struct keyed_element;
|
||||
|
||||
struct nil_keyed_element;
|
||||
|
||||
template<typename N, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_DEQUE_SIZE, typename T, void_)>
|
||||
struct deque_keyed_values_impl;
|
||||
|
||||
template<typename N>
|
||||
struct deque_keyed_values_impl<N, BOOST_PP_ENUM(FUSION_MAX_DEQUE_SIZE, FUSION_VOID, _)>
|
||||
{
|
||||
typedef nil_keyed_element type;
|
||||
|
||||
static type call()
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename N, BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
|
||||
struct deque_keyed_values_impl
|
||||
{
|
||||
typedef mpl::int_<mpl::plus<N, mpl::int_<1> >::value> next_index;
|
||||
|
||||
typedef typename deque_keyed_values_impl<
|
||||
next_index,
|
||||
BOOST_PP_ENUM_SHIFTED_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type tail;
|
||||
typedef keyed_element<N, T0, tail> type;
|
||||
|
||||
#include <boost/fusion/container/deque/detail/deque_keyed_values_call.hpp>
|
||||
|
||||
};
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_DEQUE_SIZE, typename T, void_)>
|
||||
struct deque_keyed_values
|
||||
: deque_keyed_values_impl<mpl::int_<0>, BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>
|
||||
{};
|
||||
|
||||
}}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#undef FUSION_VOID
|
||||
|
||||
#endif
|
@ -1,56 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901)
|
||||
#define BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901
|
||||
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template<typename Key, typename Value, typename Rest>
|
||||
struct keyed_element;
|
||||
|
||||
template <typename N, typename ...Elements>
|
||||
struct deque_keyed_values_impl;
|
||||
|
||||
template <typename N, typename Head, typename ...Tail>
|
||||
struct deque_keyed_values_impl<N, Head, Tail...>
|
||||
{
|
||||
typedef mpl::int_<(N::value + 1)> next_index;
|
||||
typedef typename deque_keyed_values_impl<next_index, Tail...>::type tail;
|
||||
typedef keyed_element<N, Head, tail> type;
|
||||
|
||||
static type call(
|
||||
typename detail::call_param<Head>::type head
|
||||
, typename detail::call_param<Tail>::type... tail)
|
||||
{
|
||||
return type(
|
||||
head
|
||||
, deque_keyed_values_impl<next_index, Tail...>::call(tail...)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
struct nil_keyed_element;
|
||||
|
||||
template <typename N>
|
||||
struct deque_keyed_values_impl<N>
|
||||
{
|
||||
typedef nil_keyed_element type;
|
||||
static type call() { return type(); }
|
||||
};
|
||||
|
||||
template <typename ...Elements>
|
||||
struct deque_keyed_values
|
||||
: deque_keyed_values_impl<mpl::int_<0>, Elements...> {};
|
||||
}}}
|
||||
|
||||
#endif
|
@ -8,7 +8,9 @@
|
||||
#if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
|
||||
#define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330
|
||||
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
|
||||
@ -57,17 +59,17 @@ namespace detail {
|
||||
return *this;
|
||||
}
|
||||
|
||||
typename cref_result<Value>::type get(Key) const
|
||||
typename add_reference<typename add_const<Value>::type>::type get(Key) const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
typename ref_result<Value>::type get(Key)
|
||||
typename add_reference<Value>::type get(Key)
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
keyed_element(typename call_param<Value>::type value, Rest const& rest)
|
||||
keyed_element(typename add_reference<typename add_const<Value>::type>::type value, Rest const& rest)
|
||||
: Rest(rest), value_(value)
|
||||
{}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
@ -93,15 +93,15 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename detail::cons_deref<
|
||||
typename detail::cons_advance<Sequence, N::value>::type>::type
|
||||
typedef detail::cons_deref<
|
||||
typename detail::cons_advance<Sequence, N::value>::type>
|
||||
element;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
mpl::eval_if<
|
||||
is_const<Sequence>
|
||||
, typename detail::cref_result<element>::type
|
||||
, typename detail::ref_result<element>::type
|
||||
, detail::cref_result<element>
|
||||
, detail::ref_result<element>
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@ -28,9 +28,7 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
mpl::at<typename Sequence::storage_type::types, N>::type
|
||||
element;
|
||||
typedef mpl::at<typename Sequence::storage_type::types, N> element;
|
||||
typedef typename detail::ref_result<element>::type type;
|
||||
|
||||
static type
|
||||
@ -43,9 +41,7 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence, typename N>
|
||||
struct apply <Sequence const, N>
|
||||
{
|
||||
typedef typename
|
||||
mpl::at<typename Sequence::storage_type::types, N>::type
|
||||
element;
|
||||
typedef mpl::at<typename Sequence::storage_type::types, N> element;
|
||||
typedef typename detail::cref_result<element>::type type;
|
||||
|
||||
static type
|
||||
|
@ -12,7 +12,8 @@
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
@ -28,10 +29,10 @@ namespace boost { namespace fusion { namespace extension
|
||||
typedef typename result_of::value_of<It>::type::second_type data;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
mpl::eval_if<
|
||||
is_const<typename It::seq_type>
|
||||
, typename detail::cref_result<data>::type
|
||||
, typename detail::ref_result<data>::type
|
||||
, detail::cref_result<mpl::identity<data> >
|
||||
, detail::ref_result<mpl::identity<data> >
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::at<typename Sequence::types, N>::type element;
|
||||
typedef mpl::at<typename Sequence::types, N> element;
|
||||
typedef typename detail::ref_result<element>::type type;
|
||||
|
||||
static type
|
||||
@ -40,7 +40,7 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence, typename N>
|
||||
struct apply <Sequence const, N>
|
||||
{
|
||||
typedef typename mpl::at<typename Sequence::types, N>::type element;
|
||||
typedef mpl::at<typename Sequence::types, N> element;
|
||||
typedef typename detail::cref_result<element>::type type;
|
||||
|
||||
static type
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <boost/mpl/at.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
@ -30,14 +29,14 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::vector vector;
|
||||
typedef typename Iterator::index index;
|
||||
typedef typename mpl::at<
|
||||
typename vector::types, index>::type
|
||||
typename vector::types, index>
|
||||
element;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
mpl::eval_if<
|
||||
is_const<vector>
|
||||
, typename fusion::detail::cref_result<element>::type
|
||||
, typename fusion::detail::ref_result<element>::type
|
||||
, fusion::detail::cref_result<element>
|
||||
, fusion::detail::ref_result<element>
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
template <typename T>
|
||||
struct ref_result
|
||||
{
|
||||
typedef typename add_reference<T>::type type;
|
||||
typedef typename add_reference<typename T::type>::type type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -23,7 +23,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
typedef typename
|
||||
add_reference<
|
||||
typename add_const<T>::type
|
||||
typename add_const<typename T::type>::type
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*=============================================================================
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
|
@ -72,6 +72,8 @@ struct fobj
|
||||
|
||||
int operator()(int i, object &, object_nc &) { return 10 + i; }
|
||||
int operator()(int i, object &, object_nc &) const { return 11 + i; }
|
||||
int operator()(int i, object const &, object_nc &);
|
||||
int operator()(int i, object const &, object_nc &) const;
|
||||
};
|
||||
|
||||
struct nullary_fobj
|
||||
|
@ -75,6 +75,8 @@ struct fobj
|
||||
|
||||
int operator()(int i, object &, object_nc &) { return 10 + i; }
|
||||
int operator()(int i, object &, object_nc &) const { return 11 + i; }
|
||||
int operator()(int i, object const &, object_nc &);
|
||||
int operator()(int i, object const &, object_nc &) const;
|
||||
};
|
||||
|
||||
struct nullary_fobj
|
||||
|
@ -71,7 +71,7 @@ void result_type_tests()
|
||||
|
||||
typedef fusion::unfused< test_func<> > t;
|
||||
BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value ));
|
||||
BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value ));
|
||||
BOOST_TEST(( is_same< boost::result_of< t (int &) >::type, long >::value ));
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@ -85,7 +85,7 @@ void result_type_tests()
|
||||
typedef fusion::unfused_typed< test_func<>, types0 > t0;
|
||||
BOOST_TEST(( is_same< boost::result_of< t0 () >::type, long >::value ));
|
||||
typedef fusion::unfused_typed< test_func<>, types1 > t1;
|
||||
BOOST_TEST(( is_same< boost::result_of< t1 (int) >::type, long >::value ));
|
||||
BOOST_TEST(( is_same< boost::result_of< t1 (long &) >::type, long >::value ));
|
||||
}
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC < 1400
|
||||
|
@ -103,7 +103,7 @@ main()
|
||||
useThisIStringStream is("(100 200 300)");
|
||||
|
||||
vector<int, int, int> ti;
|
||||
BOOST_TEST(bool(is >> ti) != 0);
|
||||
BOOST_TEST(bool((is >> ti) != 0));
|
||||
BOOST_TEST(ti == make_vector(100, 200, 300));
|
||||
|
||||
// Note that strings are problematic:
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*=============================================================================
|
||||
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 <string>
|
||||
@ -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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*=============================================================================
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
@ -20,6 +20,8 @@
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/at.hpp>
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
@ -39,18 +41,19 @@ main()
|
||||
{
|
||||
typedef map<
|
||||
pair<int, char>
|
||||
, pair<double, std::string> >
|
||||
, pair<double, std::string> >
|
||||
map_type;
|
||||
|
||||
BOOST_MPL_ASSERT((traits::is_associative<map_type>));
|
||||
|
||||
BOOST_MPL_ASSERT((traits::is_random_access<map_type>));
|
||||
|
||||
map_type m(
|
||||
make_pair<int>('X')
|
||||
, make_pair<double>("Men"));
|
||||
|
||||
|
||||
std::cout << at_key<int>(m) << std::endl;
|
||||
std::cout << at_key<double>(m) << std::endl;
|
||||
|
||||
|
||||
BOOST_TEST(at_key<int>(m) == 'X');
|
||||
BOOST_TEST(at_key<double>(m) == "Men");
|
||||
|
||||
@ -58,7 +61,7 @@ main()
|
||||
boost::is_same<boost::fusion::result_of::value_at_key<map_type, int>::type, char>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<boost::fusion::result_of::value_at_key<map_type, double>::type, std::string>::value));
|
||||
|
||||
|
||||
std::cout << m << std::endl;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<map_type, int>::value));
|
||||
@ -75,8 +78,43 @@ main()
|
||||
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::begin<map_type>::type>::type>::type, double>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::begin<map_type>::type>::type, char>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::begin<map_type>::type>::type>::type, std::string>::value));
|
||||
|
||||
//! Test random access interface.
|
||||
pair<int, char> a = at_c<0>(m);
|
||||
pair<double, std::string> b = at_c<1>(m);
|
||||
}
|
||||
|
||||
|
||||
//! iterators & random access interface.
|
||||
{
|
||||
typedef pair<boost::mpl::int_<0>, std::string> pair0;
|
||||
typedef pair<boost::mpl::int_<1>, std::string> pair1;
|
||||
typedef pair<boost::mpl::int_<2>, std::string> pair2;
|
||||
typedef pair<boost::mpl::int_<3>, std::string> pair3;
|
||||
typedef pair<boost::mpl::int_<4>, 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<char, int>('X', 123) << std::endl;
|
||||
BOOST_TEST(at_key<char>(make_map<char, int>('X', 123)) == 'X');
|
||||
|
@ -6,6 +6,7 @@
|
||||
==============================================================================*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/map/map.hpp>
|
||||
#include <boost/fusion/adapted/mpl.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
@ -82,6 +83,27 @@ main()
|
||||
));
|
||||
}
|
||||
|
||||
//! Map
|
||||
{
|
||||
typedef pair<boost::mpl::int_<0>, std::string> pair0;
|
||||
typedef pair<boost::mpl::int_<1>, std::string> pair1;
|
||||
typedef pair<boost::mpl::int_<2>, std::string> pair2;
|
||||
typedef pair<boost::mpl::int_<3>, std::string> pair3;
|
||||
typedef pair<boost::mpl::int_<4>, 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<map_type> 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();
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
Copyright (c) 1999-2003 Jaakko Jarvi
|
||||
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 <boost/fusion/tuple.hpp>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*=============================================================================
|
||||
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 <boost/fusion/container/vector/vector.hpp>
|
||||
|
Reference in New Issue
Block a user