summaryrefslogtreecommitdiff
path: root/boost/spirit/home/x3/core/detail/parse_into_container.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/x3/core/detail/parse_into_container.hpp')
-rw-r--r--boost/spirit/home/x3/core/detail/parse_into_container.hpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/boost/spirit/home/x3/core/detail/parse_into_container.hpp b/boost/spirit/home/x3/core/detail/parse_into_container.hpp
index 979238cff3..b58add3b28 100644
--- a/boost/spirit/home/x3/core/detail/parse_into_container.hpp
+++ b/boost/spirit/home/x3/core/detail/parse_into_container.hpp
@@ -12,6 +12,7 @@
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
#include <boost/spirit/home/x3/support/traits/value_traits.hpp>
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
+#include <boost/spirit/home/x3/support/traits/pseudo_attribute.hpp>
#include <boost/spirit/home/x3/support/traits/handles_container.hpp>
#include <boost/spirit/home/x3/support/traits/has_attribute.hpp>
#include <boost/spirit/home/x3/support/traits/is_substitute.hpp>
@@ -91,10 +92,10 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
, Context const& context, RContext& rcontext, Attribute& attr, mpl::false_)
{
// synthesized attribute needs to be value initialized
- typedef typename
- traits::container_value<Attribute>::type
- value_type;
- value_type val = traits::value_initialize<value_type>::call();
+ using value_type = typename traits::container_value<Attribute>::type;
+ using pseudo = traits::pseudo_attribute<Context, value_type, Iterator>;
+ typename pseudo::type val = pseudo::call(
+ first, last, traits::value_initialize<value_type>::call());
if (!parser.parse(first, last, context, rcontext, val))
return false;
@@ -221,10 +222,14 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
template <typename Parser, typename Context, typename RContext, typename Enable = void>
struct parse_into_container_impl : parse_into_container_base_impl<Parser> {};
- template <typename Parser, typename Container, typename Context>
+ template <typename Parser, typename Iterator, typename Container, typename Context>
struct parser_attr_is_substitute_for_container_value
: traits::is_substitute<
- typename traits::attribute_of<Parser, Context>::type
+ typename traits::pseudo_attribute<
+ Context
+ , typename traits::attribute_of<Parser, Context>::type
+ , Iterator
+ >::type
, typename traits::container_value<Container>::type
>
{};
@@ -278,7 +283,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
parser_accepts_container;
typedef parser_attr_is_substitute_for_container_value<
- Parser, Attribute, Context>
+ Parser, Iterator, Attribute, Context>
parser_attr_is_substitute_for_container_value;
typedef mpl::or_<