|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55208 - in trunk/boost/spirit: home/karma/directive home/karma/stream home/lex/lexer/lexertl home/support home/support/algorithm home/support/detail repository/home/qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-30 14:43:29
Author: hkaiser
Date: 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
New Revision: 55208
URL: http://svn.boost.org/trac/boost/changeset/55208
Log:
Spirit: fixing compilation errors, changed metafunctions to use metafunction forwarding where possible
Text files modified:
trunk/boost/spirit/home/karma/directive/left_alignment.hpp | 4 ++--
trunk/boost/spirit/home/karma/stream/stream.hpp | 6 ++----
trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp | 8 +++-----
trunk/boost/spirit/home/support/algorithm/any_if.hpp | 12 +++---------
trunk/boost/spirit/home/support/attributes.hpp | 29 ++++++++++-------------------
trunk/boost/spirit/home/support/container.hpp | 6 ++----
trunk/boost/spirit/home/support/detail/make_cons.hpp | 18 +++++-------------
trunk/boost/spirit/home/support/terminal.hpp | 15 +++++++--------
trunk/boost/spirit/repository/home/qi/distinct.hpp | 7 +++----
9 files changed, 37 insertions(+), 68 deletions(-)
Modified: trunk/boost/spirit/home/karma/directive/left_alignment.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/left_alignment.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/left_alignment.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -225,9 +225,9 @@
template <typename Terminal>
result_type operator()(Terminal const& term, Subject const& subject
- , Modifiers const& modifiers) const
+ , unused_type) const
{
- return result_type(subject, fusion::at_c<0>(term.args), modifiers);
+ return result_type(subject, fusion::at_c<0>(term.args));
}
};
Modified: trunk/boost/spirit/home/karma/stream/stream.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/stream/stream.hpp (original)
+++ trunk/boost/spirit/home/karma/stream/stream.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -161,10 +161,8 @@
: primitive_generator<any_stream_generator<T, Char, CharEncoding, Tag> >
{
template <typename Context, typename Unused>
- struct attribute
- {
- typedef typename remove_const<T>::type type;
- };
+ struct attribute : remove_const<T>
+ {};
any_stream_generator(typename add_reference<T>::type t)
: t_(t)
Modified: trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -273,13 +273,11 @@
///////////////////////////////////////////////////////////////////////
template <typename IteratorPair, typename AttributeTypes>
struct token_value_type
- {
- typedef typename mpl::eval_if<
+ : mpl::eval_if<
is_same<AttributeTypes, mpl::vector0<> >
, mpl::identity<IteratorPair>
- , token_value_typesequence<IteratorPair, AttributeTypes>
- >::type type;
- };
+ , token_value_typesequence<IteratorPair, AttributeTypes> >
+ {};
}
template <typename Iterator, typename AttributeTypes, typename HasState>
Modified: trunk/boost/spirit/home/support/algorithm/any_if.hpp
==============================================================================
--- trunk/boost/spirit/home/support/algorithm/any_if.hpp (original)
+++ trunk/boost/spirit/home/support/algorithm/any_if.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -40,15 +40,9 @@
{
///////////////////////////////////////////////////////////////////////
template <typename Iterator, typename Pred>
- struct apply_predicate
- {
- typedef typename
- mpl::apply1<
- Pred,
- typename fusion::result_of::value_of<Iterator>::type
- >::type
- type;
- };
+ struct apply_predicate
+ : mpl::apply1<Pred, typename fusion::result_of::value_of<Iterator>::type>
+ {};
///////////////////////////////////////////////////////////////////////
// if the predicate is true, attribute_next returns next(Iterator2),
Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -96,16 +96,11 @@
// the attribute in a tuple only IFF it is not already a fusion tuple.
///////////////////////////////////////////////////////////////////////////
template <typename Attribute>
- struct wrap_if_not_tuple
- {
- typedef typename
- mpl::if_<
- fusion::traits::is_sequence<Attribute>
- , Attribute&
- , fusion::vector1<Attribute&>
- >::type
- type;
- };
+ struct wrap_if_not_tuple
+ : mpl::if_<
+ fusion::traits::is_sequence<Attribute>
+ , Attribute&, fusion::vector1<Attribute&> >
+ {};
template <>
struct wrap_if_not_tuple<unused_type>
@@ -158,17 +153,13 @@
//
// Remove unused_types from a sequence
///////////////////////////////////////////////////////////////////////////
+
+ // Compute the list of all *used* attributes of sub-components
+ // (filter all unused attributes from the list)
template <typename Sequence>
struct filter_unused_attributes
- {
- // Compute the list of all *used* attributes of sub-components
- // (filter all unused attributes from the list)
- typedef typename fusion::result_of::filter_if<
- Sequence
- , is_not_unused<mpl::_>
- >::type
- type;
- };
+ : fusion::result_of::filter_if<Sequence, is_not_unused<mpl::_> >
+ {};
///////////////////////////////////////////////////////////////////////////
// build_fusion_vector
Modified: trunk/boost/spirit/home/support/container.hpp
==============================================================================
--- trunk/boost/spirit/home/support/container.hpp (original)
+++ trunk/boost/spirit/home/support/container.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -73,10 +73,8 @@
};
template <typename T>
- struct remove_value_const<T const>
- {
- typedef typename remove_value_const<T>::type type;
- };
+ struct remove_value_const<T const> : remove_value_const<T>
+ {};
template <typename F, typename S>
struct remove_value_const<std::pair<F, S> >
Modified: trunk/boost/spirit/home/support/detail/make_cons.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/make_cons.hpp (original)
+++ trunk/boost/spirit/home/support/detail/make_cons.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -24,21 +24,13 @@
{
template <typename T>
struct as_meta_element
- {
- typedef typename
- mpl::eval_if_c<is_abstract<T>::value || is_function<T>::value
- , add_reference<T>
- , remove_const<T>
- >::type
- type;
- };
+ : mpl::eval_if_c<is_abstract<T>::value || is_function<T>::value
+ , add_reference<T>, remove_const<T> >
+ {};
template <typename T>
- struct as_meta_element<T&>
- {
- // always store by value
- typedef typename as_meta_element<T>::type type;
- };
+ struct as_meta_element<T&> : as_meta_element<T> // always store by value
+ {};
template <typename T, int N>
struct as_meta_element<T[N]>
Modified: trunk/boost/spirit/home/support/terminal.hpp
==============================================================================
--- trunk/boost/spirit/home/support/terminal.hpp (original)
+++ trunk/boost/spirit/home/support/terminal.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -192,14 +192,14 @@
// to_lazy_arg: convert a terminal arg type to the type make_lazy needs
template <typename A>
struct to_lazy_arg
- {
- // wrap A in a Phoenix actor if not already one
- typedef typename phoenix::as_actor<A>::type type;
- };
+ : phoenix::as_actor<A> // wrap A in a Phoenix actor if not already one
+ {};
+
template <typename A>
struct to_lazy_arg<const A>
: to_lazy_arg<A>
{};
+
template <>
struct to_lazy_arg<unused_type>
{
@@ -214,10 +214,12 @@
// identity
typedef A type;
};
+
template <typename A>
struct to_nonlazy_arg<const A>
: to_nonlazy_arg<A>
{};
+
template <>
struct to_nonlazy_arg<unused_type>
{
@@ -398,15 +400,12 @@
///////////////////////////////////////////////////////////////////////////
namespace result_of
{
- template <typename Sig>
- struct terminal;
-
// Calculate the type of the compound terminal if generated by one of
// the spirit::terminal::operator() overloads above
// The terminal type itself is passed through without modification
template <typename Tag>
- struct terminal<Tag()>
+ struct terminal
{
typedef spirit::terminal<Tag> type;
};
Modified: trunk/boost/spirit/repository/home/qi/distinct.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/qi/distinct.hpp (original)
+++ trunk/boost/spirit/repository/home/qi/distinct.hpp 2009-07-27 14:51:30 EDT (Mon, 27 Jul 2009)
@@ -64,10 +64,9 @@
: spirit::qi::unary_parser<distinct_parser<Subject, Tail, Modifier> >
{
template <typename Context, typename Iterator>
- struct attribute
- {
- typedef typename traits::attribute_of<Subject>::type type;
- };
+ struct attribute
+ : traits::attribute_of<Subject>
+ {};
distinct_parser(Subject const& subject, Tail const& tail)
: subject(subject), tail(tail) {}
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