|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2007-12-19 16:59:10
Author: eric_niebler
Date: 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
New Revision: 42179
URL: http://svn.boost.org/trac/boost/changeset/42179
Log:
remove hacks no longer necessary because gcc fixed bug #33965
Text files modified:
branches/proto/v3/boost/xpressive/detail/static/grammar.hpp | 15 +++++-------
branches/proto/v3/boost/xpressive/proto/detail/is_callable.hpp | 2 -
branches/proto/v3/boost/xpressive/proto/traits.hpp | 6 -----
branches/proto/v3/boost/xpressive/proto/transform/make.hpp | 46 ++++++++++++++++++++--------------------
branches/proto/v3/boost/xpressive/regex_primitives.hpp | 3 -
branches/proto/v3/libs/xpressive/proto/example/calc3.cpp | 9 ++-----
branches/proto/v3/libs/xpressive/proto/example/vec3.cpp | 3 -
branches/proto/v3/libs/xpressive/proto/test/examples.cpp | 18 ++++++---------
branches/proto/v3/libs/xpressive/proto/test/lambda.cpp | 6 +---
branches/proto/v3/libs/xpressive/proto/test/main.cpp | 11 +++------
10 files changed, 47 insertions(+), 72 deletions(-)
Modified: branches/proto/v3/boost/xpressive/detail/static/grammar.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/detail/static/grammar.hpp (original)
+++ branches/proto/v3/boost/xpressive/detail/static/grammar.hpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -322,9 +322,6 @@
: proto::terminal<char>
{};
- struct _zero : mpl::int_<0> {};
- struct _one : mpl::int_<1> {};
-
///////////////////////////////////////////////////////////////////////////
// ListSet
// matches expressions like (set= 'a','b','c')
@@ -338,7 +335,7 @@
>
, when<
proto::assign<terminal<set_initializer>, CharLiteral<Char> >
- , _one()
+ , mpl::int_<1>()
>
>
{};
@@ -550,10 +547,10 @@
struct MaxAttr
: or_<
when< terminal<attribute_placeholder<_> >, attr_number<_arg>() >
- , when< terminal<_>, _zero() >
+ , when< terminal<_>, mpl::int_<0>() >
// Ignore nested actions, because attributes are scoped:
- , when< subscript<_, _>, _zero() >
- , otherwise< fold<_, _zero(), mpl::max<MaxAttr, _state>() > >
+ , when< subscript<_, _>, mpl::int_<0>() >
+ , otherwise< fold<_, mpl::int_<0>(), mpl::max<MaxAttr, _state>() > >
>
{};
@@ -668,8 +665,8 @@
_
, repeat_end_matcher<Greedy>(
mark_number(_arg(_left))
- , always<min_type<Tag> > // min_type<Tag>()
- , always<max_type<Tag> > // max_type<Tag>()
+ , min_type<Tag>()
+ , max_type<Tag>()
)
)
)
Modified: branches/proto/v3/boost/xpressive/proto/detail/is_callable.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/detail/is_callable.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/detail/is_callable.hpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -43,8 +43,6 @@
: back<Rest...>
{};
- // TODO when gcc #33965 is fixed, change the idiom to
- // template<typename X, bool IsTransform = true> struct my_transform {...};
template<
template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename BOOST_PP_INTERCEPT), typename...> class T
, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
Modified: branches/proto/v3/boost/xpressive/proto/traits.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/traits.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/traits.hpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -621,12 +621,6 @@
: proto::detail::is_callable_<T>
{};
- // work around GCC bug
- template<typename Tag, typename Args, long N>
- struct is_callable<expr<Tag, Args, N> >
- : mpl::false_
- {};
-
template<>
struct is_callable<callable>
: mpl::false_
Modified: branches/proto/v3/boost/xpressive/proto/transform/make.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/make.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/make.hpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -99,13 +99,13 @@
>::type>
{};
- // work around GCC bug
- template<typename Tag, typename Args, long N, typename Expr, typename State, typename Visitor>
- struct make_if_<expr<Tag, Args, N>, Expr, State, Visitor, false>
- {
- typedef expr<Tag, Args, N> type;
- typedef void not_applied_;
- };
+ //// work around GCC bug
+ //template<typename Tag, typename Args, long N, typename Expr, typename State, typename Visitor>
+ //struct make_if_<expr<Tag, Args, N>, Expr, State, Visitor, false>
+ //{
+ // typedef expr<Tag, Args, N> type;
+ // typedef void not_applied_;
+ //};
template<typename Type, bool IsAggregate = is_aggregate<Type>::value>
struct construct_
@@ -176,22 +176,22 @@
}
};
- // work around gcc bug
- template<typename T, typename A, long N, typename... Args>
- struct make<expr<T, A, N>, Args...> : callable
- {
- template<typename Sig>
- struct result
- {
- typedef expr<T, A, N> type;
- };
-
- template<typename Expr, typename State, typename Visitor>
- expr<T, A, N> operator()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- return proto::expr<T, A, N>::make(when<_, Args>()(expr, state, visitor)...);
- }
- };
+ //// work around gcc bug
+ //template<typename T, typename A, long N, typename... Args>
+ //struct make<expr<T, A, N>, Args...> : callable
+ //{
+ // template<typename Sig>
+ // struct result
+ // {
+ // typedef expr<T, A, N> type;
+ // };
+
+ // template<typename Expr, typename State, typename Visitor>
+ // expr<T, A, N> operator()(Expr const &expr, State const &state, Visitor &visitor) const
+ // {
+ // return proto::expr<T, A, N>::make(when<_, Args>()(expr, state, visitor)...);
+ // }
+ //};
template<typename Fun, typename... Args>
struct make<Fun(Args...)>
Modified: branches/proto/v3/boost/xpressive/regex_primitives.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/regex_primitives.hpp (original)
+++ branches/proto/v3/boost/xpressive/regex_primitives.hpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -64,14 +64,13 @@
}
};
- struct negative_one : mpl::int_<-1> {};
using grammar_detail::mark_number;
// s1 or -s1
struct SubMatch
: proto::or_<
proto::when<basic_mark_tag, push_back(proto::_visitor, mark_number(proto::_arg)) >
- , proto::when<proto::negate<basic_mark_tag>, push_back(proto::_visitor, negative_one()) >
+ , proto::when<proto::negate<basic_mark_tag>, push_back(proto::_visitor, mpl::int_<-1>()) >
>
{};
Modified: branches/proto/v3/libs/xpressive/proto/example/calc3.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/example/calc3.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/example/calc3.cpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -21,9 +21,6 @@
// Will be used to define the placeholders _1 and _2
template<typename I> struct arg : I {};
-// needed only to work around a gcc bug.
-struct zero : mpl::int_<0> {};
-
using proto::_;
using namespace proto::transform;
@@ -40,12 +37,12 @@
when< proto::terminal< arg<_> >, _arg >
// Any other terminals have arity 0 ...
- , when< proto::terminal<_>, zero() >
+ , when< proto::terminal<_>, mpl::int_<0>() >
// For any non-terminals, find the arity of the children and
// take the maximum. This is recursive.
, when< proto::nary_expr<_, proto::vararg<_> >
- , fold<_, zero(), mpl::max<CalculatorGrammar, _state>() > >
+ , fold<_, mpl::int_<0>(), mpl::max<CalculatorGrammar, _state>() > >
>
{};
@@ -55,7 +52,7 @@
// is not used, is mpl::void_.
template<typename Expr>
struct calculator_arity
- : boost::result_of<CalculatorGrammar(Expr, zero, mpl::void_)>
+ : boost::result_of<CalculatorGrammar(Expr, mpl::int_<0>, mpl::void_)>
{};
// For expressions in the calculator domain, operator()
Modified: branches/proto/v3/libs/xpressive/proto/example/vec3.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/example/vec3.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/example/vec3.cpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -61,7 +61,6 @@
int count;
};
-struct one : mpl::int_<1> {};
struct iplus : std::plus<int>, callable {};
// Here is a transform that does the same thing as the above context.
@@ -72,7 +71,7 @@
struct CountLeaves
: or_<
// match a Vec3 terminal, return 1
- when<terminal<int[3]>, one() >
+ when<terminal<int[3]>, mpl::int_<1>() >
// match a terminal, return int() (which is 0)
, when<terminal<_>, int() >
// fold everything else, using std::plus<> to add
Modified: branches/proto/v3/libs/xpressive/proto/test/examples.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/test/examples.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/test/examples.cpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -94,7 +94,7 @@
// A custom transform that returns the arity of a binary
// calculator expression by finding the maximum of the
-// arities of the two children expressions.
+// arities of the mpl::int_<2> children expressions.
struct binary_arity
/*<< All custom transforms should inherit from
callable. In some cases, (e.g., when the transform
@@ -134,19 +134,15 @@
};
//]
-struct zero : mpl::int_<0> {};
-struct one : mpl::int_<1> {};
-struct two : mpl::int_<2> {};
-
terminal< placeholder1 >::type const _1 = {{}};
terminal< placeholder2 >::type const _2 = {{}};
//[ CalculatorArityGrammar
struct CalculatorArity
: or_<
- when< terminal< placeholder1 >, one() >
- , when< terminal< placeholder2 >, two() >
- , when< terminal<_>, zero() >
+ when< terminal< placeholder1 >, mpl::int_<1>() >
+ , when< terminal< placeholder2 >, mpl::int_<2>() >
+ , when< terminal<_>, mpl::int_<0>() >
, when< unary_expr<_, _>, unary_arity >
, when< binary_expr<_, _, _>, binary_arity >
>
@@ -156,9 +152,9 @@
//[ CalculatorArityGrammar2
struct CalcArity2
: or_<
- when< terminal< placeholder1 >, one() >
- , when< terminal< placeholder2 >, two() >
- , when< terminal<_>, zero() >
+ when< terminal< placeholder1 >, mpl::int_<1>() >
+ , when< terminal< placeholder2 >, mpl::int_<2>() >
+ , when< terminal<_>, mpl::int_<0>() >
, when< unary_expr<_, CalcArity2>, CalcArity2(_arg) >
, when< binary_expr<_, CalcArity2, CalcArity2>, mpl::max<CalcArity2(_left), CalcArity2(_right)>() >
>
Modified: branches/proto/v3/libs/xpressive/proto/test/lambda.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/test/lambda.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/test/lambda.cpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -53,8 +53,6 @@
typedef typename T::arity type;
};
-struct zero : mpl::int_<0> {};
-
namespace grammar
{
using namespace proto;
@@ -64,8 +62,8 @@
struct Lambda
: or_<
when< terminal< placeholder<_> >, mpl::next<placeholder_arity<_arg> >() >
- , when< terminal<_>, zero() >
- , when< nary_expr<_, vararg<_> >, fold<_, zero(), mpl::max<Lambda,_state>()> >
+ , when< terminal<_>, mpl::int_<0>() >
+ , when< nary_expr<_, vararg<_> >, fold<_, mpl::int_<0>(), mpl::max<Lambda,_state>()> >
>
{};
}
Modified: branches/proto/v3/libs/xpressive/proto/test/main.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/test/main.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/test/main.cpp 2007-12-19 16:59:09 EST (Wed, 19 Dec 2007)
@@ -99,11 +99,8 @@
struct placeholder : Int
{};
-struct zero : mpl::int_<0> {};
-struct one : mpl::int_<1> {};
-struct two : mpl::int_<2> {};
-terminal<placeholder<one> >::type const _1 = {};
-terminal<placeholder<two> >::type const _2 = {};
+terminal<placeholder<mpl::int_<1> > >::type const _1 = {};
+terminal<placeholder<mpl::int_<2> > >::type const _2 = {};
struct Arity
: or_<
@@ -111,10 +108,10 @@
, _arg
>
, when< terminal<_>
- , zero()
+ , mpl::int_<0>()
>
, when< nary_expr<_, vararg<Arity> >
- , fold<_, zero(), mpl::max<Arity, _state>() >
+ , fold<_, mpl::int_<0>(), mpl::max<Arity, _state>() >
>
>
{};
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk