diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/spirit/home/x3/directive | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-upstream/1.67.0.tar.gz boost-upstream/1.67.0.tar.bz2 boost-upstream/1.67.0.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/spirit/home/x3/directive')
-rw-r--r-- | boost/spirit/home/x3/directive/confix.hpp | 2 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/expect.hpp | 4 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/lexeme.hpp | 4 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/no_case.hpp | 4 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/no_skip.hpp | 4 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/omit.hpp | 4 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/repeat.hpp | 7 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/skip.hpp | 4 | ||||
-rw-r--r-- | boost/spirit/home/x3/directive/with.hpp | 43 |
9 files changed, 26 insertions, 50 deletions
diff --git a/boost/spirit/home/x3/directive/confix.hpp b/boost/spirit/home/x3/directive/confix.hpp index 0d99e58f4e..079aac122f 100644 --- a/boost/spirit/home/x3/directive/confix.hpp +++ b/boost/spirit/home/x3/directive/confix.hpp @@ -35,7 +35,7 @@ namespace boost { namespace spirit { namespace x3 , typename RContext, typename Attribute> bool parse( Iterator& first, Iterator const& last - , Context& context, RContext& rcontext, Attribute& attr) const + , Context const& context, RContext& rcontext, Attribute& attr) const { Iterator save = first; diff --git a/boost/spirit/home/x3/directive/expect.hpp b/boost/spirit/home/x3/directive/expect.hpp index fe4491a22e..418ecf9b0d 100644 --- a/boost/spirit/home/x3/directive/expect.hpp +++ b/boost/spirit/home/x3/directive/expect.hpp @@ -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_EXPECT_MARCH_16_2012_1024PM) -#define SPIRIT_EXPECT_MARCH_16_2012_1024PM +#if !defined(BOOST_SPIRIT_X3_EXPECT_MARCH_16_2012_1024PM) +#define BOOST_SPIRIT_X3_EXPECT_MARCH_16_2012_1024PM #include <boost/spirit/home/x3/support/context.hpp> #include <boost/spirit/home/x3/core/parser.hpp> diff --git a/boost/spirit/home/x3/directive/lexeme.hpp b/boost/spirit/home/x3/directive/lexeme.hpp index ce3a6def80..6f250c80ed 100644 --- a/boost/spirit/home/x3/directive/lexeme.hpp +++ b/boost/spirit/home/x3/directive/lexeme.hpp @@ -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_LEXEME_MARCH_24_2007_0802AM) -#define SPIRIT_LEXEME_MARCH_24_2007_0802AM +#if !defined(BOOST_SPIRIT_X3_LEXEME_MARCH_24_2007_0802AM) +#define BOOST_SPIRIT_X3_LEXEME_MARCH_24_2007_0802AM #include <boost/spirit/home/x3/support/context.hpp> #include <boost/spirit/home/x3/support/unused.hpp> diff --git a/boost/spirit/home/x3/directive/no_case.hpp b/boost/spirit/home/x3/directive/no_case.hpp index b00315614a..7a91e330e4 100644 --- a/boost/spirit/home/x3/directive/no_case.hpp +++ b/boost/spirit/home/x3/directive/no_case.hpp @@ -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_NO_CASE_SEPT_16_2014_0912PM) -#define SPIRIT_NO_CASE_SEPT_16_2014_0912PM +#if !defined(BOOST_SPIRIT_X3_NO_CASE_SEPT_16_2014_0912PM) +#define BOOST_SPIRIT_X3_NO_CASE_SEPT_16_2014_0912PM #include <boost/spirit/home/x3/support/context.hpp> #include <boost/spirit/home/x3/support/unused.hpp> diff --git a/boost/spirit/home/x3/directive/no_skip.hpp b/boost/spirit/home/x3/directive/no_skip.hpp index c6245f577a..6a7504bd3b 100644 --- a/boost/spirit/home/x3/directive/no_skip.hpp +++ b/boost/spirit/home/x3/directive/no_skip.hpp @@ -6,8 +6,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_NO_SKIP_JAN_16_2010_0802PM) -#define SPIRIT_NO_SKIP_JAN_16_2010_0802PM +#if !defined(BOOST_SPIRIT_X3_NO_SKIP_JAN_16_2010_0802PM) +#define BOOST_SPIRIT_X3_NO_SKIP_JAN_16_2010_0802PM #include <boost/spirit/home/x3/support/context.hpp> #include <boost/spirit/home/x3/support/unused.hpp> diff --git a/boost/spirit/home/x3/directive/omit.hpp b/boost/spirit/home/x3/directive/omit.hpp index 3053676983..fa0f6d9aee 100644 --- a/boost/spirit/home/x3/directive/omit.hpp +++ b/boost/spirit/home/x3/directive/omit.hpp @@ -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_OMIT_MARCH_24_2007_0802AM) -#define SPIRIT_OMIT_MARCH_24_2007_0802AM +#if !defined(BOOST_SPIRIT_X3_OMIT_MARCH_24_2007_0802AM) +#define BOOST_SPIRIT_X3_OMIT_MARCH_24_2007_0802AM #include <boost/spirit/home/x3/support/unused.hpp> #include <boost/spirit/home/x3/core/parser.hpp> diff --git a/boost/spirit/home/x3/directive/repeat.hpp b/boost/spirit/home/x3/directive/repeat.hpp index 1cdee97fb9..9c4d923255 100644 --- a/boost/spirit/home/x3/directive/repeat.hpp +++ b/boost/spirit/home/x3/directive/repeat.hpp @@ -9,8 +9,6 @@ #if !defined(SPIRIT_X3_REPEAT_APRIL_16_2014_0848AM) #define SPIRIT_X3_REPEAT_APRIL_16_2014_0848AM -#include <boost/function_types/function_type.hpp> -#include <boost/function_types/parameter_types.hpp> #include <boost/spirit/home/x3/core/parser.hpp> #include <boost/spirit/home/x3/operator/kleene.hpp> @@ -98,10 +96,9 @@ namespace boost { namespace spirit { namespace x3 struct repeat_gen { template<typename Subject> - kleene<typename extension::as_parser<Subject>::value_type> - operator[](Subject const& subject) const + auto operator[](Subject const& subject) const { - return { as_parser(subject) }; + return *as_parser(subject); } template <typename T> diff --git a/boost/spirit/home/x3/directive/skip.hpp b/boost/spirit/home/x3/directive/skip.hpp index 8d8bc78aca..321e32bee2 100644 --- a/boost/spirit/home/x3/directive/skip.hpp +++ b/boost/spirit/home/x3/directive/skip.hpp @@ -5,8 +5,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_SKIP_JANUARY_26_2008_0422PM) -#define SPIRIT_SKIP_JANUARY_26_2008_0422PM +#if !defined(BOOST_SPIRIT_X3_SKIP_JANUARY_26_2008_0422PM) +#define BOOST_SPIRIT_X3_SKIP_JANUARY_26_2008_0422PM #include <boost/spirit/home/x3/support/context.hpp> #include <boost/spirit/home/x3/support/unused.hpp> diff --git a/boost/spirit/home/x3/directive/with.hpp b/boost/spirit/home/x3/directive/with.hpp index 153c236b22..a092d35c35 100644 --- a/boost/spirit/home/x3/directive/with.hpp +++ b/boost/spirit/home/x3/directive/with.hpp @@ -21,18 +21,18 @@ namespace boost { namespace spirit { namespace x3 { typedef unary_parser<Subject, Derived> base_type; mutable T val; - with_value_holder(Subject const& subject, T const& val) + with_value_holder(Subject const& subject, T&& val) : base_type(subject) - , val(val) {} + , val(std::forward<T>(val)) {} }; template <typename Subject, typename Derived, typename T> - struct with_value_holder<Subject, Derived, T const> + struct with_value_holder<Subject, Derived, T&> : unary_parser<Subject, Derived> { typedef unary_parser<Subject, Derived> base_type; - T val; - with_value_holder(Subject const& subject, T const& val) + T& val; + with_value_holder(Subject const& subject, T& val) : base_type(subject) , val(val) {} }; @@ -47,8 +47,8 @@ namespace boost { namespace spirit { namespace x3 typedef Subject subject_type; - with_directive(Subject const& subject, T const& val) - : base_type(subject, val) {} + with_directive(Subject const& subject, T&& val) + : base_type(subject, std::forward<T>(val)) {} template <typename Iterator, typename Context , typename RContext, typename Attribute> @@ -63,44 +63,23 @@ namespace boost { namespace spirit { namespace x3 } }; - template <typename ID, typename T, typename NextContext = unused_type> - struct with_context - { - typedef context<ID, T, NextContext> type; - }; - - template <typename ID, typename T> - struct with_context<ID, T, unused_type> - { - typedef context<ID, T> type; - }; - template <typename ID, typename T> struct with_gen { - T& val; - - with_gen(T& val) - : val(val) {} + T&& val; template <typename Subject> with_directive<typename extension::as_parser<Subject>::value_type, ID, T> operator[](Subject const& subject) const { - return { as_parser(subject), val }; + return { as_parser(subject), std::forward<T>(val) }; } }; template <typename ID, typename T> - inline with_gen<ID, T> with(T& val) - { - return { val }; - } - - template <typename ID, typename T> - inline with_gen<ID, T const> with(T const& val) + inline with_gen<ID, T> with(T&& val) { - return { val }; + return { std::forward<T>(val) }; } }}} |