summaryrefslogtreecommitdiff
path: root/boost/spirit/home/x3/operator/alternative.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/x3/operator/alternative.hpp')
-rw-r--r--boost/spirit/home/x3/operator/alternative.hpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/boost/spirit/home/x3/operator/alternative.hpp b/boost/spirit/home/x3/operator/alternative.hpp
index 1566780bc6..c3a1e40f3f 100644
--- a/boost/spirit/home/x3/operator/alternative.hpp
+++ b/boost/spirit/home/x3/operator/alternative.hpp
@@ -7,10 +7,6 @@
#if !defined(SPIRIT_ALTERNATIVE_JAN_07_2013_1131AM)
#define SPIRIT_ALTERNATIVE_JAN_07_2013_1131AM
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/operator/detail/alternative.hpp>
@@ -22,7 +18,7 @@ namespace boost { namespace spirit { namespace x3
{
typedef binary_parser<Left, Right, alternative<Left, Right>> base_type;
- alternative(Left left, Right right)
+ alternative(Left const& left, Right const& right)
: base_type(left, right) {}
template <typename Iterator, typename Context, typename RContext>
@@ -40,11 +36,8 @@ namespace boost { namespace spirit { namespace x3
Iterator& first, Iterator const& last
, Context const& context, RContext& rcontext, Attribute& attr) const
{
- if (detail::parse_alternative(this->left, first, last, context, rcontext, attr))
- return true;
- if (detail::parse_alternative(this->right, first, last, context, rcontext, attr))
- return true;
- return false;
+ return detail::parse_alternative(this->left, first, last, context, rcontext, attr)
+ || detail::parse_alternative(this->right, first, last, context, rcontext, attr);
}
};
@@ -54,7 +47,7 @@ namespace boost { namespace spirit { namespace x3
, typename extension::as_parser<Right>::value_type>
operator|(Left const& left, Right const& right)
{
- return {as_parser(left), as_parser(right)};
+ return { as_parser(left), as_parser(right) };
}
}}}