]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/spirit/home/x3/core/detail/parse_into_container.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / spirit / home / x3 / core / detail / parse_into_container.hpp
index 45ecc41ae0593c8ec5392ec2136e2be76375bcaf..4f2310a8e55bc64e2761c5aeecaf54e04e8bfb69 100644 (file)
@@ -4,8 +4,8 @@
     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(SPIRIT_PARSE_INTO_CONTAINER_JAN_15_2013_0957PM)
-#define SPIRIT_PARSE_INTO_CONTAINER_JAN_15_2013_0957PM
+#if !defined(BOOST_SPIRIT_X3_PARSE_INTO_CONTAINER_JAN_15_2013_0957PM)
+#define BOOST_SPIRIT_X3_PARSE_INTO_CONTAINER_JAN_15_2013_0957PM
 
 #include <type_traits>
 
@@ -17,6 +17,7 @@
 #include <boost/spirit/home/x3/support/traits/is_substitute.hpp>
 #include <boost/spirit/home/x3/support/traits/move_to.hpp>
 #include <boost/mpl/and.hpp>
+#include <boost/fusion/include/at_key.hpp>
 #include <boost/fusion/include/front.hpp>
 #include <boost/fusion/include/back.hpp>
 #include <boost/variant/apply_visitor.hpp>
@@ -37,10 +38,6 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
         }
     };
 
-/*     $$$ clang reports: warning: class template partial specialization contains
- *     a template parameter that can not be deduced; this partial specialization
- *     will never be used $$$
- *
     // save to associative fusion container where Key
     // is variant over possible keys
     template <typename ...T>
@@ -54,7 +51,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
             apply_visitor(saver_visitor<Attribute, Value>(attr, value), key);
         }
     };
-*/
+
     template <typename Attribute, typename Value>
     struct saver_visitor  : boost::static_visitor<void>
     {
@@ -245,18 +242,27 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
                 parser, first, last, context, rcontext, attr);
         }
 
+        template <typename Iterator>
+        static bool call(
+            Parser const& parser
+          , Iterator& first, Iterator const& last
+          , Context const& context, RContext& rcontext, unused_type attr, mpl::true_)
+        {
+            return parser.parse(first, last, context, rcontext, attr);
+        }
+
         template <typename Iterator, typename Attribute>
         static bool call(
             Parser const& parser
           , Iterator& first, Iterator const& last
           , Context const& context, RContext& rcontext, Attribute& attr, mpl::true_)
         {
-            if (attr.empty())
+            if (traits::is_empty(attr))
                 return parser.parse(first, last, context, rcontext, attr);
             Attribute rest;
             bool r = parser.parse(first, last, context, rcontext, rest);
             if (r)
-                attr.insert(attr.end(), rest.begin(), rest.end());
+                traits::append(attr, rest.begin(), rest.end());
             return r;
         }