...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The template assign_to_container_from_value
is a type used as an attribute customization point. It is invoked by
all primitive Qi parsers in order to store a parsed
attribute value into the attribute instance provided by the user, if
this attribute is a container type (is_container<T>::type
evaluates to mpl::true_
, where T
is the attribute type).
#include <boost/spirit/home/qi/detail/assign_to.hpp>
Also, see Include Structure.
Note | |
---|---|
This header file does not need to be included directly by any user program as it is normally included by other Spirit header files relying on its content. |
Name |
---|
|
template <typename Attrib, typename T, typename Enable> struct assign_to_container_from_value { static void call(T const& val, Attrib& attr); };
Parameter |
Description |
Default |
---|---|---|
|
The type, |
none |
|
The type, |
none |
|
Helper template parameter usable to selectively enable or disable
certain specializations of |
|
Notation
Attrib
A type to be used as the target to store the attribute value in.
This type is guaranteed to be a container type (is_container<Attrib>::type
evaluates to mpl::true_
).
attr
An attribute instance of type Attrib
.
T
A type as produced by the parser. The parser temporarily stores its parsed values using this type.
t
An attribute instance of type T
.
Expression |
Semantics |
---|---|
assign_to_container_from_value<Attrib, T>::call(t, attr)
|
Add the value |
Template Parameters |
Semantics |
---|---|
|
Add the argument |
|
Do nothing. |
The customization point assign_to_container_from_value
needs to be implemented for a specific type whenever the default implementation
as shown above is not applicable. Examples for this could be that the
type Attrib
is not copy
constructible.