|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71646 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/date_time boost/date_time/posix_time boost/detail boost/filesystem boost/function boost/functional boost/functional/hash boost/fusion boost/fusion/container/list/detail boost/geometry boost/geometry/algorithms boost/geometry/arithmetic boost/geometry/core boost/geometry/domains boost/geometry/geometries boost/geometry/iterators boost/geometry/multi boost/geometry/policies boost/geometry/ranges boost/geometry/strategies boost/geometry/util boost/geometry/views boost/gil boost/graph boost/icl boost/integer boost/interprocess boost/intrusive boost/io boost/iostreams boost/iterator boost/math boost/msm boost/numeric/ublas boost/pool boost/program_options boost/program_options/detail boost/property_tree boost/python boost/range boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/statechart boost/system boost/thread boost/tr1 boost/type_traits boost/typeof boost/unordered boost/utility boost/uuid boost/variant boost/wave boost/xpressive boost/xpressive/detail boost/xpressive/detail/core doc libs libs/algorithm/string libs/array libs/array/test libs/bimap libs/config libs/date_time libs/date_time/data libs/date_time/example/gregorian libs/date_time/example/local_time libs/date_time/example/posix_time libs/date_time/example/tutorial libs/date_time/test/posix_time libs/date_time/xmldoc libs/detail libs/filesystem libs/function libs/functional libs/functional/hash libs/fusion libs/geometry libs/geometry/doc libs/geometry/doc/concept libs/geometry/doc/doxy libs/geometry/doc/generated libs/geometry/doc/html libs/geometry/doc/reference libs/geometry/doc/src libs/geometry/example libs/geometry/test libs/graph/doc libs/graph_parallel libs/icl libs/icl/doc libs/icl/doc/html libs/icl/doc/html/header/boost/icl libs/icl/test libs/icl/test/test_doc_code_ libs/integer libs/interprocess libs/intrusive libs/io libs/io/doc libs/iostreams libs/iterator libs/math libs/math/doc/sf_and_dist libs/math/doc/sf_and_dist/html/math_toolkit/main_overview libs/mpi/build libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/numeric/ublas libs/numeric/ublas/doc libs/parameter/doc/html libs/phoenix/doc libs/phoenix/doc/examples libs/pool libs/program_options libs/program_options/test libs/property_tree libs/python libs/range libs/regex libs/serialization libs/serialization/example libs/serialization/src libs/serialization/test libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/typeof/doc libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave libs/xpressive/test more status tools tools/bcp tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/quickbook/doc tools/quickbook/src tools/quickbook/test tools/regression tools/regression/src tools/release tools/wave
From: eric_at_[hidden]
Date: 2011-05-01 06:04:05
Author: eric_niebler
Date: 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
New Revision: 71646
URL: http://svn.boost.org/trac/boost/changeset/71646
Log:
[71536] merged from trunk
Properties modified:
branches/release/ (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/algorithm/string/ (props changed)
branches/release/boost/archive/ (props changed)
branches/release/boost/array.hpp (props changed)
branches/release/boost/bimap/ (props changed)
branches/release/boost/concept_check.hpp (props changed)
branches/release/boost/config/ (props changed)
branches/release/boost/config.hpp (props changed)
branches/release/boost/cregex.hpp (props changed)
branches/release/boost/cstdint.hpp (props changed)
branches/release/boost/date_time/c_time.hpp (props changed)
branches/release/boost/date_time/gregorian_calendar.ipp (props changed)
branches/release/boost/date_time/posix_time/time_serialize.hpp (props changed)
branches/release/boost/date_time/strings_from_facet.hpp (props changed)
branches/release/boost/date_time/time_facet.hpp (props changed)
branches/release/boost/detail/ (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/filesystem.hpp (props changed)
branches/release/boost/function/ (props changed)
branches/release/boost/functional/ (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/fusion/container/list/detail/build_cons.hpp (props changed)
branches/release/boost/geometry/ (props changed)
branches/release/boost/geometry/algorithms/ (props changed)
branches/release/boost/geometry/arithmetic/ (props changed)
branches/release/boost/geometry/core/ (props changed)
branches/release/boost/geometry/domains/ (props changed)
branches/release/boost/geometry/geometries/ (props changed)
branches/release/boost/geometry/geometry.hpp (props changed)
branches/release/boost/geometry/iterators/ (props changed)
branches/release/boost/geometry/multi/ (props changed)
branches/release/boost/geometry/policies/ (props changed)
branches/release/boost/geometry/ranges/ (props changed)
branches/release/boost/geometry/strategies/ (props changed)
branches/release/boost/geometry/util/ (props changed)
branches/release/boost/geometry/views/ (props changed)
branches/release/boost/gil/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/icl/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/integer.hpp (props changed)
branches/release/boost/integer_fwd.hpp (props changed)
branches/release/boost/integer_traits.hpp (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/io/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/iterator/ (props changed)
branches/release/boost/iterator/iterator_facade.hpp (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/math_fwd.hpp (props changed)
branches/release/boost/msm/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/numeric/ublas/functional.hpp (props changed)
branches/release/boost/pool/ (props changed)
branches/release/boost/program_options/ (props changed)
branches/release/boost/program_options/detail/parsers.hpp (props changed)
branches/release/boost/program_options/parsers.hpp (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/python/ (props changed)
branches/release/boost/range/ (props changed)
branches/release/boost/regex/ (props changed)
branches/release/boost/regex.h (props changed)
branches/release/boost/regex.hpp (props changed)
branches/release/boost/regex_fwd.hpp (props changed)
branches/release/boost/serialization/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/signals2.hpp (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/statechart/ (props changed)
branches/release/boost/static_assert.hpp (props changed)
branches/release/boost/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/token_functions.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/typeof/message.hpp (props changed)
branches/release/boost/typeof/register_functions.hpp (props changed)
branches/release/boost/typeof/register_functions_iterate.hpp (props changed)
branches/release/boost/typeof/typeof.hpp (props changed)
branches/release/boost/typeof/unsupported.hpp (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/algorithm/string/ (props changed)
branches/release/libs/array/ (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/array/test/array2.cpp (props changed)
branches/release/libs/array/test/array6.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/date_time/ (props changed)
branches/release/libs/date_time/data/date_time_zonespec.csv (props changed)
branches/release/libs/date_time/example/gregorian/days_between_new_years.cpp (props changed)
branches/release/libs/date_time/example/gregorian/days_since_year_start.cpp (props changed)
branches/release/libs/date_time/example/gregorian/days_till_new_year.cpp (props changed)
branches/release/libs/date_time/example/gregorian/month_add.cpp (props changed)
branches/release/libs/date_time/example/local_time/flight.cpp (props changed)
branches/release/libs/date_time/example/local_time/local_date_time.cpp (props changed)
branches/release/libs/date_time/example/posix_time/print_hours.cpp (props changed)
branches/release/libs/date_time/example/posix_time/time_math.cpp (props changed)
branches/release/libs/date_time/example/tutorial/io_tutorial.cpp (props changed)
branches/release/libs/date_time/test/posix_time/testtime_facet.cpp (props changed)
branches/release/libs/date_time/test/posix_time/testtime_input_facet.cpp (props changed)
branches/release/libs/date_time/xmldoc/date_class.xml (props changed)
branches/release/libs/date_time/xmldoc/usage_examples.xml (props changed)
branches/release/libs/detail/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/function/ (props changed)
branches/release/libs/functional/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/geometry/ (props changed)
branches/release/libs/geometry/doc/ (props changed)
branches/release/libs/geometry/doc/Jamfile.v2 (props changed)
branches/release/libs/geometry/doc/about_documentation.qbk (props changed)
branches/release/libs/geometry/doc/acknowledgments.qbk (props changed)
branches/release/libs/geometry/doc/concept/ (props changed)
branches/release/libs/geometry/doc/copyright_note_policy.txt (props changed)
branches/release/libs/geometry/doc/design_rationale.qbk (props changed)
branches/release/libs/geometry/doc/doxy/ (props changed)
branches/release/libs/geometry/doc/generated/ (props changed)
branches/release/libs/geometry/doc/geometry.qbk (props changed)
branches/release/libs/geometry/doc/html/ (props changed)
branches/release/libs/geometry/doc/imports.qbk (props changed)
branches/release/libs/geometry/doc/introduction.qbk (props changed)
branches/release/libs/geometry/doc/make_qbk.py (props changed)
branches/release/libs/geometry/doc/matrix.qbk (props changed)
branches/release/libs/geometry/doc/quickref.xml (props changed)
branches/release/libs/geometry/doc/quickstart.qbk (props changed)
branches/release/libs/geometry/doc/readme.txt (props changed)
branches/release/libs/geometry/doc/reference/ (props changed)
branches/release/libs/geometry/doc/reference.qbk (props changed)
branches/release/libs/geometry/doc/src/ (props changed)
branches/release/libs/geometry/example/ (props changed)
branches/release/libs/geometry/index.html (props changed)
branches/release/libs/geometry/test/ (props changed)
branches/release/libs/graph/doc/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/icl/ (props changed)
branches/release/libs/icl/doc/ (props changed)
branches/release/libs/icl/doc/html/ (props changed)
branches/release/libs/icl/doc/html/header/boost/icl/ (props changed)
branches/release/libs/icl/test/ (props changed)
branches/release/libs/icl/test/test_doc_code_/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/io/ (props changed)
branches/release/libs/io/doc/ (props changed)
branches/release/libs/iostreams/ (props changed)
branches/release/libs/iterator/ (props changed)
branches/release/libs/libraries.htm (props changed)
branches/release/libs/maintainers.txt (props changed)
branches/release/libs/math/ (props changed)
branches/release/libs/math/doc/sf_and_dist/faq.qbk (props changed)
branches/release/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/faq.html (props changed)
branches/release/libs/mpi/build/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/msm/ (props changed)
branches/release/libs/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/parameter/doc/html/index.html (props changed)
branches/release/libs/phoenix/doc/basics.qbk (props changed)
branches/release/libs/phoenix/doc/examples/extending_actors.qbk (props changed)
branches/release/libs/phoenix/doc/organisation.qbk (props changed)
branches/release/libs/pool/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/program_options/test/parsers_test.cpp (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/python/ (props changed)
branches/release/libs/range/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/serialization/example/ (props changed)
branches/release/libs/serialization/src/ (props changed)
branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/statechart/ (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/typeof/doc/typeof.qbk (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/ (props changed)
branches/release/libs/utility/assert.html (props changed)
branches/release/libs/utility/assert_test.cpp (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
branches/release/libs/utility/value_init.htm (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/uuid/ (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/status/Jamfile.v2 (props changed)
branches/release/status/explicit-failures-markup.xml (props changed)
branches/release/tools/ (props changed)
branches/release/tools/bcp/ (props changed)
branches/release/tools/boostbook/ (props changed)
branches/release/tools/build/v2/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/quickbook/doc/ (props changed)
branches/release/tools/quickbook/src/ (props changed)
branches/release/tools/quickbook/test/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/regression/src/library_status.cpp (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
Text files modified:
branches/release/boost/xpressive/detail/core/adaptor.hpp | 2
branches/release/boost/xpressive/detail/detail_fwd.hpp | 3
branches/release/boost/xpressive/match_results.hpp | 4
branches/release/boost/xpressive/regex_actions.hpp | 140 +++++++++++++++++++++++++++++----------
branches/release/boost/xpressive/xpressive_fwd.hpp | 34 +++++++++
branches/release/libs/xpressive/test/test_actions.cpp | 21 ++++++
6 files changed, 161 insertions(+), 43 deletions(-)
Modified: branches/release/boost/xpressive/detail/core/adaptor.hpp
==============================================================================
--- branches/release/boost/xpressive/detail/core/adaptor.hpp (original)
+++ branches/release/boost/xpressive/detail/core/adaptor.hpp 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
@@ -49,7 +49,7 @@
virtual bool match(match_state<iterator_type> &state) const
{
- typedef typename unwrap_reference<Xpr const>::type xpr_type;
+ typedef typename boost::unwrap_reference<Xpr const>::type xpr_type;
return implicit_cast<xpr_type &>(this->xpr_).match(state);
}
Modified: branches/release/boost/xpressive/detail/detail_fwd.hpp
==============================================================================
--- branches/release/boost/xpressive/detail/detail_fwd.hpp (original)
+++ branches/release/boost/xpressive/detail/detail_fwd.hpp 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
@@ -42,8 +42,7 @@
struct action_context;
- template<typename BidiIter>
- struct replacement_context;
+ struct ReplaceAlgo;
///////////////////////////////////////////////////////////////////////////////
// placeholders
Modified: branches/release/boost/xpressive/match_results.hpp
==============================================================================
--- branches/release/boost/xpressive/match_results.hpp (original)
+++ branches/release/boost/xpressive/match_results.hpp 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
@@ -62,7 +62,6 @@
#ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
# include <boost/proto/proto_fwd.hpp>
# include <boost/proto/traits.hpp>
-# include <boost/proto/eval.hpp>
#endif
namespace boost { namespace xpressive { namespace detail
@@ -939,8 +938,7 @@
, mpl::size_t<4>
) const
{
- detail::replacement_context<BidiIter> ctx(*this);
- return this->format2_(out, proto::eval(format, ctx));
+ return this->format2_(out, detail::ReplaceAlgo()(format, 0, *this));
}
/// INTERNAL ONLY
Modified: branches/release/boost/xpressive/regex_actions.hpp
==============================================================================
--- branches/release/boost/xpressive/regex_actions.hpp (original)
+++ branches/release/boost/xpressive/regex_actions.hpp 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
@@ -42,8 +42,8 @@
// Doxygen can't handle proto :-(
#ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
-# include <boost/proto/transform/arg.hpp>
-# include <boost/proto/transform/when.hpp>
+# include <boost/proto/core.hpp>
+# include <boost/proto/transform.hpp>
# include <boost/xpressive/detail/core/matcher/action_matcher.hpp>
#endif
@@ -112,8 +112,9 @@
struct check_tag
{};
- struct BindArg : proto::callable
+ struct BindArg
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
@@ -164,61 +165,51 @@
BindArgs()(args, 0, what);
}
- template<typename BidiIter>
- struct replacement_context
- : proto::callable_context<replacement_context<BidiIter> const>
- {
- replacement_context(match_results<BidiIter> const &what)
- : what_(what)
- {}
+ typedef boost::proto::functional::make_expr<proto::tag::function, proto::default_domain> make_function;
+ }
+ namespace op
+ {
+ struct at
+ {
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
- template<typename This>
- struct result<This(proto::tag::terminal, mark_placeholder const &)>
+ template<typename This, typename Cont, typename Idx>
+ struct result<This(Cont, Idx)>
+ : result<This(Cont const &, Idx)>
{
- typedef sub_match<BidiIter> const &type;
};
- template<typename This>
- struct result<This(proto::tag::terminal, any_matcher const &)>
+ template<typename This, typename Cont, typename Idx>
+ struct result<This(Cont &, Idx)>
{
- typedef sub_match<BidiIter> const &type;
+ typedef typename Cont::reference type;
};
- template<typename This, typename T>
- struct result<This(proto::tag::terminal, reference_wrapper<T> const &)>
+ template<typename This, typename Cont, typename Idx>
+ struct result<This(Cont const &, Idx)>
{
- typedef T &type;
+ typedef typename Cont::const_reference type;
};
- sub_match<BidiIter> const &operator ()(proto::tag::terminal, mark_placeholder m) const
- {
- return this->what_[m.mark_number_];
- }
-
- sub_match<BidiIter> const &operator ()(proto::tag::terminal, any_matcher) const
+ template<typename Cont, typename Idx>
+ typename Cont::reference operator()(Cont &c, Idx idx BOOST_PROTO_DISABLE_IF_IS_CONST(Cont)) const
{
- return this->what_[0];
+ return c[idx];
}
- template<typename T>
- T &operator ()(proto::tag::terminal, reference_wrapper<T> r) const
+ template<typename Cont, typename Idx>
+ typename Cont::const_reference operator()(Cont const &c, Idx idx) const
{
- return r;
+ return c[idx];
}
- private:
- match_results<BidiIter> const &what_;
};
- typedef boost::proto::functional::make_expr<proto::tag::function, proto::default_domain> make_function;
- }
-
- namespace op
- {
struct push
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename Sequence, typename Value>
@@ -230,6 +221,7 @@
struct push_back
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename Sequence, typename Value>
@@ -241,6 +233,7 @@
struct push_front
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename Sequence, typename Value>
@@ -252,6 +245,7 @@
struct pop
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename Sequence>
@@ -263,6 +257,7 @@
struct pop_back
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename Sequence>
@@ -274,6 +269,7 @@
struct pop_front
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename Sequence>
@@ -285,6 +281,7 @@
struct front
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -310,6 +307,7 @@
struct back
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -335,6 +333,7 @@
struct top
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -360,6 +359,7 @@
struct first
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -378,6 +378,7 @@
struct second
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -396,6 +397,7 @@
struct matched
{
+ BOOST_PROTO_CALLABLE()
typedef bool result_type;
template<typename Sub>
@@ -407,6 +409,7 @@
struct length
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -425,6 +428,7 @@
struct str
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -446,6 +450,7 @@
// associative containers, and strings.
struct insert
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig, typename EnableIf = void>
struct result
{};
@@ -541,6 +546,7 @@
struct make_pair
{
+ BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result {};
@@ -560,6 +566,7 @@
template<typename T>
struct as
{
+ BOOST_PROTO_CALLABLE()
typedef T result_type;
template<typename Value>
@@ -572,6 +579,7 @@
template<typename T>
struct static_cast_
{
+ BOOST_PROTO_CALLABLE()
typedef T result_type;
template<typename Value>
@@ -584,6 +592,7 @@
template<typename T>
struct dynamic_cast_
{
+ BOOST_PROTO_CALLABLE()
typedef T result_type;
template<typename Value>
@@ -596,6 +605,7 @@
template<typename T>
struct const_cast_
{
+ BOOST_PROTO_CALLABLE()
typedef T result_type;
template<typename Value>
@@ -608,6 +618,7 @@
template<typename T>
struct construct
{
+ BOOST_PROTO_CALLABLE()
typedef T result_type;
T operator()() const
@@ -637,6 +648,7 @@
template<typename Except>
struct throw_
{
+ BOOST_PROTO_CALLABLE()
typedef void result_type;
void operator()() const
@@ -662,6 +674,31 @@
BOOST_THROW_EXCEPTION(Except(a0, a1, a2));
}
};
+
+ struct unwrap_reference
+ {
+ BOOST_PROTO_CALLABLE()
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename Ref>
+ struct result<This(Ref)>
+ {
+ typedef typename boost::unwrap_reference<Ref>::type &type;
+ };
+
+ template<typename This, typename Ref>
+ struct result<This(Ref &)>
+ {
+ typedef typename boost::unwrap_reference<Ref>::type &type;
+ };
+
+ template<typename T>
+ T &operator()(boost::reference_wrapper<T> r) const
+ {
+ return static_cast<T &>(r);
+ }
+ };
}
template<typename Fun>
@@ -686,6 +723,7 @@
function<op::str>::type const str = {{}};
function<op::insert>::type const insert = {{}};
function<op::make_pair>::type const make_pair = {{}};
+ function<op::unwrap_reference>::type const unwrap_reference = {{}};
template<typename T>
struct value
@@ -890,8 +928,36 @@
detail::ignore_unused(xpressive::check);
detail::ignore_unused(xpressive::let);
}
- }
+ struct mark_nbr
+ {
+ BOOST_PROTO_CALLABLE()
+ typedef int result_type;
+
+ int operator()(mark_placeholder m) const
+ {
+ return m.mark_number_;
+ }
+ };
+
+ struct ReplaceAlgo
+ : proto::or_<
+ proto::when<
+ proto::terminal<mark_placeholder>
+ , op::at(proto::_data, proto::call<mark_nbr(proto::_value)>)
+ >
+ , proto::when<
+ proto::terminal<any_matcher>
+ , op::at(proto::_data, proto::size_t<0>)
+ >
+ , proto::when<
+ proto::terminal<reference_wrapper<proto::_> >
+ , op::unwrap_reference(proto::_value)
+ >
+ , proto::_default<ReplaceAlgo>
+ >
+ {};
+ }
}}
#undef UNREF
Modified: branches/release/boost/xpressive/xpressive_fwd.hpp
==============================================================================
--- branches/release/boost/xpressive/xpressive_fwd.hpp (original)
+++ branches/release/boost/xpressive/xpressive_fwd.hpp 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
@@ -145,6 +145,40 @@
template<typename T, int I = 0, typename Dummy = proto::is_proto_expr>
struct placeholder;
+ namespace op
+ {
+ struct at;
+ struct push;
+ struct push_back;
+ struct push_front;
+ struct pop;
+ struct pop_back;
+ struct pop_front;
+ struct front;
+ struct back;
+ struct top;
+ struct first;
+ struct second;
+ struct matched;
+ struct length;
+ struct str;
+ struct insert;
+ struct make_pair;
+ template<typename T>
+ struct as;
+ template<typename T>
+ struct static_cast_;
+ template<typename T>
+ struct dynamic_cast_;
+ template<typename T>
+ struct const_cast_;
+ template<typename T>
+ struct construct;
+ template<typename Except>
+ struct throw_;
+ struct unwrap_reference;
+ }
+
///////////////////////////////////////////////////////////////////////////////
// Common typedefs
//
Modified: branches/release/libs/xpressive/test/test_actions.cpp
==============================================================================
--- branches/release/libs/xpressive/test/test_actions.cpp (original)
+++ branches/release/libs/xpressive/test/test_actions.cpp 2011-05-01 06:04:01 EDT (Sun, 01 May 2011)
@@ -246,6 +246,26 @@
BOOST_CHECK_EQUAL(build1.get(), 500);
}
+///////////////////////////////////////////////////////////////////////////////
+// test7
+// Test regex_replace with an xpressive lambda
+void test7()
+{
+ namespace xp = boost::xpressive;
+ using namespace xp;
+
+ std::map<std::string, std::string> env;
+ env["XXX"] = "!!!";
+ env["YYY"] = "???";
+
+ std::string text("This is a %XXX% string %YYY% and stuff.");
+ sregex var = '%' >> (s1 = +_w) >> '%';
+
+ text = regex_replace(text, var, xp::ref(env)[s1]);
+
+ BOOST_CHECK_EQUAL(text, "This is a !!! string ??? and stuff.");
+}
+
using namespace boost::unit_test;
///////////////////////////////////////////////////////////////////////////////
@@ -261,6 +281,7 @@
test->add(BOOST_TEST_CASE(&test4_aux));
test->add(BOOST_TEST_CASE(&test5));
test->add(BOOST_TEST_CASE(&test6));
+ test->add(BOOST_TEST_CASE(&test7));
return test;
}
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