Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71844 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/config/compiler 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/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/proto boost/proto/context boost/proto/context/detail boost/proto/context/detail/preprocessed boost/proto/detail boost/proto/detail/preprocessed boost/proto/transform boost/proto/transform/detail boost/proto/transform/detail/preprocessed 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 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/proto/preprocess 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/thread/src/win32 libs/timer libs/tr1 libs/type_traits libs/typeof/doc libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave 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-09 12:43:53


Author: eric_niebler
Date: 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
New Revision: 71844
URL: http://svn.boost.org/trac/boost/changeset/71844

Log:
merge [71709] [71735] [71742] [71758] [71765] [71777] [71783] [71811] [71832] [71841] from trunk
Added:
   branches/release/boost/proto/context/detail/
   branches/release/boost/proto/context/detail/callable_eval.hpp (contents, props changed)
   branches/release/boost/proto/context/detail/default_eval.hpp (contents, props changed)
   branches/release/boost/proto/context/detail/null_eval.hpp (contents, props changed)
   branches/release/boost/proto/context/detail/preprocessed/
   branches/release/boost/proto/context/detail/preprocessed/callable_eval.hpp (contents, props changed)
   branches/release/boost/proto/context/detail/preprocessed/default_eval.hpp (contents, props changed)
   branches/release/boost/proto/context/detail/preprocessed/null_eval.hpp (contents, props changed)
   branches/release/boost/proto/detail/and_n.hpp (contents, props changed)
   branches/release/boost/proto/detail/args.hpp (contents, props changed)
   branches/release/boost/proto/detail/basic_expr.hpp (contents, props changed)
   branches/release/boost/proto/detail/classtypeof.hpp (contents, props changed)
   branches/release/boost/proto/detail/deduce_domain_n.hpp (contents, props changed)
   branches/release/boost/proto/detail/deep_copy.hpp (contents, props changed)
   branches/release/boost/proto/detail/expr.hpp (contents, props changed)
   branches/release/boost/proto/detail/expr_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/extends_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/extends_funop_const.hpp (contents, props changed)
   branches/release/boost/proto/detail/generate_by_value.hpp (contents, props changed)
   branches/release/boost/proto/detail/lambda_matches.hpp (contents, props changed)
   branches/release/boost/proto/detail/make_expr.hpp (contents, props changed)
   branches/release/boost/proto/detail/make_expr_.hpp (contents, props changed)
   branches/release/boost/proto/detail/make_expr_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/matches_.hpp (contents, props changed)
   branches/release/boost/proto/detail/memfun_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/or_n.hpp (contents, props changed)
   branches/release/boost/proto/detail/poly_function_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/poly_function_traits.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/
   branches/release/boost/proto/detail/preprocessed/and_n.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/args.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/basic_expr.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/classtypeof.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/deduce_domain_n.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/deep_copy.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/expr.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/expr_variadic.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/extends_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/extends_funop_const.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/generate_by_value.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/lambda_matches.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/make_expr.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/make_expr_.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/make_expr_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/matches_.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/memfun_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/or_n.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/poly_function_funop.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/poly_function_traits.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/template_arity_helper.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/traits.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/unpack_expr_.hpp (contents, props changed)
   branches/release/boost/proto/detail/preprocessed/vararg_matches_impl.hpp (contents, props changed)
   branches/release/boost/proto/detail/template_arity.hpp (contents, props changed)
   branches/release/boost/proto/detail/template_arity_helper.hpp (contents, props changed)
   branches/release/boost/proto/detail/traits.hpp (contents, props changed)
   branches/release/boost/proto/detail/unpack_expr_.hpp (contents, props changed)
   branches/release/boost/proto/detail/vararg_matches_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/
   branches/release/boost/proto/transform/detail/call.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/construct_funop.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/construct_pod_funop.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/default_function_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/fold_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/lazy.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/make.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/make_gcc_workaround.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/pass_through_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/
   branches/release/boost/proto/transform/detail/preprocessed/call.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/construct_funop.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/construct_pod_funop.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/default_function_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/fold_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/lazy.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/make.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/preprocessed/when.hpp (contents, props changed)
   branches/release/boost/proto/transform/detail/when.hpp (contents, props changed)
   branches/release/libs/proto/preprocess/
   branches/release/libs/proto/preprocess/preprocess_proto.cpp (contents, props changed)
   branches/release/libs/proto/preprocess/wave.cfg (contents, props changed)
Removed:
   branches/release/boost/proto/detail/expr0.hpp
   branches/release/boost/proto/detail/expr1.hpp
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/config/compiler/visualc.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/filetime_functions.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/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/boost/xpressive/ (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/thread/src/win32/thread.cpp (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/proto/args.hpp | 376 ++---
   branches/release/boost/proto/context/callable.hpp | 521 +++-----
   branches/release/boost/proto/context/default.hpp | 760 +++++------
   branches/release/boost/proto/context/null.hpp | 129 -
   branches/release/boost/proto/deep_copy.hpp | 322 ++---
   branches/release/boost/proto/detail/decltype.hpp | 36
   branches/release/boost/proto/detail/deduce_domain.hpp | 38
   branches/release/boost/proto/detail/funop.hpp | 76
   branches/release/boost/proto/detail/poly_function.hpp | 454 +++----
   branches/release/boost/proto/expr.hpp | 35
   branches/release/boost/proto/extends.hpp | 60
   branches/release/boost/proto/fusion.hpp | 2
   branches/release/boost/proto/generate.hpp | 747 +++++------
   branches/release/boost/proto/make_expr.hpp | 1204 +++++++------------
   branches/release/boost/proto/matches.hpp | 1861 ++++++++++++++-----------------
   branches/release/boost/proto/proto_fwd.hpp | 23
   branches/release/boost/proto/traits.hpp | 2361 ++++++++++++++++++---------------------
   branches/release/boost/proto/transform/call.hpp | 709 +++++------
   branches/release/boost/proto/transform/default.hpp | 1031 ++++++++---------
   branches/release/boost/proto/transform/fold.hpp | 538 +++-----
   branches/release/boost/proto/transform/lazy.hpp | 121 -
   branches/release/boost/proto/transform/make.hpp | 673 +++-------
   branches/release/boost/proto/transform/pass_through.hpp | 318 ++---
   branches/release/boost/proto/transform/when.hpp | 453 +++----
   24 files changed, 5523 insertions(+), 7325 deletions(-)

Modified: branches/release/boost/proto/args.hpp
==============================================================================
--- branches/release/boost/proto/args.hpp (original)
+++ branches/release/boost/proto/args.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,223 +1,165 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file args.hpp
- /// Contains definition of \c term\<\>, \c list1\<\>, \c list2\<\>, ...
- /// class templates.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_ARGS_HPP_EAN_04_01_2005
- #define BOOST_PROTO_ARGS_HPP_EAN_04_01_2005
-
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/repetition/repeat_from_to.hpp>
- #include <boost/type_traits/is_function.hpp>
- #include <boost/type_traits/is_abstract.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/or.hpp>
- #include <boost/mpl/void.hpp>
- #include <boost/proto/proto_fwd.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file args.hpp
+/// Contains definition of \c term\<\>, \c list1\<\>, \c list2\<\>, ...
+/// class templates.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_ARGS_HPP_EAN_04_01_2005
+#define BOOST_PROTO_ARGS_HPP_EAN_04_01_2005
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/type_traits/is_abstract.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/proto/proto_fwd.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
+ // All classes derived from std::ios_base have these public nested types,
+ // and are non-copyable. This is an imperfect test, but it's the best we
+ // we can do.
+ template<typename T>
+ yes_type check_is_iostream(
+ typename T::failure *
+ , typename T::Init *
+ , typename T::fmtflags *
+ , typename T::iostate *
+ , typename T::openmode *
+ , typename T::seekdir *
+ );
+
+ template<typename T>
+ no_type check_is_iostream(...);
+
+ template<typename T>
+ struct is_iostream
+ {
+ static bool const value = sizeof(yes_type) == sizeof(check_is_iostream<T>(0,0,0,0,0,0));
+ typedef mpl::bool_<value> type;
+ };
+
+ /// INTERNAL ONLY
+ // This should be a customization point. And it serves the same purpose
+ // as the is_noncopyable trait in Boost.Foreach.
+ template<typename T>
+ struct ref_only
+ : mpl::or_<
+ is_function<T>
+ , is_abstract<T>
+ , is_iostream<T>
+ >
+ {};
+
+ /// INTERNAL ONLY
+ template<typename Expr>
+ struct expr_traits
+ {
+ typedef Expr value_type;
+ typedef Expr &reference;
+ typedef Expr const &const_reference;
+ };
+
+ /// INTERNAL ONLY
+ template<typename Expr>
+ struct expr_traits<Expr &>
+ {
+ typedef Expr value_type;
+ typedef Expr &reference;
+ typedef Expr &const_reference;
+ };
+
+ /// INTERNAL ONLY
+ template<typename Expr>
+ struct expr_traits<Expr const &>
+ {
+ typedef Expr value_type;
+ typedef Expr const &reference;
+ typedef Expr const &const_reference;
+ };
+
+ /// INTERNAL ONLY
+ template<typename T>
+ struct term_traits
+ {
+ typedef T value_type;
+ typedef T &reference;
+ typedef T const &const_reference;
+ };
+
+ /// INTERNAL ONLY
+ template<typename T>
+ struct term_traits<T &>
         {
- // All classes derived from std::ios_base have these public nested types,
- // and are non-copyable. This is an imperfect test, but it's the best we
- // we can do.
- template<typename T>
- yes_type check_is_iostream(
- typename T::failure *
- , typename T::Init *
- , typename T::fmtflags *
- , typename T::iostate *
- , typename T::openmode *
- , typename T::seekdir *
- );
-
- template<typename T>
- no_type check_is_iostream(...);
-
- template<typename T>
- struct is_iostream
- {
- static bool const value = sizeof(yes_type) == sizeof(check_is_iostream<T>(0,0,0,0,0,0));
- typedef mpl::bool_<value> type;
- };
-
- /// INTERNAL ONLY
- // This should be a customization point. And it serves the same purpose
- // as the is_noncopyable trait in Boost.Foreach.
- template<typename T>
- struct ref_only
- : mpl::or_<
- is_function<T>
- , is_abstract<T>
- , is_iostream<T>
- >
- {};
-
- /// INTERNAL ONLY
- template<typename Expr>
- struct expr_traits
- {
- typedef Expr value_type;
- typedef Expr &reference;
- typedef Expr const &const_reference;
- };
-
- /// INTERNAL ONLY
- template<typename Expr>
- struct expr_traits<Expr &>
- {
- typedef Expr value_type;
- typedef Expr &reference;
- typedef Expr &const_reference;
- };
-
- /// INTERNAL ONLY
- template<typename Expr>
- struct expr_traits<Expr const &>
- {
- typedef Expr value_type;
- typedef Expr const &reference;
- typedef Expr const &const_reference;
- };
-
- /// INTERNAL ONLY
- template<typename T>
- struct term_traits
- {
- typedef T value_type;
- typedef T &reference;
- typedef T const &const_reference;
- };
-
- /// INTERNAL ONLY
- template<typename T>
- struct term_traits<T &>
- {
- typedef typename mpl::if_c<ref_only<T>::value, T &, T>::type value_type;
- typedef T &reference;
- typedef T &const_reference;
- };
-
- /// INTERNAL ONLY
- template<typename T>
- struct term_traits<T const &>
- {
- typedef T value_type;
- typedef T const &reference;
- typedef T const &const_reference;
- };
-
- /// INTERNAL ONLY
- template<typename T, std::size_t N>
- struct term_traits<T (&)[N]>
- {
- typedef T value_type[N];
- typedef T (&reference)[N];
- typedef T (&const_reference)[N];
- };
-
- /// INTERNAL ONLY
- template<typename T, std::size_t N>
- struct term_traits<T const (&)[N]>
- {
- typedef T value_type[N];
- typedef T const (&reference)[N];
- typedef T const (&const_reference)[N];
- };
-
- /// INTERNAL ONLY
- template<typename T, std::size_t N>
- struct term_traits<T[N]>
- {
- typedef T value_type[N];
- typedef T (&reference)[N];
- typedef T const (&const_reference)[N];
- };
-
- /// INTERNAL ONLY
- template<typename T, std::size_t N>
- struct term_traits<T const[N]>
- {
- typedef T value_type[N];
- typedef T const (&reference)[N];
- typedef T const (&const_reference)[N];
- };
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////////
- #define BOOST_PROTO_DEFINE_CHILD_N(Z, N, DATA) \
- typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(child, N); \
- /**< INTERNAL ONLY */
-
- #define BOOST_PROTO_DEFINE_VOID_N(z, n, data) \
- typedef mpl::void_ BOOST_PP_CAT(child, n); \
- /**< INTERNAL ONLY */
-
- namespace argsns_
- {
- /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
- ///
- /// A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
- /// The types in the sequence correspond to the children of a node in an expression tree.
- template< typename Arg0 >
- struct term
- {
- BOOST_STATIC_CONSTANT(long, arity = 0);
- typedef Arg0 child0;
-
- #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_DEFINE_VOID_N, ~)
- #endif
-
- /// INTERNAL ONLY
- ///
- typedef Arg0 back_;
- };
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/args.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_DEFINE_CHILD_N
- }
- ////////////////////////////////////////////////////////////////////////////////////////////
- }}
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
-
- /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
- ///
- /// A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
- /// The types in the sequence correspond to the children of a node in an expression tree.
- template< BOOST_PP_ENUM_PARAMS(N, typename Arg) >
- struct BOOST_PP_CAT(list, N)
- {
- BOOST_STATIC_CONSTANT(long, arity = N);
- BOOST_PP_REPEAT(N, BOOST_PROTO_DEFINE_CHILD_N, ~)
-
- #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
- BOOST_PP_REPEAT_FROM_TO(N, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_DEFINE_VOID_N, ~)
- #endif
-
- /// INTERNAL ONLY
- ///
- typedef BOOST_PP_CAT(Arg, BOOST_PP_DEC(N)) back_;
+ typedef typename mpl::if_c<ref_only<T>::value, T &, T>::type value_type;
+ typedef T &reference;
+ typedef T &const_reference;
         };
 
- #undef N
+ /// INTERNAL ONLY
+ template<typename T>
+ struct term_traits<T const &>
+ {
+ typedef T value_type;
+ typedef T const &reference;
+ typedef T const &const_reference;
+ };
+
+ /// INTERNAL ONLY
+ template<typename T, std::size_t N>
+ struct term_traits<T (&)[N]>
+ {
+ typedef T value_type[N];
+ typedef T (&reference)[N];
+ typedef T (&const_reference)[N];
+ };
+
+ /// INTERNAL ONLY
+ template<typename T, std::size_t N>
+ struct term_traits<T const (&)[N]>
+ {
+ typedef T value_type[N];
+ typedef T const (&reference)[N];
+ typedef T const (&const_reference)[N];
+ };
+
+ /// INTERNAL ONLY
+ template<typename T, std::size_t N>
+ struct term_traits<T[N]>
+ {
+ typedef T value_type[N];
+ typedef T (&reference)[N];
+ typedef T const (&const_reference)[N];
+ };
+
+ /// INTERNAL ONLY
+ template<typename T, std::size_t N>
+ struct term_traits<T const[N]>
+ {
+ typedef T value_type[N];
+ typedef T const (&reference)[N];
+ typedef T const (&const_reference)[N];
+ };
+ }
+
+ namespace argsns_
+ {
+ // This is where term and all the different listN templates are defined
+ #include <boost/proto/detail/args.hpp>
+ }
+
+}}
 
 #endif
+

Modified: branches/release/boost/proto/context/callable.hpp
==============================================================================
--- branches/release/boost/proto/context/callable.hpp (original)
+++ branches/release/boost/proto/context/callable.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,320 +1,229 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file callable.hpp
- /// Definintion of callable_context\<\>, an evaluation context for
- /// proto::eval() that explodes each node and calls the derived context
- /// type with the expressions constituents. If the derived context doesn't
- /// have an overload that handles this node, fall back to some other
- /// context.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_CONTEXT_CALLABLE_HPP_EAN_06_23_2007
- #define BOOST_PROTO_CONTEXT_CALLABLE_HPP_EAN_06_23_2007
-
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/selection/max.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/utility/result_of.hpp>
- #include <boost/type_traits/remove_cv.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp> // for child_c
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file callable.hpp
+/// Definintion of callable_context\<\>, an evaluation context for
+/// proto::eval() that explodes each node and calls the derived context
+/// type with the expressions constituents. If the derived context doesn't
+/// have an overload that handles this node, fall back to some other
+/// context.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_CONTEXT_CALLABLE_HPP_EAN_06_23_2007
+#define BOOST_PROTO_CONTEXT_CALLABLE_HPP_EAN_06_23_2007
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/selection/max.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp> // for child_c
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
+ template<typename Context>
+ struct callable_context_wrapper
+ : remove_cv<Context>::type
         {
- template<typename Context>
- struct callable_context_wrapper
- : remove_cv<Context>::type
- {
- callable_context_wrapper();
- typedef private_type_ fun_type(...);
- operator fun_type *() const;
- private:
- callable_context_wrapper &operator =(callable_context_wrapper const &);
- };
-
- template<typename T>
- yes_type check_is_expr_handled(T const &);
+ callable_context_wrapper();
+ typedef private_type_ fun_type(...);
+ operator fun_type *() const;
+ private:
+ callable_context_wrapper &operator =(callable_context_wrapper const &);
+ };
+
+ template<typename T>
+ yes_type check_is_expr_handled(T const &);
 
- no_type check_is_expr_handled(private_type_ const &);
+ no_type check_is_expr_handled(private_type_ const &);
 
- template<typename Expr, typename Context, long Arity = Expr::proto_arity_c>
- struct is_expr_handled;
-
- template<typename Expr, typename Context>
- struct is_expr_handled<Expr, Context, 0>
- {
- static callable_context_wrapper<Context> &sctx_;
- static Expr &sexpr_;
- static typename Expr::proto_tag &stag_;
-
- BOOST_STATIC_CONSTANT(bool, value =
- (
- sizeof(yes_type) ==
- sizeof(
- detail::check_is_expr_handled(
- (sctx_(stag_, proto::value(sexpr_)), 0)
- )
- )));
-
- typedef mpl::bool_<value> type;
- };
- }
+ template<typename Expr, typename Context, long Arity = Expr::proto_arity_c>
+ struct is_expr_handled;
 
- namespace context
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 0>
         {
- /// \brief A BinaryFunction that accepts a Proto expression and a
- /// callable context and calls the context with the expression tag
- /// and children as arguments, effectively fanning the expression
- /// out.
- ///
- /// <tt>callable_eval\<\></tt> requires that \c Context is a
- /// PolymorphicFunctionObject that can be invoked with \c Expr's
- /// tag and children as expressions, as follows:
- ///
- /// \code
- /// context(Expr::proto_tag(), child_c<0>(expr), child_c<1>(expr), ...)
- /// \endcode
- template<
- typename Expr
- , typename Context
- , long Arity // = Expr::proto_arity_c
- >
- struct callable_eval
- {};
-
- /// \brief A BinaryFunction that accepts a Proto expression and a
- /// callable context and calls the context with the expression tag
- /// and children as arguments, effectively fanning the expression
- /// out.
- ///
- /// <tt>callable_eval\<\></tt> requires that \c Context is a
- /// PolymorphicFunctionObject that can be invoked with \c Expr's
- /// tag and children as expressions, as follows:
- ///
- /// \code
- /// context(Expr::proto_tag(), value(expr))
- /// \endcode
- template<typename Expr, typename Context>
- struct callable_eval<Expr, Context, 0>
- {
- typedef typename proto::result_of::value<Expr const &>::type value_type;
-
- typedef
- typename BOOST_PROTO_RESULT_OF<
- Context(typename Expr::proto_tag, value_type)
- >::type
- result_type;
-
- /// \param expr The current expression
- /// \param context The callable evaluation context
- /// \return <tt>context(Expr::proto_tag(), value(expr))</tt>
- result_type operator ()(Expr &expr, Context &context) const
- {
- return context(typename Expr::proto_tag(), proto::value(expr));
- }
- };
-
- /// \brief An evaluation context adaptor that makes authoring a
- /// context a simple matter of writing function overloads, rather
- /// then writing template specializations.
- ///
- /// <tt>callable_context\<\></tt> is a base class that implements
- /// the context protocol by passing fanned-out expression nodes to
- /// the derived context, making it easy to customize the handling
- /// of expression types by writing function overloads. Only those
- /// expression types needing special handling require explicit
- /// handling. All others are dispatched to a user-specified
- /// default context, \c DefaultCtx.
- ///
- /// <tt>callable_context\<\></tt> is defined simply as:
- ///
- /// \code
- /// template<typename Context, typename DefaultCtx = default_context>
- /// struct callable_context
- /// {
- /// template<typename Expr, typename ThisContext = Context>
- /// struct eval
- /// : mpl::if_<
- /// is_expr_handled_<Expr, Context> // For exposition
- /// , callable_eval<Expr, ThisContext>
- /// , typename DefaultCtx::template eval<Expr, Context>
- /// >::type
- /// {};
- /// };
- /// \endcode
- ///
- /// The Boolean metafunction <tt>is_expr_handled_\<\></tt> uses
- /// metaprogramming tricks to determine whether \c Context has
- /// an overloaded function call operator that accepts the
- /// fanned-out constituents of an expression of type \c Expr.
- /// If so, the handling of the expression is dispatched to
- /// <tt>callable_eval\<\></tt>. If not, it is dispatched to
- /// the user-specified \c DefaultCtx.
- ///
- /// Below is an example of how to use <tt>callable_context\<\></tt>:
- ///
- /// \code
- /// // An evaluation context that increments all
- /// // integer terminals in-place.
- /// struct increment_ints
- /// : callable_context<
- /// increment_ints const // derived context
- /// , null_context const // fall-back context
- /// >
- /// {
- /// typedef void result_type;
- ///
- /// // Handle int terminals here:
- /// void operator()(proto::tag::terminal, int &i) const
- /// {
- /// ++i;
- /// }
- /// };
- /// \endcode
- ///
- /// With \c increment_ints, we can do the following:
- ///
- /// \code
- /// literal<int> i = 0, j = 10;
- /// proto::eval( i - j * 3.14, increment_ints() );
- ///
- /// assert( i.get() == 1 && j.get() == 11 );
- /// \endcode
- template<
- typename Context
- , typename DefaultCtx // = default_context
- >
- struct callable_context
- {
- /// A BinaryFunction that accepts an \c Expr and a
- /// \c Context, and either fans out the expression and passes
- /// it to the context, or else hands off the expression to
- /// \c DefaultCtx.
- ///
- /// If \c Context is a PolymorphicFunctionObject such that
- /// it can be invoked with the tag and children of \c Expr,
- /// as <tt>ctx(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr)...)</tt>,
- /// then <tt>eval\<Expr, ThisContext\></tt> inherits from
- /// <tt>callable_eval\<Expr, ThisContext\></tt>. Otherwise,
- /// <tt>eval\<Expr, ThisContext\></tt> inherits from
- /// <tt>DefaultCtx::eval\<Expr, Context\></tt>.
- template<typename Expr, typename ThisContext = Context>
- struct eval
- : mpl::if_c<
- detail::is_expr_handled<Expr, Context>::value
- , callable_eval<Expr, ThisContext>
- , typename DefaultCtx::template eval<Expr, Context>
- >::type
- {};
- };
- }
-
- #define BOOST_PROTO_CHILD_N_TYPE(Z, N, Expr) \
- typedef typename proto::result_of::child_c<Expr const &, N>::type BOOST_PP_CAT(child, N); \
- /**/
-
- #define BOOST_PROTO_CHILD_N(Z, N, expr) \
- proto::child_c<N>(expr) \
- /**/
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/callable.hpp>)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_CHILD_N_TYPE
- #undef BOOST_PROTO_CHILD_N
-
- }}
-
- #endif
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(stag_, proto::value(sexpr_)), 0)
+ )
+ );
+
+ typedef mpl::bool_<value> type;
+ };
+ }
 
-#else
-
- #define N BOOST_PP_ITERATION()
-
- namespace detail
+ namespace context
+ {
+ /// \brief A BinaryFunction that accepts a Proto expression and a
+ /// callable context and calls the context with the expression tag
+ /// and children as arguments, effectively fanning the expression
+ /// out.
+ ///
+ /// <tt>callable_eval\<\></tt> requires that \c Context is a
+ /// PolymorphicFunctionObject that can be invoked with \c Expr's
+ /// tag and children as expressions, as follows:
+ ///
+ /// \code
+ /// context(Expr::proto_tag(), child_c<0>(expr), child_c<1>(expr), ...)
+ /// \endcode
+ template<
+ typename Expr
+ , typename Context
+ , long Arity // = Expr::proto_arity_c
+ >
+ struct callable_eval
+ {};
+
+ /// \brief A BinaryFunction that accepts a Proto expression and a
+ /// callable context and calls the context with the expression tag
+ /// and children as arguments, effectively fanning the expression
+ /// out.
+ ///
+ /// <tt>callable_eval\<\></tt> requires that \c Context is a
+ /// PolymorphicFunctionObject that can be invoked with \c Expr's
+ /// tag and children as expressions, as follows:
+ ///
+ /// \code
+ /// context(Expr::proto_tag(), value(expr))
+ /// \endcode
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 0>
         {
- template<typename Expr, typename Context>
- struct is_expr_handled<Expr, Context, N>
- {
- static callable_context_wrapper<Context> &sctx_;
- static Expr &sexpr_;
- static typename Expr::proto_tag &stag_;
-
- BOOST_STATIC_CONSTANT(bool, value =
- (
- sizeof(yes_type) ==
- sizeof(
- detail::check_is_expr_handled(
- (sctx_(
- stag_
- BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, sexpr_)
- ), 0)
- )
- )));
-
- typedef mpl::bool_<value> type;
- };
- }
+ typedef typename proto::result_of::value<Expr const &>::type value_type;
 
- namespace context
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(typename Expr::proto_tag, value_type)
+ >::type
+ result_type;
+
+ /// \param expr The current expression
+ /// \param context The callable evaluation context
+ /// \return <tt>context(Expr::proto_tag(), value(expr))</tt>
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(typename Expr::proto_tag(), proto::value(expr));
+ }
+ };
+
+ /// \brief An evaluation context adaptor that makes authoring a
+ /// context a simple matter of writing function overloads, rather
+ /// then writing template specializations.
+ ///
+ /// <tt>callable_context\<\></tt> is a base class that implements
+ /// the context protocol by passing fanned-out expression nodes to
+ /// the derived context, making it easy to customize the handling
+ /// of expression types by writing function overloads. Only those
+ /// expression types needing special handling require explicit
+ /// handling. All others are dispatched to a user-specified
+ /// default context, \c DefaultCtx.
+ ///
+ /// <tt>callable_context\<\></tt> is defined simply as:
+ ///
+ /// \code
+ /// template<typename Context, typename DefaultCtx = default_context>
+ /// struct callable_context
+ /// {
+ /// template<typename Expr, typename ThisContext = Context>
+ /// struct eval
+ /// : mpl::if_<
+ /// is_expr_handled_<Expr, Context> // For exposition
+ /// , callable_eval<Expr, ThisContext>
+ /// , typename DefaultCtx::template eval<Expr, Context>
+ /// >::type
+ /// {};
+ /// };
+ /// \endcode
+ ///
+ /// The Boolean metafunction <tt>is_expr_handled_\<\></tt> uses
+ /// metaprogramming tricks to determine whether \c Context has
+ /// an overloaded function call operator that accepts the
+ /// fanned-out constituents of an expression of type \c Expr.
+ /// If so, the handling of the expression is dispatched to
+ /// <tt>callable_eval\<\></tt>. If not, it is dispatched to
+ /// the user-specified \c DefaultCtx.
+ ///
+ /// Below is an example of how to use <tt>callable_context\<\></tt>:
+ ///
+ /// \code
+ /// // An evaluation context that increments all
+ /// // integer terminals in-place.
+ /// struct increment_ints
+ /// : callable_context<
+ /// increment_ints const // derived context
+ /// , null_context const // fall-back context
+ /// >
+ /// {
+ /// typedef void result_type;
+ ///
+ /// // Handle int terminals here:
+ /// void operator()(proto::tag::terminal, int &i) const
+ /// {
+ /// ++i;
+ /// }
+ /// };
+ /// \endcode
+ ///
+ /// With \c increment_ints, we can do the following:
+ ///
+ /// \code
+ /// literal<int> i = 0, j = 10;
+ /// proto::eval( i - j * 3.14, increment_ints() );
+ ///
+ /// assert( i.get() == 1 && j.get() == 11 );
+ /// \endcode
+ template<
+ typename Context
+ , typename DefaultCtx // = default_context
+ >
+ struct callable_context
         {
- /// \brief A BinaryFunction that accepts a Proto expression and a
- /// callable context and calls the context with the expression tag
- /// and children as arguments, effectively fanning the expression
- /// out.
- ///
- /// <tt>callable_eval\<\></tt> requires that \c Context is a
- /// PolymorphicFunctionObject that can be invoked with \c Expr's
- /// tag and children as expressions, as follows:
- ///
- /// \code
- /// context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)
- /// \endcode
- template<typename Expr, typename Context>
- struct callable_eval<Expr, Context, N>
- {
- BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD_N_TYPE, Expr)
+ /// A BinaryFunction that accepts an \c Expr and a
+ /// \c Context, and either fans out the expression and passes
+ /// it to the context, or else hands off the expression to
+ /// \c DefaultCtx.
+ ///
+ /// If \c Context is a PolymorphicFunctionObject such that
+ /// it can be invoked with the tag and children of \c Expr,
+ /// as <tt>ctx(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr)...)</tt>,
+ /// then <tt>eval\<Expr, ThisContext\></tt> inherits from
+ /// <tt>callable_eval\<Expr, ThisContext\></tt>. Otherwise,
+ /// <tt>eval\<Expr, ThisContext\></tt> inherits from
+ /// <tt>DefaultCtx::eval\<Expr, Context\></tt>.
+ template<typename Expr, typename ThisContext = Context>
+ struct eval
+ : mpl::if_c<
+ detail::is_expr_handled<Expr, Context>::value
+ , callable_eval<Expr, ThisContext>
+ , typename DefaultCtx::template eval<Expr, Context>
+ >::type
+ {};
+ };
+ }
 
- typedef
- typename BOOST_PROTO_RESULT_OF<
- Context(
- typename Expr::proto_tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, child)
- )
- >::type
- result_type;
-
- /// \param expr The current expression
- /// \param context The callable evaluation context
- /// \return <tt>context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)</tt>
- result_type operator ()(Expr &expr, Context &context) const
- {
- return context(
- typename Expr::proto_tag()
- BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, expr)
- );
- }
- };
- }
+ #include <boost/proto/context/detail/callable_eval.hpp>
 
- #undef N
+}}
 
 #endif

Modified: branches/release/boost/proto/context/default.hpp
==============================================================================
--- branches/release/boost/proto/context/default.hpp (original)
+++ branches/release/boost/proto/context/default.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,420 +1,337 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file default.hpp
- /// Definintion of default_context, a default evaluation context for
- /// proto::eval() that uses Boost.Typeof to deduce return types
- /// of the built-in operators.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_CONTEXT_DEFAULT_HPP_EAN_01_08_2007
- #define BOOST_PROTO_CONTEXT_DEFAULT_HPP_EAN_01_08_2007
-
- #include <boost/config.hpp>
- #include <boost/preprocessor/arithmetic/add.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_shifted.hpp>
- #include <boost/utility/result_of.hpp>
- #include <boost/type_traits/is_const.hpp>
- #include <boost/type_traits/is_function.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/type_traits/is_member_pointer.hpp>
- #include <boost/type_traits/is_member_object_pointer.hpp>
- #include <boost/type_traits/is_member_function_pointer.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/tags.hpp>
- #include <boost/proto/eval.hpp>
- #include <boost/proto/traits.hpp> // for proto::child_c()
- #include <boost/proto/detail/decltype.hpp>
+///////////////////////////////////////////////////////////////////////////////
+/// \file default.hpp
+/// Definintion of default_context, a default evaluation context for
+/// proto::eval() that uses Boost.Typeof to deduce return types
+/// of the built-in operators.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_CONTEXT_DEFAULT_HPP_EAN_01_08_2007
+#define BOOST_PROTO_CONTEXT_DEFAULT_HPP_EAN_01_08_2007
+
+#include <boost/config.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_shifted.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/is_member_pointer.hpp>
+#include <boost/type_traits/is_member_object_pointer.hpp>
+#include <boost/type_traits/is_member_function_pointer.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/tags.hpp>
+#include <boost/proto/eval.hpp>
+#include <boost/proto/traits.hpp> // for proto::child_c()
+#include <boost/proto/detail/decltype.hpp>
+
+namespace boost { namespace proto
+{
+/// INTERNAL ONLY
+///
+#define UNREF(x) typename boost::remove_reference<x>::type
 
- namespace boost { namespace proto
+ namespace context
     {
- /// INTERNAL ONLY
- ///
- #define UNREF(x) typename boost::remove_reference<x>::type
-
- namespace context
- {
- template<
- typename Expr
- , typename Context
- , typename Tag // = typename Expr::proto_tag
- , long Arity // = Expr::proto_arity_c
- >
- struct default_eval
- {};
+ template<
+ typename Expr
+ , typename Context
+ , typename Tag // = typename Expr::proto_tag
+ , long Arity // = Expr::proto_arity_c
+ >
+ struct default_eval
+ {};
+
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, tag::terminal, 0>
+ {
+ typedef
+ typename proto::result_of::value<Expr &>::type
+ result_type;
 
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, tag::terminal, 0>
+ result_type operator ()(Expr &expr, Context &) const
             {
- typedef
- typename proto::result_of::value<Expr &>::type
- result_type;
-
- result_type operator ()(Expr &expr, Context &) const
- {
- return proto::value(expr);
- }
- };
+ return proto::value(expr);
+ }
+ };
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_UNARY_DEFAULT_EVAL(OP, TAG, MAKE) \
- template<typename Expr, typename Context> \
- struct default_eval<Expr, Context, TAG, 1> \
- { \
- private: \
- typedef typename proto::result_of::child_c<Expr, 0>::type e0; \
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; \
- public: \
- BOOST_PROTO_DECLTYPE_(OP proto::detail::MAKE<r0>(), result_type) \
- result_type operator ()(Expr &expr, Context &ctx) const \
- { \
- return OP proto::eval(proto::child_c<0>(expr), ctx); \
- } \
- }; \
- /**/
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_UNARY_DEFAULT_EVAL(OP, TAG, MAKE) \
+ template<typename Expr, typename Context> \
+ struct default_eval<Expr, Context, TAG, 1> \
+ { \
+ private: \
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0; \
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; \
+ public: \
+ BOOST_PROTO_DECLTYPE_(OP proto::detail::MAKE<r0>(), result_type) \
+ result_type operator ()(Expr &expr, Context &ctx) const \
+ { \
+ return OP proto::eval(proto::child_c<0>(expr), ctx); \
+ } \
+ }; \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_BINARY_DEFAULT_EVAL(OP, TAG, LMAKE, RMAKE) \
+ template<typename Expr, typename Context> \
+ struct default_eval<Expr, Context, TAG, 2> \
+ { \
+ private: \
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0; \
+ typedef typename proto::result_of::child_c<Expr, 1>::type e1; \
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; \
+ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; \
+ public: \
+ BOOST_PROTO_DECLTYPE_( \
+ proto::detail::LMAKE<r0>() OP proto::detail::RMAKE<r1>() \
+ , result_type \
+ ) \
+ result_type operator ()(Expr &expr, Context &ctx) const \
+ { \
+ return proto::eval( \
+ proto::child_c<0>(expr), ctx) OP proto::eval(proto::child_c<1>(expr) \
+ , ctx \
+ ); \
+ } \
+ }; \
+ /**/
+
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(+, proto::tag::unary_plus, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(-, proto::tag::negate, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(*, proto::tag::dereference, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(~, proto::tag::complement, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(&, proto::tag::address_of, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(!, proto::tag::logical_not, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(++, proto::tag::pre_inc, make_mutable)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(--, proto::tag::pre_dec, make_mutable)
+
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<<, proto::tag::shift_left, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>>, proto::tag::shift_right, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(*, proto::tag::multiplies, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(/, proto::tag::divides, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(%, proto::tag::modulus, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(+, proto::tag::plus, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(-, proto::tag::minus, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<, proto::tag::less, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>, proto::tag::greater, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<=, proto::tag::less_equal, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>=, proto::tag::greater_equal, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(==, proto::tag::equal_to, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(!=, proto::tag::not_equal_to, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(||, proto::tag::logical_or, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(&&, proto::tag::logical_and, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(&, proto::tag::bitwise_and, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(|, proto::tag::bitwise_or, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(^, proto::tag::bitwise_xor, make, make)
+
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(=, proto::tag::assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<<=, proto::tag::shift_left_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>>=, proto::tag::shift_right_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(*=, proto::tag::multiplies_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(/=, proto::tag::divides_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(%=, proto::tag::modulus_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(+=, proto::tag::plus_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(-=, proto::tag::minus_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(&=, proto::tag::bitwise_and_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(|=, proto::tag::bitwise_or_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(^=, proto::tag::bitwise_xor_assign, make_mutable, make)
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_BINARY_DEFAULT_EVAL(OP, TAG, LMAKE, RMAKE) \
- template<typename Expr, typename Context> \
- struct default_eval<Expr, Context, TAG, 2> \
- { \
- private: \
- typedef typename proto::result_of::child_c<Expr, 0>::type e0; \
- typedef typename proto::result_of::child_c<Expr, 1>::type e1; \
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; \
- typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; \
- public: \
- BOOST_PROTO_DECLTYPE_( \
- proto::detail::LMAKE<r0>() OP proto::detail::RMAKE<r1>() \
- , result_type \
- ) \
- result_type operator ()(Expr &expr, Context &ctx) const \
- { \
- return proto::eval( \
- proto::child_c<0>(expr), ctx) OP proto::eval(proto::child_c<1>(expr) \
- , ctx \
- ); \
- } \
- }; \
- /**/
+ #undef BOOST_PROTO_UNARY_DEFAULT_EVAL
+ #undef BOOST_PROTO_BINARY_DEFAULT_EVAL
 
- BOOST_PROTO_UNARY_DEFAULT_EVAL(+, proto::tag::unary_plus, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(-, proto::tag::negate, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(*, proto::tag::dereference, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(~, proto::tag::complement, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(&, proto::tag::address_of, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(!, proto::tag::logical_not, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(++, proto::tag::pre_inc, make_mutable)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(--, proto::tag::pre_dec, make_mutable)
-
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<<, proto::tag::shift_left, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>>, proto::tag::shift_right, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(*, proto::tag::multiplies, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(/, proto::tag::divides, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(%, proto::tag::modulus, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(+, proto::tag::plus, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(-, proto::tag::minus, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<, proto::tag::less, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>, proto::tag::greater, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<=, proto::tag::less_equal, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>=, proto::tag::greater_equal, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(==, proto::tag::equal_to, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(!=, proto::tag::not_equal_to, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(||, proto::tag::logical_or, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(&&, proto::tag::logical_and, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(&, proto::tag::bitwise_and, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(|, proto::tag::bitwise_or, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(^, proto::tag::bitwise_xor, make, make)
-
- BOOST_PROTO_BINARY_DEFAULT_EVAL(=, proto::tag::assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<<=, proto::tag::shift_left_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>>=, proto::tag::shift_right_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(*=, proto::tag::multiplies_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(/=, proto::tag::divides_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(%=, proto::tag::modulus_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(+=, proto::tag::plus_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(-=, proto::tag::minus_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(&=, proto::tag::bitwise_and_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(|=, proto::tag::bitwise_or_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(^=, proto::tag::bitwise_xor_assign, make_mutable, make)
-
- #undef BOOST_PROTO_UNARY_DEFAULT_EVAL
- #undef BOOST_PROTO_BINARY_DEFAULT_EVAL
-
- /// INTERNAL ONLY
- template<typename Expr, typename Context>
- struct is_member_function_eval
- : is_member_function_pointer<
- typename detail::uncvref<
- typename proto::result_of::eval<
- typename remove_reference<
- typename proto::result_of::child_c<Expr, 1>::type
- >::type
- , Context
+ /// INTERNAL ONLY
+ template<typename Expr, typename Context>
+ struct is_member_function_eval
+ : is_member_function_pointer<
+ typename detail::uncvref<
+ typename proto::result_of::eval<
+ typename remove_reference<
+ typename proto::result_of::child_c<Expr, 1>::type
>::type
+ , Context
>::type
- >
- {};
+ >::type
+ >
+ {};
 
- /// INTERNAL ONLY
- template<typename Expr, typename Context, bool IsMemFunCall>
- struct memfun_eval
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
- public:
- typedef typename detail::mem_ptr_fun<r0, r1>::result_type result_type;
- result_type operator ()(Expr &expr, Context &ctx) const
- {
- return detail::mem_ptr_fun<r0, r1>()(
- proto::eval(proto::child_c<0>(expr), ctx)
- , proto::eval(proto::child_c<1>(expr), ctx)
- );
- }
- };
-
- /// INTERNAL ONLY
- template<typename Expr, typename Context>
- struct memfun_eval<Expr, Context, true>
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
- public:
- typedef detail::memfun<r0, r1> result_type;
- result_type const operator ()(Expr &expr, Context &ctx) const
- {
- return detail::memfun<r0, r1>(
- proto::eval(proto::child_c<0>(expr), ctx)
- , proto::eval(proto::child_c<1>(expr), ctx)
- );
- }
- };
-
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, tag::mem_ptr, 2>
- : memfun_eval<Expr, Context, is_member_function_eval<Expr, Context>::value>
- {};
+ /// INTERNAL ONLY
+ template<typename Expr, typename Context, bool IsMemFunCall>
+ struct memfun_eval
+ {
+ private:
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
+ public:
+ typedef typename detail::mem_ptr_fun<r0, r1>::result_type result_type;
+ result_type operator ()(Expr &expr, Context &ctx) const
+ {
+ return detail::mem_ptr_fun<r0, r1>()(
+ proto::eval(proto::child_c<0>(expr), ctx)
+ , proto::eval(proto::child_c<1>(expr), ctx)
+ );
+ }
+ };
 
- // Handle post-increment specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::post_inc, 1>
- {
- private:
- typedef typename proto::result_of::child_c<Expr, 0>::type e0;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- public:
- BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() ++, result_type)
- result_type operator ()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::child_c<0>(expr), ctx) ++;
- }
- };
-
- // Handle post-decrement specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::post_dec, 1>
- {
- private:
- typedef typename proto::result_of::child_c<Expr, 0>::type e0;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- public:
- BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() --, result_type)
- result_type operator ()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::child_c<0>(expr), ctx) --;
- }
- };
-
- // Handle subscript specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::subscript, 2>
- {
- private:
- typedef typename proto::result_of::child_c<Expr, 0>::type e0;
- typedef typename proto::result_of::child_c<Expr, 1>::type e1;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
- public:
- BOOST_PROTO_DECLTYPE_(proto::detail::make_subscriptable<r0>()[proto::detail::make<r1>()], result_type)
- result_type operator ()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::child_c<0>(expr), ctx)[proto::eval(proto::child_c<1>(expr), ctx)];
- }
- };
-
- // Handle if_else_ specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::if_else_, 3>
- {
- private:
- typedef typename proto::result_of::child_c<Expr, 0>::type e0;
- typedef typename proto::result_of::child_c<Expr, 1>::type e1;
- typedef typename proto::result_of::child_c<Expr, 2>::type e2;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
- typedef typename proto::result_of::eval<UNREF(e2), Context>::type r2;
- public:
- BOOST_PROTO_DECLTYPE_(
- proto::detail::make<r0>()
- ? proto::detail::make<r1>()
- : proto::detail::make<r2>()
- , result_type
- )
- result_type operator ()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::child_c<0>(expr), ctx)
- ? proto::eval(proto::child_c<1>(expr), ctx)
- : proto::eval(proto::child_c<2>(expr), ctx);
- }
- };
-
- // Handle comma specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::comma, 2>
- {
- private:
- typedef typename proto::result_of::child_c<Expr, 0>::type e0;
- typedef typename proto::result_of::child_c<Expr, 1>::type e1;
- typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
- typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
- public:
- typedef typename proto::detail::comma_result<r0, r1>::type result_type;
- result_type operator ()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::child_c<0>(expr), ctx), proto::eval(proto::child_c<1>(expr), ctx);
- }
- };
-
- // Handle function specially
- #define BOOST_PROTO_DEFAULT_EVAL_TYPE(Z, N, DATA) \
- typename proto::result_of::eval< \
- typename remove_reference< \
- typename proto::result_of::child_c<DATA, N>::type \
- >::type \
- , Context \
- >::type \
- /**/
-
- #define BOOST_PROTO_DEFAULT_EVAL(Z, N, DATA) \
- proto::eval(proto::child_c<N>(DATA), context) \
- /**/
-
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::function, 1>
- {
- typedef
- typename proto::detail::result_of_fixup<
- BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
- >::type
- function_type;
+ /// INTERNAL ONLY
+ template<typename Expr, typename Context>
+ struct memfun_eval<Expr, Context, true>
+ {
+ private:
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
+ public:
+ typedef detail::memfun<r0, r1> result_type;
+ result_type const operator ()(Expr &expr, Context &ctx) const
+ {
+ return detail::memfun<r0, r1>(
+ proto::eval(proto::child_c<0>(expr), ctx)
+ , proto::eval(proto::child_c<1>(expr), ctx)
+ );
+ }
+ };
 
- typedef
- typename BOOST_PROTO_RESULT_OF<function_type()>::type
- result_type;
-
- result_type operator ()(Expr &expr, Context &context) const
- {
- return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)();
- }
- };
-
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::function, 2>
- {
- typedef
- typename proto::detail::result_of_fixup<
- BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
- >::type
- function_type;
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, tag::mem_ptr, 2>
+ : memfun_eval<Expr, Context, is_member_function_eval<Expr, Context>::value>
+ {};
 
- typedef
- typename detail::result_of_<
- function_type(BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 1, Expr))
- >::type
- result_type;
+ // Handle post-increment specially.
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::post_inc, 1>
+ {
+ private:
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ public:
+ BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() ++, result_type)
+ result_type operator ()(Expr &expr, Context &ctx) const
+ {
+ return proto::eval(proto::child_c<0>(expr), ctx) ++;
+ }
+ };
 
- result_type operator ()(Expr &expr, Context &context) const
- {
- return this->invoke(
- expr
- , context
- , is_member_function_pointer<function_type>()
- , is_member_object_pointer<function_type>()
- );
- }
-
- private:
- result_type invoke(Expr &expr, Context &context, mpl::false_, mpl::false_) const
- {
- return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(BOOST_PROTO_DEFAULT_EVAL(~, 1, expr));
- }
-
- result_type invoke(Expr &expr, Context &context, mpl::true_, mpl::false_) const
- {
- BOOST_PROTO_USE_GET_POINTER();
- typedef typename detail::classtypeof<function_type>::type class_type;
- return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
- BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
- )();
- }
-
- result_type invoke(Expr &expr, Context &context, mpl::false_, mpl::true_) const
- {
- BOOST_PROTO_USE_GET_POINTER();
- typedef typename detail::classtypeof<function_type>::type class_type;
- return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
- BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
- );
- }
- };
+ // Handle post-decrement specially.
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::post_dec, 1>
+ {
+ private:
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ public:
+ BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() --, result_type)
+ result_type operator ()(Expr &expr, Context &ctx) const
+ {
+ return proto::eval(proto::child_c<0>(expr), ctx) --;
+ }
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/context/default.hpp>))
- #include BOOST_PP_ITERATE()
+ // Handle subscript specially.
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::subscript, 2>
+ {
+ private:
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0;
+ typedef typename proto::result_of::child_c<Expr, 1>::type e1;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
+ public:
+ BOOST_PROTO_DECLTYPE_(proto::detail::make_subscriptable<r0>()[proto::detail::make<r1>()], result_type)
+ result_type operator ()(Expr &expr, Context &ctx) const
+ {
+ return proto::eval(proto::child_c<0>(expr), ctx)[proto::eval(proto::child_c<1>(expr), ctx)];
+ }
+ };
 
- #undef BOOST_PROTO_DEFAULT_EVAL_TYPE
- #undef BOOST_PROTO_DEFAULT_EVAL
+ // Handle if_else_ specially.
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::if_else_, 3>
+ {
+ private:
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0;
+ typedef typename proto::result_of::child_c<Expr, 1>::type e1;
+ typedef typename proto::result_of::child_c<Expr, 2>::type e2;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
+ typedef typename proto::result_of::eval<UNREF(e2), Context>::type r2;
+ public:
+ BOOST_PROTO_DECLTYPE_(
+ proto::detail::make<r0>()
+ ? proto::detail::make<r1>()
+ : proto::detail::make<r2>()
+ , result_type
+ )
+ result_type operator ()(Expr &expr, Context &ctx) const
+ {
+ return proto::eval(proto::child_c<0>(expr), ctx)
+ ? proto::eval(proto::child_c<1>(expr), ctx)
+ : proto::eval(proto::child_c<2>(expr), ctx);
+ }
+ };
 
- /// default_context
- ///
- struct default_context
+ // Handle comma specially.
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::comma, 2>
+ {
+ private:
+ typedef typename proto::result_of::child_c<Expr, 0>::type e0;
+ typedef typename proto::result_of::child_c<Expr, 1>::type e1;
+ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0;
+ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1;
+ public:
+ typedef typename proto::detail::comma_result<r0, r1>::type result_type;
+ result_type operator ()(Expr &expr, Context &ctx) const
             {
- /// default_context::eval
- ///
- template<typename Expr, typename ThisContext = default_context const>
- struct eval
- : default_eval<Expr, ThisContext>
- {};
- };
-
- } // namespace context
+ return proto::eval(proto::child_c<0>(expr), ctx), proto::eval(proto::child_c<1>(expr), ctx);
+ }
+ };
 
- }} // namespace boost::proto
+ // Handle function specially
+ #define BOOST_PROTO_DEFAULT_EVAL_TYPE(Z, N, DATA) \
+ typename proto::result_of::eval< \
+ typename remove_reference< \
+ typename proto::result_of::child_c<DATA, N>::type \
+ >::type \
+ , Context \
+ >::type \
+ /**/
 
- #undef UNREF
+ #define BOOST_PROTO_DEFAULT_EVAL(Z, N, DATA) \
+ proto::eval(proto::child_c<N>(DATA), context) \
+ /**/
 
- #endif
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 1>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
+ >::type
+ function_type;
 
-#else
+ typedef
+ typename BOOST_PROTO_RESULT_OF<function_type()>::type
+ result_type;
 
- #define N BOOST_PP_ITERATION()
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)();
+ }
+ };
 
         template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::function, N>
+ struct default_eval<Expr, Context, proto::tag::function, 2>
         {
             typedef
                 typename proto::detail::result_of_fixup<
@@ -423,41 +340,70 @@
             function_type;
 
             typedef
- typename BOOST_PROTO_RESULT_OF<
- function_type(BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr))
+ typename detail::result_of_<
+ function_type(BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 1, Expr))
>::type
             result_type;
 
             result_type operator ()(Expr &expr, Context &context) const
             {
- return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ return this->invoke(
+ expr
+ , context
+ , is_member_function_pointer<function_type>()
+ , is_member_object_pointer<function_type>()
+ );
             }
 
         private:
- result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ result_type invoke(Expr &expr, Context &context, mpl::false_, mpl::false_) const
             {
- return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, expr)
- );
+ return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(BOOST_PROTO_DEFAULT_EVAL(~, 1, expr));
             }
 
- result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ result_type invoke(Expr &expr, Context &context, mpl::true_, mpl::false_) const
             {
- #define M0(Z, M, DATA) \
- BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA) \
- /**/
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
+ )();
+ }
 
+ result_type invoke(Expr &expr, Context &context, mpl::false_, mpl::true_) const
+ {
                 BOOST_PROTO_USE_GET_POINTER();
                 typedef typename detail::classtypeof<function_type>::type class_type;
                 return (
                     BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
                     BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
- )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), M0, expr));
-
- #undef M0
+ );
             }
         };
 
- #undef N
+ // Additional specialization are generated by the preprocessor
+ #include <boost/proto/context/detail/default_eval.hpp>
+
+ #undef BOOST_PROTO_DEFAULT_EVAL_TYPE
+ #undef BOOST_PROTO_DEFAULT_EVAL
+
+ /// default_context
+ ///
+ struct default_context
+ {
+ /// default_context::eval
+ ///
+ template<typename Expr, typename ThisContext = default_context const>
+ struct eval
+ : default_eval<Expr, ThisContext>
+ {};
+ };
+
+ } // namespace context
+
+}} // namespace boost::proto
+
+#undef UNREF
 
 #endif

Added: branches/release/boost/proto/context/detail/callable_eval.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/context/detail/callable_eval.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,113 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/context/detail/preprocessed/callable_eval.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_CHILD_N_TYPE(Z, N, Expr) \
+ typedef typename proto::result_of::child_c<Expr const &, N>::type BOOST_PP_CAT(child, N); \
+ /**/
+
+ #define BOOST_PROTO_CHILD_N(Z, N, expr) \
+ proto::child_c<N>(expr) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/callable_eval.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file callable_eval.hpp
+ /// Contains specializations of the callable_eval\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/callable_eval.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_CHILD_N_TYPE
+ #undef BOOST_PROTO_CHILD_N
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, N>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, sexpr_)
+ ), 0)
+ )
+ );
+
+ typedef mpl::bool_<value> type;
+ };
+ }
+
+ namespace context
+ {
+ /// \brief A BinaryFunction that accepts a Proto expression and a
+ /// callable context and calls the context with the expression tag
+ /// and children as arguments, effectively fanning the expression
+ /// out.
+ ///
+ /// <tt>callable_eval\<\></tt> requires that \c Context is a
+ /// PolymorphicFunctionObject that can be invoked with \c Expr's
+ /// tag and children as expressions, as follows:
+ ///
+ /// \code
+ /// context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)
+ /// \endcode
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, N>
+ {
+ BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD_N_TYPE, Expr)
+
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, child)
+ )
+ >::type
+ result_type;
+
+ /// \param expr The current expression
+ /// \param context The callable evaluation context
+ /// \return <tt>context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)</tt>
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, expr)
+ );
+ }
+ };
+ }
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/context/detail/default_eval.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/context/detail/default_eval.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,82 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/context/detail/preprocessed/default_eval.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_DEFAULT_EVAL_SHIFTED(Z, M, DATA) \
+ BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/default_eval.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file default_eval.hpp
+ /// Contains specializations of the default_eval\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/default_eval.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFAULT_EVAL_SHIFTED
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, N>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
+ >::type
+ function_type;
+
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr))
+ >::type
+ result_type;
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(
+ BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, expr)
+ );
+ }
+
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
+ )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEFAULT_EVAL_SHIFTED, expr));
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/context/detail/null_eval.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/context/detail/null_eval.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,54 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/context/detail/preprocessed/null_eval.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_EVAL_N(Z, N, DATA) \
+ proto::eval(proto::child_c<N>(expr), ctx); \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/null_eval.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file null_eval.hpp
+ /// Contains specializations of the null_eval\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/null_eval.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_EVAL_N
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, N>
+ {
+ typedef void result_type;
+
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ BOOST_PP_REPEAT(N, BOOST_PROTO_EVAL_N, ~)
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/context/detail/preprocessed/callable_eval.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/context/detail/preprocessed/callable_eval.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,597 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file callable_eval.hpp
+ /// Contains specializations of the callable_eval\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 1>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 1>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 2>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 2>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 3>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 3>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 4>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 4>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 5>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 5>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3 , child4
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 6>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 6>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3 , child4 , child5
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 7>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 7>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3 , child4 , child5 , child6
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 8>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 8>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 9>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) , proto::child_c< 8>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 9>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename proto::result_of::child_c< Expr const &, 8>::type child8;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) , proto::child_c< 8>( expr)
+ );
+ }
+ };
+ }
+ namespace detail
+ {
+ template<typename Expr, typename Context>
+ struct is_expr_handled<Expr, Context, 10>
+ {
+ static callable_context_wrapper<Context> &sctx_;
+ static Expr &sexpr_;
+ static typename Expr::proto_tag &stag_;
+ static const bool value =
+ sizeof(yes_type) ==
+ sizeof(
+ detail::check_is_expr_handled(
+ (sctx_(
+ stag_
+ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) , proto::child_c< 8>( sexpr_) , proto::child_c< 9>( sexpr_)
+ ), 0)
+ )
+ );
+ typedef mpl::bool_<value> type;
+ };
+ }
+ namespace context
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Expr, typename Context>
+ struct callable_eval<Expr, Context, 10>
+ {
+ typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename proto::result_of::child_c< Expr const &, 8>::type child8; typedef typename proto::result_of::child_c< Expr const &, 9>::type child9;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ Context(
+ typename Expr::proto_tag
+ , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8 , child9
+ )
+ >::type
+ result_type;
+
+
+
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return context(
+ typename Expr::proto_tag()
+ , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) , proto::child_c< 8>( expr) , proto::child_c< 9>( expr)
+ );
+ }
+ };
+ }

Added: branches/release/boost/proto/context/detail/preprocessed/default_eval.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/context/detail/preprocessed/default_eval.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,279 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file default_eval.hpp
+ /// Contains specializations of the default_eval\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 3>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 4>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 5>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 6>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 7>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 8>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 7>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 9>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 7>::type >::type , Context >::type , typename proto::res
ult_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 8>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context));
+ }
+ };
+ template<typename Expr, typename Context>
+ struct default_eval<Expr, Context, proto::tag::function, 10>
+ {
+ typedef
+ typename proto::detail::result_of_fixup<
+ typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type
+ >::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 7>::type >::type , Context >::type , typename proto::res
ult_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 8>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 9>::type >::type , Context >::type)
+ >::type
+ result_type;
+ result_type operator ()(Expr &expr, Context &context) const
+ {
+ return this->invoke(expr, context, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(Expr &expr, Context &context, mpl::false_) const
+ {
+ return proto::eval(proto::child_c< 0>( expr), context)(
+ proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context) , proto::eval(proto::child_c< 9>( expr), context)
+ );
+ }
+ result_type invoke(Expr &expr, Context &context, mpl::true_) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ proto::eval(proto::child_c< 0>( expr), context)
+ )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context) , proto::eval(proto::child_c< 9>( expr), context));
+ }
+ };

Added: branches/release/boost/proto/context/detail/preprocessed/null_eval.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/context/detail/preprocessed/null_eval.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,97 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file null_eval.hpp
+ /// Contains specializations of the null_eval\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 1>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 2>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 3>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 4>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 5>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 6>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 7>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 8>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 9>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); proto::eval(proto::child_c< 8>(expr), ctx);
+ }
+ };
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 10>
+ {
+ typedef void result_type;
+ void operator ()(Expr &expr, Context &ctx) const
+ {
+ proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); proto::eval(proto::child_c< 8>(expr), ctx); proto::eval(proto::child_c< 9>(expr), ctx);
+ }
+ };

Modified: branches/release/boost/proto/context/null.hpp
==============================================================================
--- branches/release/boost/proto/context/null.hpp (original)
+++ branches/release/boost/proto/context/null.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,85 +1,56 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file null.hpp
- /// Definintion of null_context\<\>, an evaluation context for
- /// proto::eval() that simply evaluates each child expression, doesn't
- /// combine the results at all, and returns void.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007
- #define BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007
-
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/eval.hpp>
- #include <boost/proto/traits.hpp>
+///////////////////////////////////////////////////////////////////////////////
+/// \file null.hpp
+/// Definintion of null_context\<\>, an evaluation context for
+/// proto::eval() that simply evaluates each child expression, doesn't
+/// combine the results at all, and returns void.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007
+#define BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007
+
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/eval.hpp>
+#include <boost/proto/traits.hpp>
+
+namespace boost { namespace proto { namespace context
+{
+
+ template<
+ typename Expr
+ , typename Context
+ , long Arity // = Expr::proto_arity_c
+ >
+ struct null_eval
+ {};
 
- namespace boost { namespace proto { namespace context
+ template<typename Expr, typename Context>
+ struct null_eval<Expr, Context, 0>
     {
-
- template<
- typename Expr
- , typename Context
- , long Arity // = Expr::proto_arity_c
- >
- struct null_eval
- {};
-
- template<typename Expr, typename Context>
- struct null_eval<Expr, Context, 0>
- {
- typedef void result_type;
- void operator()(Expr &, Context &) const
- {}
- };
-
- #define BOOST_PROTO_EVAL_N(Z, N, DATA) \
- proto::eval(proto::child_c<N>(expr), ctx); \
- /**/
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/null.hpp>)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_EVAL_N
-
- /// null_context
+ typedef void result_type;
+ void operator()(Expr &, Context &) const
+ {}
+ };
+
+ // Additional specializations generated by the preprocessor
+ #include <boost/proto/context/detail/null_eval.hpp>
+
+ /// null_context
+ ///
+ struct null_context
+ {
+ /// null_context::eval
         ///
- struct null_context
- {
- /// null_context::eval
- ///
- template<typename Expr, typename ThisContext = null_context const>
- struct eval
- : null_eval<Expr, ThisContext>
- {};
- };
-
- }}}
-
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
-
- template<typename Expr, typename Context>
- struct null_eval<Expr, Context, N>
- {
- typedef void result_type;
-
- void operator ()(Expr &expr, Context &ctx) const
- {
- BOOST_PP_REPEAT(N, BOOST_PROTO_EVAL_N, ~)
- }
- };
+ template<typename Expr, typename ThisContext = null_context const>
+ struct eval
+ : null_eval<Expr, ThisContext>
+ {};
+ };
 
- #undef N
+}}}
 
 #endif

Modified: branches/release/boost/proto/deep_copy.hpp
==============================================================================
--- branches/release/boost/proto/deep_copy.hpp (original)
+++ branches/release/boost/proto/deep_copy.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,213 +1,163 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file deep_copy.hpp
- /// Replace all nodes stored by reference by nodes stored by value.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_DEEP_COPY_HPP_EAN_11_21_2006
- #define BOOST_PROTO_DEEP_COPY_HPP_EAN_11_21_2006
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/args.hpp>
- #include <boost/proto/expr.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file deep_copy.hpp
+/// Replace all nodes stored by reference by nodes stored by value.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_DEEP_COPY_HPP_EAN_11_21_2006
+#define BOOST_PROTO_DEEP_COPY_HPP_EAN_11_21_2006
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/args.hpp>
+#include <boost/proto/expr.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
- {
- template<typename Expr, long Arity = Expr::proto_arity_c>
- struct deep_copy_impl;
-
- template<typename Expr>
- struct deep_copy_impl<Expr, 0>
- {
- typedef
- typename base_expr<
- typename Expr::proto_domain
- , tag::terminal
- , term<typename term_traits<typename Expr::proto_child0>::value_type>
- >::type
- expr_type;
-
- typedef typename Expr::proto_generator proto_generator;
- typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
-
- template<typename Expr2, typename S, typename D>
- result_type operator()(Expr2 const &e, S const &, D const &) const
- {
- return proto_generator()(expr_type::make(e.proto_base().child0));
- }
- };
- }
-
- namespace result_of
- {
- /// \brief A metafunction for calculating the return type
- /// of \c proto::deep_copy().
- ///
- /// A metafunction for calculating the return type
- /// of \c proto::deep_copy(). The type parameter \c Expr
- /// should be the type of a Proto expression tree.
- /// It should not be a reference type, nor should it
- /// be cv-qualified.
- template<typename Expr>
- struct deep_copy
- {
- typedef
- typename detail::deep_copy_impl<
- BOOST_PROTO_UNCVREF(Expr)
- >::result_type
- type;
- };
- }
+ template<typename Expr, long Arity = Expr::proto_arity_c>
+ struct deep_copy_impl;
 
- namespace functional
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 0>
         {
- /// \brief A PolymorphicFunctionObject type for deep-copying
- /// Proto expression trees.
- ///
- /// A PolymorphicFunctionObject type for deep-copying
- /// Proto expression trees. When a tree is deep-copied,
- /// all internal nodes and most terminals held by reference
- /// are instead held by value.
- ///
- /// \attention Terminals of reference-to-function type are
- /// left unchanged. Terminals of reference-to-array type are
- /// stored by value, which can cause a large amount of data
- /// to be passed by value and stored on the stack.
- struct deep_copy
- {
- BOOST_PROTO_CALLABLE()
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , tag::terminal
+ , term<typename term_traits<typename Expr::proto_child0>::value_type>
+ >::type
+ expr_type;
 
- template<typename Sig>
- struct result;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef
- typename detail::deep_copy_impl<
- BOOST_PROTO_UNCVREF(Expr)
- >::result_type
- type;
- };
-
- /// \brief Deep-copies a Proto expression tree, turning all
- /// nodes and terminals held by reference into ones held by
- /// value.
- template<typename Expr>
- typename result_of::deep_copy<Expr>::type
- operator()(Expr const &e) const
- {
- return proto::detail::deep_copy_impl<Expr>()(e, 0, 0);
- }
- };
- }
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ return proto_generator()(expr_type::make(e.proto_base().child0));
+ }
+ };
+ }
 
- /// \brief A function for deep-copying
- /// Proto expression trees.
- ///
- /// A function for deep-copying
- /// Proto expression trees. When a tree is deep-copied,
- /// all internal nodes and most terminals held by reference
- /// are instead held by value.
- ///
- /// \attention Terminals of reference-to-function type are
- /// left unchanged.
+ namespace result_of
+ {
+ /// \brief A metafunction for calculating the return type
+ /// of \c proto::deep_copy().
         ///
- /// \sa proto::functional::deep_copy.
+ /// A metafunction for calculating the return type
+ /// of \c proto::deep_copy(). The type parameter \c Expr
+ /// should be the type of a Proto expression tree.
+ /// It should not be a reference type, nor should it
+ /// be cv-qualified.
         template<typename Expr>
- typename proto::result_of::deep_copy<Expr>::type
- deep_copy(Expr const &e)
+ struct deep_copy
         {
- return proto::detail::deep_copy_impl<Expr>()(e, 0, 0);
- }
+ typedef
+ typename detail::deep_copy_impl<
+ BOOST_PROTO_UNCVREF(Expr)
+ >::result_type
+ type;
+ };
+ }
 
- /// \brief A PrimitiveTransform for deep-copying
+ namespace functional
+ {
+ /// \brief A PolymorphicFunctionObject type for deep-copying
         /// Proto expression trees.
         ///
- /// A PrimitiveTransform for deep-copying
+ /// A PolymorphicFunctionObject type for deep-copying
         /// Proto expression trees. When a tree is deep-copied,
         /// all internal nodes and most terminals held by reference
         /// are instead held by value.
         ///
         /// \attention Terminals of reference-to-function type are
- /// left unchanged.
- ///
- /// \sa proto::functional::deep_copy.
- struct _deep_copy
- : proto::transform<_deep_copy>
- {
- template<typename E, typename S, typename D>
- struct impl
- : detail::deep_copy_impl<BOOST_PROTO_UNCVREF(E)>
- {};
- };
-
- namespace detail
+ /// left unchanged. Terminals of reference-to-array type are
+ /// stored by value, which can cause a large amount of data
+ /// to be passed by value and stored on the stack.
+ struct deep_copy
         {
- #define BOOST_PROTO_DEFINE_DEEP_COPY_TYPE(Z, N, DATA) \
- typename deep_copy_impl< \
- typename remove_reference< \
- typename Expr::BOOST_PP_CAT(proto_child, N) \
- >::type::proto_derived_expr \
- >::result_type \
- /**/
-
- #define BOOST_PROTO_DEFINE_DEEP_COPY_FUN(Z, N, DATA) \
- proto::deep_copy(e.proto_base().BOOST_PP_CAT(child, N)) \
- /**/
+ BOOST_PROTO_CALLABLE()
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/deep_copy.hpp>))
- #include BOOST_PP_ITERATE()
+ template<typename Sig>
+ struct result;
 
- #undef BOOST_PROTO_DEFINE_DEEP_COPY_FUN
- #undef BOOST_PROTO_DEFINE_DEEP_COPY_TYPE
- }
-
- }}
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef
+ typename detail::deep_copy_impl<
+ BOOST_PROTO_UNCVREF(Expr)
+ >::result_type
+ type;
+ };
 
- #endif // BOOST_PROTO_COMPILER_DEEP_COPY_HPP_EAN_11_21_2006
+ /// \brief Deep-copies a Proto expression tree, turning all
+ /// nodes and terminals held by reference into ones held by
+ /// value.
+ template<typename Expr>
+ typename result_of::deep_copy<Expr>::type
+ operator()(Expr const &e) const
+ {
+ return proto::detail::deep_copy_impl<Expr>()(e, 0, 0);
+ }
+ };
+ }
 
-#else
+ /// \brief A function for deep-copying
+ /// Proto expression trees.
+ ///
+ /// A function for deep-copying
+ /// Proto expression trees. When a tree is deep-copied,
+ /// all internal nodes and most terminals held by reference
+ /// are instead held by value.
+ ///
+ /// \attention Terminals of reference-to-function type are
+ /// left unchanged.
+ ///
+ /// \sa proto::functional::deep_copy.
+ template<typename Expr>
+ typename proto::result_of::deep_copy<Expr>::type
+ deep_copy(Expr const &e)
+ {
+ return proto::detail::deep_copy_impl<Expr>()(e, 0, 0);
+ }
 
- #define N BOOST_PP_ITERATION()
+ /// \brief A PrimitiveTransform for deep-copying
+ /// Proto expression trees.
+ ///
+ /// A PrimitiveTransform for deep-copying
+ /// Proto expression trees. When a tree is deep-copied,
+ /// all internal nodes and most terminals held by reference
+ /// are instead held by value.
+ ///
+ /// \attention Terminals of reference-to-function type are
+ /// left unchanged.
+ ///
+ /// \sa proto::functional::deep_copy.
+ struct _deep_copy
+ : proto::transform<_deep_copy>
+ {
+ template<typename E, typename S, typename D>
+ struct impl
+ : detail::deep_copy_impl<BOOST_PROTO_UNCVREF(E)>
+ {};
+ };
 
- template<typename Expr>
- struct deep_copy_impl<Expr, N>
- {
- typedef
- typename base_expr<
- typename Expr::proto_domain
- , typename Expr::proto_tag
- , BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~)
- >
- >::type
- expr_type;
-
- typedef typename Expr::proto_generator proto_generator;
- typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
-
- template<typename Expr2, typename S, typename D>
- result_type operator()(Expr2 const &e, S const &, D const &) const
- {
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)
- };
+ namespace detail
+ {
+ // include the definition of deep_copy_impl
+ #include <boost/proto/detail/deep_copy.hpp>
+ }
 
- return proto_generator()(that);
- }
- };
+}}
 
- #undef N
+#endif // BOOST_PROTO_COMPILER_DEEP_COPY_HPP_EAN_11_21_2006
 
-#endif

Added: branches/release/boost/proto/detail/and_n.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/and_n.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,94 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/and_n.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/and_n.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file and_n.hpp
+ /// Definitions of and_N, and_impl
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PP_MAX(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_MAX_LOGICAL_ARITY), <boost/proto/detail/and_n.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ // Assymetry here between the handling of and_N and or_N because
+ // and_N is used by lambda_matches up to BOOST_PROTO_MAX_ARITY,
+ // regardless of how low BOOST_PROTO_MAX_LOGICAL_ARITY is.
+ template<bool B, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), typename P)>
+ struct BOOST_PP_CAT(and_, N)
+ #if 2 == N
+ : mpl::bool_<P0::value>
+ {};
+ #else
+ : BOOST_PP_CAT(and_, BOOST_PP_DEC(N))<
+ P0::value BOOST_PP_COMMA_IF(BOOST_PP_SUB(N,2))
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_DEC(N), P)
+ >
+ {};
+ #endif
+
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), typename P)>
+ struct BOOST_PP_CAT(and_, N)<false, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), P)>
+ : mpl::false_
+ {};
+
+ #if N <= BOOST_PROTO_MAX_LOGICAL_ARITY
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename G), typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<BOOST_PP_ENUM_PARAMS(N, G)>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ #define M0(Z, N, DATA) \
+ typedef \
+ typename proto::when<proto::_, BOOST_PP_CAT(G, N)> \
+ ::template impl<Expr, State, Data> \
+ BOOST_PP_CAT(Gimpl, N); \
+ /**/
+ BOOST_PP_REPEAT(N, M0, ~)
+ #undef M0
+
+ typedef typename BOOST_PP_CAT(Gimpl, BOOST_PP_DEC(N))::result_type result_type;
+
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+ // Fix: jfalcou - 12/29/2010
+ // Avoid the use of comma operator here so as not to find Proto's
+ // by accident.
+ // expands to G0()(e,s,d); G1()(e,s,d); ... G{N-1}()(e,s,d);
+ #define M0(Z,N,DATA) BOOST_PP_CAT(Gimpl,N)()(e,s,d);
+ BOOST_PP_REPEAT(BOOST_PP_DEC(N),M0,~)
+ return BOOST_PP_CAT(Gimpl,BOOST_PP_DEC(N))()(e,s,d);
+ #undef M0
+ }
+ };
+
+ #endif
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/args.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/args.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,85 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/args.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_DEFINE_CHILD_N(Z, N, DATA) \
+ typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(child, N); \
+ /**< INTERNAL ONLY */
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_DEFINE_VOID_N(z, n, data) \
+ typedef mpl::void_ BOOST_PP_CAT(child, n); \
+ /**< INTERNAL ONLY */
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/args.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file args.hpp
+ /// Contains definition of \c term\<\>, \c list1\<\>, \c list2\<\>, ...
+ /// class templates.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
+ ///
+ /// A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
+ /// The types in the sequence correspond to the children of a node in an expression tree.
+ template< typename Arg0 >
+ struct term
+ {
+ static const long arity = 0;
+ typedef Arg0 child0;
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_DEFINE_VOID_N, ~)
+
+ /// INTERNAL ONLY
+ ///
+ typedef Arg0 back_;
+ };
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/args.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFINE_VOID_N
+ #undef BOOST_PROTO_DEFINE_CHILD_N
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
+ ///
+ /// A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
+ /// The types in the sequence correspond to the children of a node in an expression tree.
+ template< BOOST_PP_ENUM_PARAMS(N, typename Arg) >
+ struct BOOST_PP_CAT(list, N)
+ {
+ static const long arity = N;
+ BOOST_PP_REPEAT(N, BOOST_PROTO_DEFINE_CHILD_N, ~)
+ BOOST_PP_REPEAT_FROM_TO(N, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_DEFINE_VOID_N, ~)
+
+ /// INTERNAL ONLY
+ ///
+ typedef BOOST_PP_CAT(Arg, BOOST_PP_DEC(N)) back_;
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/basic_expr.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/basic_expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,179 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/basic_expr.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_CHILD(Z, N, DATA) \
+ typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
+ BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
+ /**< INTERNAL ONLY */
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_VOID(Z, N, DATA) \
+ typedef void BOOST_PP_CAT(proto_child, N); \
+ /**< INTERNAL ONLY */
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/basic_expr.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file basic_expr.hpp
+ /// Contains definition of basic_expr\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ // The expr<> specializations are actually defined here.
+ #define BOOST_PROTO_DEFINE_TERMINAL
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/proto/detail/basic_expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #undef BOOST_PROTO_DEFINE_TERMINAL
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/basic_expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_CHILD
+ #undef BOOST_PROTO_VOID
+
+#else
+
+ #define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION())
+
+ /// \brief Simplified representation of a node in an expression tree.
+ ///
+ /// \c proto::basic_expr\<\> is a node in an expression template tree. It
+ /// is a container for its child sub-trees. It also serves as
+ /// the terminal nodes of the tree.
+ ///
+ /// \c Tag is type that represents the operation encoded by
+ /// this expression. It is typically one of the structs
+ /// in the \c boost::proto::tag namespace, but it doesn't
+ /// have to be.
+ ///
+ /// \c Args is a type list representing the type of the children
+ /// of this expression. It is an instantiation of one
+ /// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The
+ /// child types must all themselves be either \c expr\<\>
+ /// or <tt>proto::expr\<\>&</tt>. If \c Args is an
+ /// instantiation of \c proto::term\<\> then this
+ /// \c expr\<\> type represents a terminal expression;
+ /// the parameter to the \c proto::term\<\> template
+ /// represents the terminal's value type.
+ ///
+ /// \c Arity is an integral constant representing the number of child
+ /// nodes this node contains. If \c Arity is 0, then this
+ /// node is a terminal.
+ ///
+ /// \c proto::basic_expr\<\> is a valid Fusion random-access sequence, where
+ /// the elements of the sequence are the child expressions.
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ template<typename Tag, typename Arg0>
+ struct basic_expr<Tag, term<Arg0>, 0>
+ #else
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
+ struct basic_expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
+ #endif
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = BOOST_PP_ITERATION();
+ typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
+ typedef basic_expr proto_base_expr;
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ typedef term<Arg0> proto_args;
+ #else
+ typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
+ #endif
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_; /**< INTERNAL ONLY */
+
+ BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
+ BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
+
+ /// \return *this
+ ///
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+ /// \overload
+ ///
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \return A new \c expr\<\> object initialized with the specified
+ /// arguments.
+ ///
+ template<typename A0>
+ static basic_expr const make(A0 &a0)
+ {
+ return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
+ }
+
+ /// \overload
+ ///
+ template<typename A0>
+ static basic_expr const make(A0 const &a0)
+ {
+ return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
+ }
+ #else
+ /// \return A new \c expr\<\> object initialized with the specified
+ /// arguments.
+ ///
+ template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
+ static basic_expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
+ {
+ basic_expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
+ return that;
+ }
+ #endif
+
+ #if 1 == BOOST_PP_ITERATION()
+ /// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is
+ /// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>.
+ /// Otherwise, it is some undefined type.
+ typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
+
+ /// \return The address of <tt>this->child0</tt> if \c Tag is
+ /// \c boost::proto::tag::address_of. Otherwise, this function will
+ /// fail to compile.
+ ///
+ /// \attention Proto overloads <tt>operator&</tt>, which means that
+ /// proto-ified objects cannot have their addresses taken, unless we use
+ /// the following hack to make \c &x implicitly convertible to \c X*.
+ operator address_of_hack_type_() const
+ {
+ return boost::addressof(this->child0);
+ }
+ #else
+ /// INTERNAL ONLY
+ ///
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ #endif
+ };
+
+#undef ARG_COUNT
+
+#endif

Added: branches/release/boost/proto/detail/classtypeof.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/classtypeof.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,49 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/classtypeof.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/classtypeof.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // classtypeof.hpp
+ // Contains specializations of the classtypeof\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/classtypeof.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))>
+ {
+ typedef U type;
+ };
+
+ template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const>
+ {
+ typedef U type;
+ };
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Modified: branches/release/boost/proto/detail/decltype.hpp
==============================================================================
--- branches/release/boost/proto/detail/decltype.hpp (original)
+++ branches/release/boost/proto/detail/decltype.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -32,7 +32,6 @@
 #include <boost/utility/addressof.hpp>
 #include <boost/utility/result_of.hpp>
 #include <boost/utility/enable_if.hpp>
-#include <boost/proto/repeat.hpp>
 
 #ifndef BOOST_NO_DECLTYPE
 # define BOOST_PROTO_DECLTYPE_(EXPR, TYPE) typedef decltype(EXPR) TYPE;
@@ -228,7 +227,7 @@
             template<typename T>
             struct has_get_pointer
             {
- BOOST_STATIC_CONSTANT(bool, value = sizeof(void *) == sizeof(get_pointer(make<T &>())));
+ static const bool value = sizeof(void *) == sizeof(get_pointer(make<T &>()));
                 typedef mpl::bool_<value> type;
             };
         }
@@ -245,20 +244,8 @@
             typedef U type;
         };
 
- #define BOOST_PP_LOCAL_MACRO(N) \
- template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \
- struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))> \
- { \
- typedef U type; \
- }; \
- template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \
- struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const> \
- { \
- typedef U type; \
- }; \
- /**/
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PP_LOCAL_ITERATE()
+ // Other specializations are generated by the preprocessor
+ #include <boost/proto/detail/classtypeof.hpp>
 
         ////////////////////////////////////////////////////////////////////////////////////////////
         template<typename T>
@@ -342,8 +329,8 @@
             template<typename T, typename U, typename V>
             struct result_of_<T U::*(V), typename enable_if_c<is_member_object_pointer<T U::*>::value>::type>
             {
- BOOST_STATIC_CONSTANT(bool, is_V_a_smart_ptr = 2 == sizeof(test_V_is_a_U<U>(&lvalue(make<V>()))));
- BOOST_STATIC_CONSTANT(bool, is_ptr_to_const = 2 == sizeof(test_ptr_to_const(BOOST_PROTO_GET_POINTER(U, make<V>()))));
+ static const bool is_V_a_smart_ptr = 2 == sizeof(test_V_is_a_U<U>(&lvalue(make<V>())));
+ static const bool is_ptr_to_const = 2 == sizeof(test_ptr_to_const(BOOST_PROTO_GET_POINTER(U, make<V>())));
 
                 // If V is not a U, then it is a (smart) pointer and we can always return an lvalue.
                 // Otherwise, we can only return an lvalue if we are given one.
@@ -499,17 +486,8 @@
                 return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)();
             }
 
- #define BOOST_PROTO_LOCAL_MACRO(N, typename_A, A_const_ref, A_const_ref_a, a) \
- template<typename_A(N)> \
- result_type operator()(A_const_ref_a(N)) const \
- { \
- BOOST_PROTO_USE_GET_POINTER(); \
- return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a(N)); \
- } \
- /**/
- #define BOOST_PROTO_LOCAL_a BOOST_PROTO_a
- #define BOOST_PROTO_LOCAL_LIMITS (1, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PROTO_LOCAL_ITERATE()
+ // Other overloads generated by the preprocessor
+ #include <boost/proto/detail/memfun_funop.hpp>
 
         private:
             T obj;

Modified: branches/release/boost/proto/detail/deduce_domain.hpp
==============================================================================
--- branches/release/boost/proto/detail/deduce_domain.hpp (original)
+++ branches/release/boost/proto/detail/deduce_domain.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -37,12 +37,6 @@
     {
         namespace detail
         {
- template<int N>
- struct sized_type
- {
- typedef char (&type)[N];
- };
-
             template<typename Domain>
             struct domain_
               : domain_<typename Domain::proto_super_domain>
@@ -157,37 +151,7 @@
>
             {};
 
- #define M0(Z, N, DATA) \
- typedef \
- typename common_domain2<common ## N, A ## N>::type \
- BOOST_PP_CAT(common, BOOST_PP_INC(N)); \
- /**/
-
- #define BOOST_PP_LOCAL_MACRO(N) \
- template<BOOST_PP_ENUM_PARAMS(N, typename A)> \
- struct BOOST_PP_CAT(common_domain, N) \
- { \
- typedef A0 common1; \
- BOOST_PP_REPEAT_FROM_TO(1, N, M0, ~) \
- typedef common ## N type; \
- BOOST_PROTO_ASSERT_VALID_DOMAIN(type); \
- }; \
- \
- template<BOOST_PP_ENUM_PARAMS(N, typename E)> \
- struct BOOST_PP_CAT(deduce_domain, N) \
- : BOOST_PP_CAT(common_domain, N)< \
- BOOST_PP_ENUM_BINARY_PARAMS( \
- N \
- , typename domain_of<E, >::type BOOST_PP_INTERCEPT \
- ) \
- > \
- {}; \
- /**/
-
- #define BOOST_PP_LOCAL_LIMITS (3, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #undef M0
+ #include <boost/proto/detail/deduce_domain_n.hpp>
         }
     }
 }

Added: branches/release/boost/proto/detail/deduce_domain_n.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/deduce_domain_n.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,64 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/deduce_domain_n.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_COMMON_DOMAIN2(Z, N, DATA) \
+ typedef \
+ typename common_domain2<common ## N, A ## N>::type \
+ BOOST_PP_CAT(common, BOOST_PP_INC(N)); \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deduce_domain_n.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // deduce_domain_n.hpp
+ // Definitions of common_domain[n] and deduce_domain[n] class templates.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/deduce_domain_n.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_COMMON_DOMAIN2
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ struct BOOST_PP_CAT(common_domain, N)
+ {
+ typedef A0 common1;
+ BOOST_PP_REPEAT_FROM_TO(1, N, BOOST_PROTO_COMMON_DOMAIN2, ~)
+ typedef BOOST_PP_CAT(common, N) type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename E)>
+ struct BOOST_PP_CAT(deduce_domain, N)
+ : BOOST_PP_CAT(common_domain, N)<
+ BOOST_PP_ENUM_BINARY_PARAMS(
+ N
+ , typename domain_of<E, >::type BOOST_PP_INTERCEPT
+ )
+ >
+ {};
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: branches/release/boost/proto/detail/deep_copy.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/deep_copy.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,79 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/deep_copy.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_DEFINE_DEEP_COPY_TYPE(Z, N, DATA) \
+ typename deep_copy_impl< \
+ typename remove_reference< \
+ typename Expr::BOOST_PP_CAT(proto_child, N) \
+ >::type::proto_derived_expr \
+ >::result_type \
+ /**/
+
+ #define BOOST_PROTO_DEFINE_DEEP_COPY_FUN(Z, N, DATA) \
+ proto::deep_copy(e.proto_base().BOOST_PP_CAT(child, N)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deep_copy.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file deep_copy.hpp
+ /// Replace all nodes stored by reference by nodes stored by value.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/deep_copy.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFINE_DEEP_COPY_FUN
+ #undef BOOST_PROTO_DEFINE_DEEP_COPY_TYPE
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Expr>
+ struct deep_copy_impl<Expr, N>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~)
+ >
+ >::type
+ expr_type;
+
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)
+ };
+
+ return proto_generator()(that);
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/expr.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,455 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #ifndef BOOST_NO_VARIADIC_TEMPLATES
+ #include <boost/proto/detail/preprocessed/expr_variadic.hpp>
+ #else
+ #include <boost/proto/detail/preprocessed/expr.hpp>
+ #endif
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_CHILD(Z, N, DATA) \
+ typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
+ BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
+ /**< INTERNAL ONLY */
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_VOID(Z, N, DATA) \
+ typedef void BOOST_PP_CAT(proto_child, N); \
+ /**< INTERNAL ONLY */
+
+ // Generate variadic versions of expr
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/expr_variadic.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file expr_variadic.hpp
+ /// Contains definition of expr\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ // The expr<> specializations are actually defined here.
+ #define BOOST_PROTO_DEFINE_TERMINAL
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, 0, <boost/proto/detail/expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #undef BOOST_PROTO_DEFINE_TERMINAL
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ // Generate non-variadic versions of expr
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #define BOOST_NO_VARIADIC_TEMPLATES
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/expr.hpp")
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file expr.hpp
+ /// Contains definition of expr\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+ #pragma wave option(preserve: 1)
+
+ // The expr<> specializations are actually defined here.
+ #define BOOST_PROTO_DEFINE_TERMINAL
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/proto/detail/expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #undef BOOST_PROTO_DEFINE_TERMINAL
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #pragma wave option(output: null)
+ #undef BOOST_NO_VARIADIC_TEMPLATES
+ #endif
+
+ #undef BOOST_PROTO_CHILD
+ #undef BOOST_PROTO_VOID
+
+#else
+
+ #define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION())
+
+ /// \brief Representation of a node in an expression tree.
+ ///
+ /// \c proto::expr\<\> is a node in an expression template tree. It
+ /// is a container for its child sub-trees. It also serves as
+ /// the terminal nodes of the tree.
+ ///
+ /// \c Tag is type that represents the operation encoded by
+ /// this expression. It is typically one of the structs
+ /// in the \c boost::proto::tag namespace, but it doesn't
+ /// have to be.
+ ///
+ /// \c Args is a type list representing the type of the children
+ /// of this expression. It is an instantiation of one
+ /// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The
+ /// child types must all themselves be either \c expr\<\>
+ /// or <tt>proto::expr\<\>&</tt>. If \c Args is an
+ /// instantiation of \c proto::term\<\> then this
+ /// \c expr\<\> type represents a terminal expression;
+ /// the parameter to the \c proto::term\<\> template
+ /// represents the terminal's value type.
+ ///
+ /// \c Arity is an integral constant representing the number of child
+ /// nodes this node contains. If \c Arity is 0, then this
+ /// node is a terminal.
+ ///
+ /// \c proto::expr\<\> is a valid Fusion random-access sequence, where
+ /// the elements of the sequence are the child expressions.
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ template<typename Tag, typename Arg0>
+ struct expr<Tag, term<Arg0>, 0>
+ #else
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
+ struct expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
+ #endif
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = BOOST_PP_ITERATION();
+ typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
+ typedef expr proto_base_expr;
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ typedef term<Arg0> proto_args;
+ #else
+ typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
+ #endif
+ typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_; /**< INTERNAL ONLY */
+
+ BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
+ BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
+
+ /// \return *this
+ ///
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+ /// \overload
+ ///
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \return A new \c expr\<\> object initialized with the specified
+ /// arguments.
+ ///
+ template<typename A0>
+ static expr const make(A0 &a0)
+ {
+ return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
+ }
+
+ /// \overload
+ ///
+ template<typename A0>
+ static expr const make(A0 const &a0)
+ {
+ return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
+ }
+ #else
+ /// \return A new \c expr\<\> object initialized with the specified
+ /// arguments.
+ ///
+ template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
+ static expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
+ {
+ expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
+ return that;
+ }
+ #endif
+
+ #if 1 == BOOST_PP_ITERATION()
+ /// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is
+ /// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>.
+ /// Otherwise, it is some undefined type.
+ typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
+
+ /// \return The address of <tt>this->child0</tt> if \c Tag is
+ /// \c boost::proto::tag::address_of. Otherwise, this function will
+ /// fail to compile.
+ ///
+ /// \attention Proto overloads <tt>operator&</tt>, which means that
+ /// proto-ified objects cannot have their addresses taken, unless we use
+ /// the following hack to make \c &x implicitly convertible to \c X*.
+ operator address_of_hack_type_() const
+ {
+ return boost::addressof(this->child0);
+ }
+ #else
+ /// INTERNAL ONLY
+ ///
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ #endif
+
+ /// Assignment
+ ///
+ /// \param a The rhs.
+ /// \return A new \c expr\<\> node representing an assignment of \c that to \c *this.
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+ /// Assignment
+ ///
+ /// \param a The rhs.
+ /// \return A new \c expr\<\> node representing an assignment of \c a to \c *this.
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+ /// \overload
+ ///
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \overload
+ ///
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+ /// \overload
+ ///
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+ #endif
+
+ /// Subscript
+ ///
+ /// \param a The rhs.
+ /// \return A new \c expr\<\> node representing \c *this subscripted with \c a.
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+ /// \overload
+ ///
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \overload
+ ///
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a)
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+ /// \overload
+ ///
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a)
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+ #endif
+
+ /// Encodes the return type of \c expr\<\>::operator(), for use with \c boost::result_of\<\>
+ ///
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+ #ifndef BOOST_NO_VARIADIC_TEMPLATES
+ /// \overload
+ ///
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \overload
+ ///
+ template<typename ...A>
+ typename result_of::funop<
+ expr(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a)
+ {
+ return result_of::funop<
+ expr(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ #endif
+
+ #else // BOOST_NO_VARIADIC_TEMPLATES
+
+ /// Function call
+ ///
+ /// \return A new \c expr\<\> node representing the function invocation of \c (*this)().
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \overload
+ ///
+ proto::expr<proto::tag::function, list1<expr &>, 1> const
+ operator ()()
+ {
+ proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this};
+ return that;
+ }
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_2 \
+ (3, (1, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/expr_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+#endif
+ };
+
+#undef ARG_COUNT
+
+#endif

Deleted: branches/release/boost/proto/detail/expr0.hpp
==============================================================================
--- branches/release/boost/proto/detail/expr0.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
+++ (empty file)
@@ -1,460 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// expr.hpp
-// Contains definition of expr\<\> class template.
-//
-// Copyright 2008 Eric Niebler. 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)
-
-#ifndef BOOST_PP_IS_ITERATING
-#error Do not include this file directly
-#endif
-
-#define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION())
-
- /// \brief Simplified representation of a node in an expression tree.
- ///
- /// \c proto::basic_expr\<\> is a node in an expression template tree. It
- /// is a container for its child sub-trees. It also serves as
- /// the terminal nodes of the tree.
- ///
- /// \c Tag is type that represents the operation encoded by
- /// this expression. It is typically one of the structs
- /// in the \c boost::proto::tag namespace, but it doesn't
- /// have to be.
- ///
- /// \c Args is a type list representing the type of the children
- /// of this expression. It is an instantiation of one
- /// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The
- /// child types must all themselves be either \c expr\<\>
- /// or <tt>proto::expr\<\>&</tt>. If \c Args is an
- /// instantiation of \c proto::term\<\> then this
- /// \c expr\<\> type represents a terminal expression;
- /// the parameter to the \c proto::term\<\> template
- /// represents the terminal's value type.
- ///
- /// \c Arity is an integral constant representing the number of child
- /// nodes this node contains. If \c Arity is 0, then this
- /// node is a terminal.
- ///
- /// \c proto::basic_expr\<\> is a valid Fusion random-access sequence, where
- /// the elements of the sequence are the child expressions.
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- template<typename Tag, typename Arg0>
- struct basic_expr<Tag, term<Arg0>, 0>
- #else
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
- struct basic_expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
- #endif
- {
- typedef Tag proto_tag;
- BOOST_STATIC_CONSTANT(long, proto_arity_c = BOOST_PP_ITERATION());
- typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
- typedef basic_expr proto_base_expr;
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- typedef term<Arg0> proto_args;
- #else
- typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
- #endif
- typedef basic_expr proto_grammar;
- typedef default_domain proto_domain;
- typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
- typedef basic_expr proto_derived_expr;
- typedef void proto_is_expr_; /**< INTERNAL ONLY */
-
- BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
- BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
-
- /// \return *this
- ///
- basic_expr const &proto_base() const
- {
- return *this;
- }
-
- /// \overload
- ///
- basic_expr &proto_base()
- {
- return *this;
- }
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- /// \return A new \c expr\<\> object initialized with the specified
- /// arguments.
- ///
- template<typename A0>
- static basic_expr const make(A0 &a0)
- {
- return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
- }
-
- /// \overload
- ///
- template<typename A0>
- static basic_expr const make(A0 const &a0)
- {
- return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
- }
- #else
- /// \return A new \c expr\<\> object initialized with the specified
- /// arguments.
- ///
- template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
- static basic_expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
- {
- basic_expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
- return that;
- }
- #endif
-
- #if 1 == BOOST_PP_ITERATION()
- /// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is
- /// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>.
- /// Otherwise, it is some undefined type.
- typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
-
- /// \return The address of <tt>this->child0</tt> if \c Tag is
- /// \c boost::proto::tag::address_of. Otherwise, this function will
- /// fail to compile.
- ///
- /// \attention Proto overloads <tt>operator&</tt>, which means that
- /// proto-ified objects cannot have their addresses taken, unless we use
- /// the following hack to make \c &x implicitly convertible to \c X*.
- operator address_of_hack_type_() const
- {
- return boost::addressof(this->child0);
- }
- #else
- /// INTERNAL ONLY
- ///
- typedef detail::not_a_valid_type address_of_hack_type_;
- #endif
- };
-
- /// \brief Representation of a node in an expression tree.
- ///
- /// \c proto::expr\<\> is a node in an expression template tree. It
- /// is a container for its child sub-trees. It also serves as
- /// the terminal nodes of the tree.
- ///
- /// \c Tag is type that represents the operation encoded by
- /// this expression. It is typically one of the structs
- /// in the \c boost::proto::tag namespace, but it doesn't
- /// have to be.
- ///
- /// \c Args is a type list representing the type of the children
- /// of this expression. It is an instantiation of one
- /// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The
- /// child types must all themselves be either \c expr\<\>
- /// or <tt>proto::expr\<\>&</tt>. If \c Args is an
- /// instantiation of \c proto::term\<\> then this
- /// \c expr\<\> type represents a terminal expression;
- /// the parameter to the \c proto::term\<\> template
- /// represents the terminal's value type.
- ///
- /// \c Arity is an integral constant representing the number of child
- /// nodes this node contains. If \c Arity is 0, then this
- /// node is a terminal.
- ///
- /// \c proto::expr\<\> is a valid Fusion random-access sequence, where
- /// the elements of the sequence are the child expressions.
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- template<typename Tag, typename Arg0>
- struct expr<Tag, term<Arg0>, 0>
- #else
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
- struct expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
- #endif
- {
- typedef Tag proto_tag;
- BOOST_STATIC_CONSTANT(long, proto_arity_c = BOOST_PP_ITERATION());
- typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
- typedef expr proto_base_expr;
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- typedef term<Arg0> proto_args;
- #else
- typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
- #endif
- typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar;
- typedef default_domain proto_domain;
- typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
- typedef expr proto_derived_expr;
- typedef void proto_is_expr_; /**< INTERNAL ONLY */
-
- BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
- BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
-
- /// \return *this
- ///
- expr const &proto_base() const
- {
- return *this;
- }
-
- /// \overload
- ///
- expr &proto_base()
- {
- return *this;
- }
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- /// \return A new \c expr\<\> object initialized with the specified
- /// arguments.
- ///
- template<typename A0>
- static expr const make(A0 &a0)
- {
- return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
- }
-
- /// \overload
- ///
- template<typename A0>
- static expr const make(A0 const &a0)
- {
- return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
- }
- #else
- /// \return A new \c expr\<\> object initialized with the specified
- /// arguments.
- ///
- template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
- static expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
- {
- expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
- return that;
- }
- #endif
-
- #if 1 == BOOST_PP_ITERATION()
- /// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is
- /// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>.
- /// Otherwise, it is some undefined type.
- typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
-
- /// \return The address of <tt>this->child0</tt> if \c Tag is
- /// \c boost::proto::tag::address_of. Otherwise, this function will
- /// fail to compile.
- ///
- /// \attention Proto overloads <tt>operator&</tt>, which means that
- /// proto-ified objects cannot have their addresses taken, unless we use
- /// the following hack to make \c &x implicitly convertible to \c X*.
- operator address_of_hack_type_() const
- {
- return boost::addressof(this->child0);
- }
- #else
- /// INTERNAL ONLY
- ///
- typedef detail::not_a_valid_type address_of_hack_type_;
- #endif
-
- /// Assignment
- ///
- /// \param a The rhs.
- /// \return A new \c expr\<\> node representing an assignment of \c that to \c *this.
- proto::expr<
- proto::tag::assign
- , list2<expr &, expr const &>
- , 2
- > const
- operator =(expr const &a)
- {
- proto::expr<
- proto::tag::assign
- , list2<expr &, expr const &>
- , 2
- > that = {*this, a};
- return that;
- }
-
- /// Assignment
- ///
- /// \param a The rhs.
- /// \return A new \c expr\<\> node representing an assignment of \c a to \c *this.
- template<typename A>
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator =(A &a) const
- {
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
- /// \overload
- ///
- template<typename A>
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator =(A const &a) const
- {
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- /// \overload
- ///
- template<typename A>
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator =(A &a)
- {
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
- /// \overload
- ///
- template<typename A>
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator =(A const &a)
- {
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
- #endif
-
- /// Subscript
- ///
- /// \param a The rhs.
- /// \return A new \c expr\<\> node representing \c *this subscripted with \c a.
- template<typename A>
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator [](A &a) const
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
- /// \overload
- ///
- template<typename A>
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator [](A const &a) const
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- /// \overload
- ///
- template<typename A>
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator [](A &a)
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
- /// \overload
- ///
- template<typename A>
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator [](A const &a)
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
- #endif
-
- /// Encodes the return type of \c expr\<\>::operator(), for use with \c boost::result_of\<\>
- ///
- template<typename Sig>
- struct result
- {
- typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
- };
-
- /// Function call
- ///
- /// \return A new \c expr\<\> node representing the function invocation of \c (*this)().
- proto::expr<proto::tag::function, list1<expr const &>, 1> const
- operator ()() const
- {
- proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
- return that;
- }
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- /// \overload
- ///
- proto::expr<proto::tag::function, list1<expr &>, 1> const
- operator ()()
- {
- proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this};
- return that;
- }
- #endif
-
-#define BOOST_PP_ITERATION_PARAMS_2 (3, (1, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/expr1.hpp>))
-#include BOOST_PP_ITERATE()
- };
-
-#undef ARG_COUNT

Deleted: branches/release/boost/proto/detail/expr1.hpp
==============================================================================
--- branches/release/boost/proto/detail/expr1.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
+++ (empty file)
@@ -1,47 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// expr1.hpp
-// Contains definition of expr\<\>::operator() overloads.
-//
-// Copyright 2008 Eric Niebler. 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)
-
-#ifndef BOOST_PP_IS_ITERATING
-#error Do not include this file directly
-#endif
-
-#define N BOOST_PP_ITERATION()
-
- /// \overload
- ///
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- typename result_of::BOOST_PP_CAT(funop, N)<
- expr const
- , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >::type const
- operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
- {
- return result_of::BOOST_PP_CAT(funop, N)<
- expr const
- , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a));
- }
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- /// \overload
- ///
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- typename result_of::BOOST_PP_CAT(funop, N)<
- expr
- , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >::type const
- operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a))
- {
- return result_of::BOOST_PP_CAT(funop, N)<
- expr
- , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a));
- }
- #endif
-
-#undef N

Added: branches/release/boost/proto/detail/expr_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/expr_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////
+// expr1.hpp
+// Contains definition of expr\<\>::operator() overloads.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#define N BOOST_PP_ITERATION()
+
+ /// \overload
+ ///
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ typename result_of::BOOST_PP_CAT(funop, N)<
+ expr const
+ , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >::type const
+ operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
+ {
+ return result_of::BOOST_PP_CAT(funop, N)<
+ expr const
+ , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a));
+ }
+
+ #ifdef BOOST_PROTO_DEFINE_TERMINAL
+ /// \overload
+ ///
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ typename result_of::BOOST_PP_CAT(funop, N)<
+ expr
+ , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >::type const
+ operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a))
+ {
+ return result_of::BOOST_PP_CAT(funop, N)<
+ expr
+ , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a));
+ }
+ #endif
+
+#undef N

Added: branches/release/boost/proto/detail/extends_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/extends_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,43 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #ifndef BOOST_NO_VARIADIC_TEMPLATES
+ BOOST_PROTO_EXTENDS_FUNCTION_()
+ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PP_EMPTY)
+ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST)
+ #else
+ #include <boost/proto/detail/preprocessed/extends_funop.hpp>
+ #endif
+
+#else
+
+ #define BOOST_PP_LOCAL_MACRO(N) \
+ BOOST_PROTO_DEFINE_FUN_OP(1, N, ~) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) && !defined(BOOST_PROTO_NO_WAVE_OUTPUT)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/extends_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file extends_funop.hpp
+ /// Definitions for extends\<\>::operator()
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) && !defined(BOOST_PROTO_NO_WAVE_OUTPUT)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ BOOST_PROTO_EXTENDS_FUNCTION_()
+
+ #define BOOST_PP_LOCAL_LIMITS \
+ (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY))
+ #include BOOST_PP_LOCAL_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) && !defined(BOOST_PROTO_NO_WAVE_OUTPUT)
+ #pragma wave option(output: null)
+ #endif
+
+#endif

Added: branches/release/boost/proto/detail/extends_funop_const.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/extends_funop_const.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,42 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #ifndef BOOST_NO_VARIADIC_TEMPLATES
+ BOOST_PROTO_EXTENDS_FUNCTION_()
+ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST)
+ #else
+ #include <boost/proto/detail/preprocessed/extends_funop_const.hpp>
+ #endif
+
+#else
+
+ #define BOOST_PP_LOCAL_MACRO(N) \
+ BOOST_PROTO_DEFINE_FUN_OP_CONST(1, N, ~) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/extends_funop_const.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file extends_funop_const.hpp
+ /// Definitions for extends\<\>::operator()
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ BOOST_PROTO_EXTENDS_FUNCTION_()
+
+ #define BOOST_PP_LOCAL_LIMITS \
+ (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY))
+ #include BOOST_PP_LOCAL_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#endif

Modified: branches/release/boost/proto/detail/funop.hpp
==============================================================================
--- branches/release/boost/proto/detail/funop.hpp (original)
+++ branches/release/boost/proto/detail/funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,36 +1,59 @@
-///////////////////////////////////////////////////////////////////////////////
-// funop.hpp
-// Contains definition of funop[n]\<\> class template.
-//
-// Copyright 2008 Eric Niebler. 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)
-
-#ifndef BOOST_PP_IS_ITERATING
-#error Do not include this file directly
-#endif
-
-#define M0(Z, N, DATA) \
- typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \
- /**/
-
-#define M1(Z, N, DATA) \
- proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \
- /**/
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
+ typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \
+ /**/
+
+ #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
+ proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // funop.hpp
+ // Contains definition of funop[n]\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #undef BOOST_PROTO_AS_CHILD
+ #undef BOOST_PROTO_AS_CHILD_TYPE
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
 
     /// \brief A helper metafunction for computing the
     /// return type of \c proto::expr\<\>::operator().
     template<typename Expr, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A)>
     struct BOOST_PP_CAT(funop, BOOST_PP_ITERATION())
     {
- typedef proto::expr<
- tag::function
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
           , BOOST_PP_CAT(list, BOOST_PP_INC(BOOST_PP_ITERATION()))<
                 Expr &
- BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M0, ~)
+ BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD_TYPE, ~)
>
- , BOOST_PP_INC(BOOST_PP_ITERATION())
- > type;
+ >::type type;
 
         static type const call(
             Expr &e
@@ -39,7 +62,7 @@
         {
             type that = {
                 e
- BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M1, ~)
+ BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD, ~)
             };
             return that;
         }
@@ -60,5 +83,4 @@
>
     {};
 
-#undef M0
-#undef M1
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: branches/release/boost/proto/detail/generate_by_value.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/generate_by_value.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,91 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/generate_by_value.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/generate_by_value.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file generate_by_value.hpp
+ /// Contains definition of by_value_generator_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/generate_by_value.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
+ struct by_value_generator_<
+ proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
+ >
+ {
+ typedef
+ BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
+ src_args;
+
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
+ >
+ dst_args;
+
+ typedef proto::expr<Tag, src_args, N> src_type;
+ typedef proto::expr<Tag, dst_args, N> type;
+
+ static type const call(src_type const &e)
+ {
+ type that = {
+ BOOST_PP_ENUM_PARAMS(N, e.child)
+ };
+ return that;
+ }
+ };
+
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
+ >
+ {
+ typedef
+ BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
+ src_args;
+
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
+ >
+ dst_args;
+
+ typedef proto::basic_expr<Tag, src_args, N> src_type;
+ typedef proto::basic_expr<Tag, dst_args, N> type;
+
+ static type const call(src_type const &e)
+ {
+ type that = {
+ BOOST_PP_ENUM_PARAMS(N, e.child)
+ };
+ return that;
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/lambda_matches.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/lambda_matches.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,61 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/lambda_matches.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_DEFINE_LAMBDA_MATCHES(Z, N, DATA) \
+ lambda_matches< \
+ BOOST_PP_CAT(Expr, N) \
+ , BOOST_PP_CAT(Grammar, N) \
+ >
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/lambda_matches.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file lambda_matches.hpp
+ /// Specializations of the lambda_matches template
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/lambda_matches.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFINE_LAMBDA_MATCHES
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<
+ template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class T
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Expr)
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Grammar)
+ >
+ struct lambda_matches<
+ T<BOOST_PP_ENUM_PARAMS(N, Expr)>
+ , T<BOOST_PP_ENUM_PARAMS(N, Grammar)>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(N)
+ >
+ : BOOST_PP_CAT(and_, N)<
+ BOOST_PROTO_DEFINE_LAMBDA_MATCHES(~, 0, ~)::value,
+ BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_LAMBDA_MATCHES, ~)
+ >
+ {};
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/make_expr.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/make_expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,73 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/make_expr.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr.hpp
+ /// Contains overloads of make_expr() free function.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \overload
+ ///
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >
+ >::type const
+ make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >()(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename C)>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
+ >::type const
+ make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const C, &c))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
+ >()(BOOST_PP_ENUM_PARAMS(N, c));
+ }
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/make_expr_.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/make_expr_.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,103 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/make_expr_.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ template<
+ typename Tag
+ , typename Domain
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ BOOST_PROTO_MAX_ARITY
+ , typename A
+ , = void BOOST_PP_INTERCEPT
+ )
+ , typename _ = void
+ >
+ struct make_expr_
+ {};
+
+ template<typename Domain, typename A>
+ struct make_expr_<tag::terminal, Domain, A
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
+ {
+ typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
+
+ result_type operator()(typename add_reference<A>::type a) const
+ {
+ return proto::detail::protoify<A, Domain>()(a);
+ }
+ };
+
+ template<typename A>
+ struct make_expr_<tag::terminal, deduce_domain, A
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
+ : make_expr_<tag::terminal, default_domain, A>
+ {};
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+ #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
+
+ template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make_expr_<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
+ {
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD_TYPE, (A, ~, Domain))
+ >
+ proto_args;
+
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+
+ result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<A, >::type a)) const
+ {
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD, (A, a, Domain))
+ };
+ return proto_generator()(that);
+ }
+ };
+
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make_expr_<Tag, deduce_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
+ : make_expr_<
+ Tag
+ , typename BOOST_PP_CAT(deduce_domain, N)<BOOST_PP_ENUM_PARAMS(N, A)>::type
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ >
+ {};
+
+ #undef N
+ #undef M
+
+#endif

Added: branches/release/boost/proto/detail/make_expr_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/make_expr_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,66 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/make_expr_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_funop.hpp
+ /// Contains definition of make_expr\<\>::operator() member functions.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ >::type
+ type;
+ };
+
+ /// \overload
+ ///
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >::type const
+ operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >()(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/matches_.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/matches_.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,96 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/matches_.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_MATCHES_N_FUN(Z, N, DATA) \
+ matches_< \
+ typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_derived_expr \
+ , typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_grammar \
+ , typename Args2::BOOST_PP_CAT(child, N)::proto_grammar \
+ >
+
+ #define BOOST_PROTO_DEFINE_MATCHES(Z, N, DATA) \
+ matches_< \
+ Expr \
+ , BasicExpr \
+ , typename BOOST_PP_CAT(G, N)::proto_grammar \
+ >
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/matches_.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file matches_.hpp
+ /// Definitions of matches_ specializations
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PP_MAX(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_MAX_LOGICAL_ARITY), <boost/proto/detail/matches_.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFINE_MATCHES
+ #undef BOOST_PROTO_MATCHES_N_FUN
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ #if N <= BOOST_PROTO_MAX_LOGICAL_ARITY
+
+ // handle proto::or_
+ template<typename Expr, typename BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, typename G)>
+ struct matches_<Expr, BasicExpr, proto::or_<BOOST_PP_ENUM_PARAMS(N, G)> >
+ : BOOST_PP_CAT(or_, N)<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, G)
+ >
+ {};
+
+ // handle proto::and_
+ template<typename Expr, typename BasicExpr, BOOST_PP_ENUM_PARAMS(N, typename G)>
+ struct matches_<Expr, BasicExpr, proto::and_<BOOST_PP_ENUM_PARAMS(N, G)> >
+ : detail::BOOST_PP_CAT(and_, N)<
+ BOOST_PROTO_DEFINE_MATCHES(~, 0, ~)::value,
+ BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_MATCHES, ~)
+ >
+ {};
+
+ #endif
+
+ #if N <= BOOST_PROTO_MAX_ARITY
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, N>, proto::basic_expr<Tag, Args2, N> >
+ : BOOST_PP_CAT(and_, N)<
+ BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
+ BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)
+ >
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, N>, proto::basic_expr<proto::_, Args2, N> >
+ : BOOST_PP_CAT(and_, N)<
+ BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
+ BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)
+ >
+ {};
+
+ #endif
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/memfun_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/memfun_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,44 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/memfun_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/memfun_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // memfun_funop.hpp
+ // Contains overloads of memfun::operator().
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/memfun_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: branches/release/boost/proto/detail/or_n.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/or_n.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,59 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/or_n.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/or_n.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file or_n.hpp
+ /// Definitions of or_N
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_LOGICAL_ARITY, <boost/proto/detail/or_n.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<bool B, typename Expr, typename BasicExpr, BOOST_PP_ENUM_PARAMS(N, typename G)>
+ struct BOOST_PP_CAT(or_, N)
+ #if 2 == N
+ : mpl::bool_<matches_<Expr, BasicExpr, typename G1::proto_grammar>::value>
+ {
+ typedef G1 which;
+ };
+ #else
+ : BOOST_PP_CAT(or_, BOOST_PP_DEC(N))<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, BOOST_PP_ENUM_SHIFTED_PARAMS(N, G)
+ >
+ {};
+ #endif
+
+ template<typename Expr, typename BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, typename G)>
+ struct BOOST_PP_CAT(or_, N)<true, Expr, BasicExpr, BOOST_PP_ENUM_PARAMS(N, G)>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+
+ #undef N
+
+#endif

Modified: branches/release/boost/proto/detail/poly_function.hpp
==============================================================================
--- branches/release/boost/proto/detail/poly_function.hpp (original)
+++ branches/release/boost/proto/detail/poly_function.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,297 +1,219 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file poly_function.hpp
- /// A wrapper that makes a tr1-style function object that handles const
- /// and non-const refs and reference_wrapper arguments, too, and forwards
- /// the arguments on to the specified implementation.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02
- #define BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02
-
- #include <boost/ref.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/mpl/void.hpp>
- #include <boost/mpl/size_t.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/proto/proto_fwd.hpp>
-
- #ifdef _MSC_VER
- # pragma warning(push)
- # pragma warning(disable: 4181) // const applied to reference type
- #endif
-
- namespace boost { namespace proto { namespace detail
- {
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T>
- struct normalize_arg
- {
- typedef T type;
- typedef T const &reference;
- };
+///////////////////////////////////////////////////////////////////////////////
+/// \file poly_function.hpp
+/// A wrapper that makes a tr1-style function object that handles const
+/// and non-const refs and reference_wrapper arguments, too, and forwards
+/// the arguments on to the specified implementation.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02
+#define BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02
+
+#include <boost/ref.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/proto/proto_fwd.hpp>
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4181) // const applied to reference type
+#endif
 
- template<typename T>
- struct normalize_arg<T &>
- {
- typedef T type;
- typedef T const &reference;
- };
+namespace boost { namespace proto { namespace detail
+{
 
- template<typename T>
- struct normalize_arg<T const &>
- {
- typedef T type;
- typedef T const &reference;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename T>
+ struct normalize_arg
+ {
+ typedef T type;
+ typedef T const &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<T &>
+ {
+ typedef T type;
+ typedef T const &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<T const &>
+ {
+ typedef T type;
+ typedef T const &reference;
+ };
 
- template<typename T>
- struct normalize_arg<boost::reference_wrapper<T> >
+ template<typename T>
+ struct normalize_arg<boost::reference_wrapper<T> >
+ {
+ typedef T &type;
+ typedef T &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<boost::reference_wrapper<T> &>
+ {
+ typedef T &type;
+ typedef T &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<boost::reference_wrapper<T> const &>
+ {
+ typedef T &type;
+ typedef T &reference;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename T>
+ struct arg
+ {
+ typedef T const &type;
+
+ arg(type t)
+ : value(t)
+ {}
+
+ operator type() const
         {
- typedef T &type;
- typedef T &reference;
- };
+ return this->value;
+ }
 
- template<typename T>
- struct normalize_arg<boost::reference_wrapper<T> &>
+ type operator()() const
         {
- typedef T &type;
- typedef T &reference;
- };
+ return *this;
+ }
+
+ private:
+ arg &operator =(arg const &);
+ type value;
+ };
+
+ template<typename T>
+ struct arg<T &>
+ {
+ typedef T &type;
+
+ arg(type t)
+ : value(t)
+ {}
 
- template<typename T>
- struct normalize_arg<boost::reference_wrapper<T> const &>
+ operator type() const
         {
- typedef T &type;
- typedef T &reference;
- };
+ return this->value;
+ }
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T>
- struct arg
+ type operator()() const
         {
- typedef T const &type;
+ return *this;
+ }
 
- arg(type t)
- : value(t)
- {}
-
- operator type() const
- {
- return this->value;
- }
-
- type operator()() const
- {
- return *this;
- }
-
- private:
- arg &operator =(arg const &);
- type value;
- };
+ private:
+ arg &operator =(arg const &);
+ type value;
+ };
 
- template<typename T>
- struct arg<T &>
- {
- typedef T &type;
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename T, typename Void = void>
+ struct is_poly_function
+ : mpl::false_
+ {};
 
- arg(type t)
- : value(t)
- {}
-
- operator type() const
- {
- return this->value;
- }
-
- type operator()() const
- {
- return *this;
- }
-
- private:
- arg &operator =(arg const &);
- type value;
- };
+ template<typename T>
+ struct is_poly_function<T, typename T::is_poly_function_base_>
+ : mpl::true_
+ {};
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T, typename Void = void>
- struct is_poly_function
- : mpl::false_
- {};
-
- template<typename T>
- struct is_poly_function<T, typename T::is_poly_function_base_>
- : mpl::true_
- {};
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- #define BOOST_PROTO_POLY_FUNCTION() \
- typedef void is_poly_function_base_; \
- /**/
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ #define BOOST_PROTO_POLY_FUNCTION() \
+ typedef void is_poly_function_base_; \
+ /**/
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- struct poly_function_base
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ struct poly_function_base
+ {
+ /// INTERNAL ONLY
+ BOOST_PROTO_POLY_FUNCTION()
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename Derived, typename NullaryResult = void>
+ struct poly_function
+ : poly_function_base
+ {
+ template<typename Sig>
+ struct result;
+
+ template<typename This>
+ struct result<This()>
+ : Derived::template impl<>
         {
- /// INTERNAL ONLY
- BOOST_PROTO_POLY_FUNCTION()
+ typedef typename result::result_type type;
         };
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Derived, typename NullaryResult = void>
- struct poly_function
- : poly_function_base
+ NullaryResult operator()() const
         {
- template<typename Sig>
- struct result;
+ result<Derived const()> impl;
+ return impl();
+ }
 
- template<typename This>
- struct result<This()>
- : Derived::template impl<>
- {
- typedef typename result::result_type type;
- };
-
- NullaryResult operator()() const
- {
- result<Derived const()> impl;
- return impl();
- }
+ #include <boost/proto/detail/poly_function_funop.hpp>
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function.hpp>, 0))
- #include BOOST_PP_ITERATE()
- };
+ template<typename T>
+ struct wrap_t;
 
- template<typename T>
- struct wrap_t;
+ typedef char poly_function_t;
+ typedef char (&mono_function_t)[2];
+ typedef char (&unknown_function_t)[3];
 
- typedef char poly_function_t;
- typedef char (&mono_function_t)[2];
- typedef char (&unknown_function_t)[3];
-
- template<typename T> poly_function_t test_poly_function(T *, wrap_t<typename T::is_poly_function_base_> * = 0);
- template<typename T> mono_function_t test_poly_function(T *, wrap_t<typename T::result_type> * = 0);
- template<typename T> unknown_function_t test_poly_function(T *, ...);
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Fun, typename Sig, typename Switch = mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> >
- struct poly_function_traits
- {
- typedef typename Fun::template result<Sig>::type result_type;
- typedef Fun function_type;
- };
+ template<typename T> poly_function_t test_poly_function(T *, wrap_t<typename T::is_poly_function_base_> * = 0);
+ template<typename T> mono_function_t test_poly_function(T *, wrap_t<typename T::result_type> * = 0);
+ template<typename T> unknown_function_t test_poly_function(T *, ...);
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Fun, typename Sig>
- struct poly_function_traits<Fun, Sig, mpl::size_t<sizeof(mono_function_t)> >
- {
- typedef typename Fun::result_type result_type;
- typedef Fun function_type;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename Fun, typename Sig, typename Switch = mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> >
+ struct poly_function_traits
+ {
+ typedef typename Fun::template result<Sig>::type result_type;
+ typedef Fun function_type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename Fun, typename Sig>
+ struct poly_function_traits<Fun, Sig, mpl::size_t<sizeof(mono_function_t)> >
+ {
+ typedef typename Fun::result_type result_type;
+ typedef Fun function_type;
+ };
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFunSig, bool IsPolyFunction>
- struct as_mono_function_impl;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFunSig>
- struct as_mono_function;
-
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function.hpp>, 1))
- #include BOOST_PP_ITERATE()
-
- }}} // namespace boost::proto::detail
-
- #ifdef _MSC_VER
- # pragma warning(pop)
- #endif
-
- #endif
-
-#elif 0 == BOOST_PP_ITERATION_FLAGS()
-
- #define N BOOST_PP_ITERATION()
-
- template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
- : Derived::template impl<
- BOOST_PP_ENUM_BINARY_PARAMS(
- N
- , typename normalize_arg<A
- , >::type BOOST_PP_INTERCEPT
- )
- >
- {
- typedef typename result::result_type type;
- };
-
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- typename result<
- Derived const(
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
- )
- >::type
- operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
- {
- result<
- Derived const(
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
- )
- > impl;
-
- #define M0(Z, N, DATA) \
- static_cast<typename normalize_arg<BOOST_PP_CAT(A, N) const &> \
- ::reference>(BOOST_PP_CAT(a, N))
- return impl(BOOST_PP_ENUM(N, M0, ~));
- #undef M0
- }
-
- #undef N
-
-#elif 1 == BOOST_PP_ITERATION_FLAGS()
-
- #define N BOOST_PP_ITERATION()
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> >
- {
- typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type;
- typedef typename function_type::result_type result_type;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFunSig, bool IsPolyFunction>
+ struct as_mono_function_impl;
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), true>
- {
- typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> type;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFunSig>
+ struct as_mono_function;
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), false>
- {
- typedef PolyFun type;
- };
+ #include <boost/proto/detail/poly_function_traits.hpp>
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct as_mono_function<PolyFun(BOOST_PP_ENUM_PARAMS(N, A))>
- : as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), is_poly_function<PolyFun>::value>
- {};
+}}} // namespace boost::proto::detail
 
- #undef N
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
 
 #endif
+

Added: branches/release/boost/proto/detail/poly_function_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/poly_function_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,74 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/poly_function_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_NORMALIZE_ARG(Z, N, DATA) \
+ static_cast<typename normalize_arg<BOOST_PP_CAT(A, N) const &> \
+ ::reference>(BOOST_PP_CAT(a, N)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/poly_function_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_funop.hpp
+ // Contains overloads of poly_function\<\>::operator()
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_NORMALIZE_ARG
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
+ : Derived::template impl<
+ BOOST_PP_ENUM_BINARY_PARAMS(
+ N
+ , typename normalize_arg<A
+ , >::type BOOST_PP_INTERCEPT
+ )
+ >
+ {
+ typedef typename result::result_type type;
+ };
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ typename result<
+ Derived const(
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
+ )
+ >::type
+ operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
+ {
+ result<
+ Derived const(
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
+ )
+ > impl;
+
+ return impl(BOOST_PP_ENUM(N, BOOST_PROTO_NORMALIZE_ARG, ~));
+ }
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: branches/release/boost/proto/detail/poly_function_traits.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/poly_function_traits.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,65 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/poly_function_traits.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/poly_function_traits.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_traits.hpp
+ // Contains specializations of poly_function_traits and as_mono_function
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function_traits.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), true>
+ {
+ typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), false>
+ {
+ typedef PolyFun type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct as_mono_function<PolyFun(BOOST_PP_ENUM_PARAMS(N, A))>
+ : as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), is_poly_function<PolyFun>::value>
+ {};
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: branches/release/boost/proto/detail/preprocessed/and_n.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/and_n.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,310 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file and_n.hpp
+ /// Definitions of and_N, and_impl
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+ template<bool B, typename P0>
+ struct and_2
+ : mpl::bool_<P0::value>
+ {};
+ template<typename P0>
+ struct and_2<false, P0>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1;
+ typedef typename Gimpl1::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d);
+ return Gimpl1()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1>
+ struct and_3
+ : and_2<
+ P0::value ,
+ P1
+ >
+ {};
+ template<typename P0 , typename P1>
+ struct and_3<false, P0 , P1>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2;
+ typedef typename Gimpl2::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d);
+ return Gimpl2()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2>
+ struct and_4
+ : and_3<
+ P0::value ,
+ P1 , P2
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2>
+ struct and_4<false, P0 , P1 , P2>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3;
+ typedef typename Gimpl3::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d);
+ return Gimpl3()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2 , typename P3>
+ struct and_5
+ : and_4<
+ P0::value ,
+ P1 , P2 , P3
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2 , typename P3>
+ struct and_5<false, P0 , P1 , P2 , P3>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4;
+ typedef typename Gimpl4::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d);
+ return Gimpl4()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4>
+ struct and_6
+ : and_5<
+ P0::value ,
+ P1 , P2 , P3 , P4
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4>
+ struct and_6<false, P0 , P1 , P2 , P3 , P4>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5;
+ typedef typename Gimpl5::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d);
+ return Gimpl5()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5>
+ struct and_7
+ : and_6<
+ P0::value ,
+ P1 , P2 , P3 , P4 , P5
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5>
+ struct and_7<false, P0 , P1 , P2 , P3 , P4 , P5>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6;
+ typedef typename Gimpl6::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d);
+ return Gimpl6()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6>
+ struct and_8
+ : and_7<
+ P0::value ,
+ P1 , P2 , P3 , P4 , P5 , P6
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6>
+ struct and_8<false, P0 , P1 , P2 , P3 , P4 , P5 , P6>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7;
+ typedef typename Gimpl7::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d);
+ return Gimpl7()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7>
+ struct and_9
+ : and_8<
+ P0::value ,
+ P1 , P2 , P3 , P4 , P5 , P6 , P7
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7>
+ struct and_9<false, P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename proto::when<proto::_, G8> ::template impl<Expr, State, Data> Gimpl8;
+ typedef typename Gimpl8::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); Gimpl7()(e,s,d);
+ return Gimpl8()(e,s,d);
+ }
+ };
+
+
+
+ template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8>
+ struct and_10
+ : and_9<
+ P0::value ,
+ P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8
+ >
+ {};
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8>
+ struct and_10<false, P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8>
+ : mpl::false_
+ {};
+ template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9>, Expr, State, Data>
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename proto::when<proto::_, G8> ::template impl<Expr, State, Data> Gimpl8; typedef typename proto::when<proto::_, G9> ::template impl<Expr, State, Data> Gimpl9;
+ typedef typename Gimpl9::result_type result_type;
+ result_type operator()(
+ typename _and_impl::expr_param e
+ , typename _and_impl::state_param s
+ , typename _and_impl::data_param d
+ ) const
+ {
+
+
+
+
+ Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); Gimpl7()(e,s,d); Gimpl8()(e,s,d);
+ return Gimpl9()(e,s,d);
+ }
+ };

Added: branches/release/boost/proto/detail/preprocessed/args.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/args.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,162 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file args.hpp
+ /// Contains definition of \c term\<\>, \c list1\<\>, \c list2\<\>, ...
+ /// class templates.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+
+ template< typename Arg0 >
+ struct term
+ {
+ static const long arity = 0;
+ typedef Arg0 child0;
+ typedef mpl::void_ child1; typedef mpl::void_ child2; typedef mpl::void_ child3; typedef mpl::void_ child4; typedef mpl::void_ child5; typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg0 back_;
+ };
+
+
+
+
+ template< typename Arg0 >
+ struct list1
+ {
+ static const long arity = 1;
+ typedef Arg0 child0;
+ typedef mpl::void_ child1; typedef mpl::void_ child2; typedef mpl::void_ child3; typedef mpl::void_ child4; typedef mpl::void_ child5; typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg0 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 >
+ struct list2
+ {
+ static const long arity = 2;
+ typedef Arg0 child0; typedef Arg1 child1;
+ typedef mpl::void_ child2; typedef mpl::void_ child3; typedef mpl::void_ child4; typedef mpl::void_ child5; typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg1 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 >
+ struct list3
+ {
+ static const long arity = 3;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2;
+ typedef mpl::void_ child3; typedef mpl::void_ child4; typedef mpl::void_ child5; typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg2 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
+ struct list4
+ {
+ static const long arity = 4;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3;
+ typedef mpl::void_ child4; typedef mpl::void_ child5; typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg3 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
+ struct list5
+ {
+ static const long arity = 5;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3; typedef Arg4 child4;
+ typedef mpl::void_ child5; typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg4 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 >
+ struct list6
+ {
+ static const long arity = 6;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3; typedef Arg4 child4; typedef Arg5 child5;
+ typedef mpl::void_ child6; typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg5 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 >
+ struct list7
+ {
+ static const long arity = 7;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3; typedef Arg4 child4; typedef Arg5 child5; typedef Arg6 child6;
+ typedef mpl::void_ child7; typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg6 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 >
+ struct list8
+ {
+ static const long arity = 8;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3; typedef Arg4 child4; typedef Arg5 child5; typedef Arg6 child6; typedef Arg7 child7;
+ typedef mpl::void_ child8; typedef mpl::void_ child9;
+
+
+ typedef Arg7 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 >
+ struct list9
+ {
+ static const long arity = 9;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3; typedef Arg4 child4; typedef Arg5 child5; typedef Arg6 child6; typedef Arg7 child7; typedef Arg8 child8;
+ typedef mpl::void_ child9;
+
+
+ typedef Arg8 back_;
+ };
+
+
+
+
+ template< typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 >
+ struct list10
+ {
+ static const long arity = 10;
+ typedef Arg0 child0; typedef Arg1 child1; typedef Arg2 child2; typedef Arg3 child3; typedef Arg4 child4; typedef Arg5 child5; typedef Arg6 child6; typedef Arg7 child7; typedef Arg8 child8; typedef Arg9 child9;
+
+
+
+ typedef Arg9 back_;
+ };

Added: branches/release/boost/proto/detail/preprocessed/basic_expr.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/basic_expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,774 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file basic_expr.hpp
+ /// Contains definition of basic_expr\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag, typename Arg0>
+ struct basic_expr<Tag, term<Arg0>, 0>
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 0;
+ typedef mpl::long_<0 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef term<Arg0> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0;
+ typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0>
+ static basic_expr const make(A0 &a0)
+ {
+ return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
+ }
+
+
+ template<typename A0>
+ static basic_expr const make(A0 const &a0)
+ {
+ return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0>
+ struct basic_expr<Tag, list1<Arg0>, 1 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 1;
+ typedef mpl::long_<1 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list1<Arg0> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0;
+ typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0>
+ static basic_expr const make(A0 const &a0)
+ {
+ basic_expr that = {a0};
+ return that;
+ }
+
+
+
+ typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
+
+
+
+
+
+
+
+ operator address_of_hack_type_() const
+ {
+ return boost::addressof(this->child0);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1>
+ struct basic_expr<Tag, list2<Arg0 , Arg1>, 2 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 2;
+ typedef mpl::long_<2 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list2<Arg0 , Arg1> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
+ typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1>
+ static basic_expr const make(A0 const &a0 , A1 const &a1)
+ {
+ basic_expr that = {a0 , a1};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2>
+ struct basic_expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 3;
+ typedef mpl::long_<3 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list3<Arg0 , Arg1 , Arg2> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
+ typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2)
+ {
+ basic_expr that = {a0 , a1 , a2};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3>
+ struct basic_expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 4;
+ typedef mpl::long_<4 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list4<Arg0 , Arg1 , Arg2 , Arg3> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
+ typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4>
+ struct basic_expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 5;
+ typedef mpl::long_<5 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
+ typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3 , a4};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5>
+ struct basic_expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 6;
+ typedef mpl::long_<6 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
+ typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3 , a4 , a5};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6>
+ struct basic_expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 7;
+ typedef mpl::long_<7 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
+ typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7>
+ struct basic_expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 8;
+ typedef mpl::long_<8 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
+ typedef void proto_child8; typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8>
+ struct basic_expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 9;
+ typedef mpl::long_<9 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
+ typedef void proto_child9;
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9>
+ struct basic_expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 10;
+ typedef mpl::long_<10 > proto_arity;
+ typedef basic_expr proto_base_expr;
+ typedef list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9> proto_args;
+ typedef basic_expr proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef basic_expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
+
+
+
+ basic_expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ basic_expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ static basic_expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9)
+ {
+ basic_expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+ };

Added: branches/release/boost/proto/detail/preprocessed/classtypeof.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/classtypeof.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,117 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // classtypeof.hpp
+ // Contains specializations of the classtypeof\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename T, typename U >
+ struct classtypeof<T (U::*)()>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U >
+ struct classtypeof<T (U::*)() const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0>
+ struct classtypeof<T (U::*)(A0)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0>
+ struct classtypeof<T (U::*)(A0) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1>
+ struct classtypeof<T (U::*)(A0 , A1)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1>
+ struct classtypeof<T (U::*)(A0 , A1) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2>
+ struct classtypeof<T (U::*)(A0 , A1 , A2)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2>
+ struct classtypeof<T (U::*)(A0 , A1 , A2) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9) const>
+ {
+ typedef U type;
+ };

Added: branches/release/boost/proto/detail/preprocessed/deduce_domain_n.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/deduce_domain_n.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,119 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // deduce_domain_n.hpp
+ // Definitions of common_domain[n] and deduce_domain[n] class templates.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename A0 , typename A1 , typename A2>
+ struct common_domain3
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3;
+ typedef common3 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2>
+ struct deduce_domain3
+ : common_domain3<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ struct common_domain4
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4;
+ typedef common4 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3>
+ struct deduce_domain4
+ : common_domain4<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct common_domain5
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5;
+ typedef common5 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4>
+ struct deduce_domain5
+ : common_domain5<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct common_domain6
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6;
+ typedef common6 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5>
+ struct deduce_domain6
+ : common_domain6<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct common_domain7
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7;
+ typedef common7 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6>
+ struct deduce_domain7
+ : common_domain7<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct common_domain8
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8;
+ typedef common8 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7>
+ struct deduce_domain8
+ : common_domain8<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct common_domain9
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; typedef typename common_domain2<common8, A8>::type common9;
+ typedef common9 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7 , typename E8>
+ struct deduce_domain9
+ : common_domain9<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type , typename domain_of<E8 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct common_domain10
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; typedef typename common_domain2<common8, A8>::type common9; typedef typename common_domain2<common9, A9>::type common10;
+ typedef common10 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7 , typename E8 , typename E9>
+ struct deduce_domain10
+ : common_domain10<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type , typename domain_of<E8 >::type , typename domain_of<E9 >::type
+ >
+ {};

Added: branches/release/boost/proto/detail/preprocessed/deep_copy.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/deep_copy.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,237 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file deep_copy.hpp
+ /// Replace all nodes stored by reference by nodes stored by value.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 1>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list1<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 2>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list2<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 3>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list3<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 4>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list4<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 5>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list5<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 6>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list6<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 7>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list7<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 8>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list8<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child7 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6) , proto::deep_copy(e.proto_base().child7)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 9>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list9<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child7 >::type::proto_derived_expr >::result_type , ty
pename deep_copy_impl< typename remove_reference< typename Expr::proto_child8 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6) , proto::deep_copy(e.proto_base().child7) , proto::deep_copy(e.proto_base().child8)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Expr>
+ struct deep_copy_impl<Expr, 10>
+ {
+ typedef
+ typename base_expr<
+ typename Expr::proto_domain
+ , typename Expr::proto_tag
+ , list10<
+ typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child7 >::type::proto_derived_expr >::result_type , ty
pename deep_copy_impl< typename remove_reference< typename Expr::proto_child8 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child9 >::type::proto_derived_expr >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
+ {
+ expr_type const that = {
+ proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6) , proto::deep_copy(e.proto_base().child7) , proto::deep_copy(e.proto_base().child8) , proto::deep_copy(e.proto_base().child9)
+ };
+ return proto_generator()(that);
+ }
+ };

Added: branches/release/boost/proto/detail/preprocessed/expr.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,3528 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file expr.hpp
+ /// Contains definition of expr\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag, typename Arg0>
+ struct expr<Tag, term<Arg0>, 0>
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 0;
+ typedef mpl::long_<0 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef term<Arg0> proto_args;
+ typedef basic_expr<Tag, proto_args, 0 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0;
+ typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0>
+ static expr const make(A0 &a0)
+ {
+ return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
+ }
+
+
+ template<typename A0>
+ static expr const make(A0 const &a0)
+ {
+ return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a)
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a)
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ proto::expr<proto::tag::function, list1<expr &>, 1> const
+ operator ()()
+ {
+ proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0)
+ {
+ return result_of::funop1<
+ expr
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1)
+ {
+ return result_of::funop2<
+ expr
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2)
+ {
+ return result_of::funop3<
+ expr
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3)
+ {
+ return result_of::funop4<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4)
+ {
+ return result_of::funop5<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5)
+ {
+ return result_of::funop6<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6)
+ {
+ return result_of::funop7<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7)
+ {
+ return result_of::funop8<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8)
+ {
+ return result_of::funop9<
+ expr
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0>
+ struct expr<Tag, list1<Arg0>, 1 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 1;
+ typedef mpl::long_<1 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list1<Arg0> proto_args;
+ typedef basic_expr<Tag, proto_args, 1 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0;
+ typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0>
+ static expr const make(A0 const &a0)
+ {
+ expr that = {a0};
+ return that;
+ }
+
+
+
+ typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
+
+
+
+
+
+
+
+ operator address_of_hack_type_() const
+ {
+ return boost::addressof(this->child0);
+ }
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1>
+ struct expr<Tag, list2<Arg0 , Arg1>, 2 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 2;
+ typedef mpl::long_<2 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list2<Arg0 , Arg1> proto_args;
+ typedef basic_expr<Tag, proto_args, 2 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
+ typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1>
+ static expr const make(A0 const &a0 , A1 const &a1)
+ {
+ expr that = {a0 , a1};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2>
+ struct expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 3;
+ typedef mpl::long_<3 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list3<Arg0 , Arg1 , Arg2> proto_args;
+ typedef basic_expr<Tag, proto_args, 3 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
+ typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2)
+ {
+ expr that = {a0 , a1 , a2};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3>
+ struct expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 4;
+ typedef mpl::long_<4 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list4<Arg0 , Arg1 , Arg2 , Arg3> proto_args;
+ typedef basic_expr<Tag, proto_args, 4 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
+ typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3)
+ {
+ expr that = {a0 , a1 , a2 , a3};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4>
+ struct expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 5;
+ typedef mpl::long_<5 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4> proto_args;
+ typedef basic_expr<Tag, proto_args, 5 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
+ typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5>
+ struct expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 6;
+ typedef mpl::long_<6 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5> proto_args;
+ typedef basic_expr<Tag, proto_args, 6 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
+ typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6>
+ struct expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 7;
+ typedef mpl::long_<7 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6> proto_args;
+ typedef basic_expr<Tag, proto_args, 7 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
+ typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7>
+ struct expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 8;
+ typedef mpl::long_<8 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7> proto_args;
+ typedef basic_expr<Tag, proto_args, 8 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
+ typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8>
+ struct expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 9;
+ typedef mpl::long_<9 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8> proto_args;
+ typedef basic_expr<Tag, proto_args, 9 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
+ typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9>
+ struct expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 10;
+ typedef mpl::long_<10 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9> proto_args;
+ typedef basic_expr<Tag, proto_args, 10 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
+
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
+ operator ()() const
+ {
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
+ return that;
+ }
+
+
+ template<typename A0>
+ typename result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return result_of::funop1<
+ expr const
+ , default_domain , const A0
+ >::call(*this , a0);
+ }
+
+
+ template<typename A0 , typename A1>
+ typename result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ return result_of::funop2<
+ expr const
+ , default_domain , const A0 , const A1
+ >::call(*this , a0 , a1);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ return result_of::funop3<
+ expr const
+ , default_domain , const A0 , const A1 , const A2
+ >::call(*this , a0 , a1 , a2);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ return result_of::funop4<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3
+ >::call(*this , a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ return result_of::funop5<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4
+ >::call(*this , a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ return result_of::funop6<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ return result_of::funop7<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ return result_of::funop8<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ return result_of::funop9<
+ expr const
+ , default_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::call(*this , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };

Added: branches/release/boost/proto/detail/preprocessed/expr_variadic.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/expr_variadic.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,2102 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file expr_variadic.hpp
+ /// Contains definition of expr\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag, typename Arg0>
+ struct expr<Tag, term<Arg0>, 0>
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 0;
+ typedef mpl::long_<0 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef term<Arg0> proto_args;
+ typedef basic_expr<Tag, proto_args, 0 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0;
+ typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0>
+ static expr const make(A0 &a0)
+ {
+ return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
+ }
+
+
+ template<typename A0>
+ static expr const make(A0 const &a0)
+ {
+ return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a)
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a)
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a)
+ {
+ return result_of::funop<
+ expr(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0>
+ struct expr<Tag, list1<Arg0>, 1 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 1;
+ typedef mpl::long_<1 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list1<Arg0> proto_args;
+ typedef basic_expr<Tag, proto_args, 1 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0;
+ typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0>
+ static expr const make(A0 const &a0)
+ {
+ expr that = {a0};
+ return that;
+ }
+
+
+
+ typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
+
+
+
+
+
+
+
+ operator address_of_hack_type_() const
+ {
+ return boost::addressof(this->child0);
+ }
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1>
+ struct expr<Tag, list2<Arg0 , Arg1>, 2 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 2;
+ typedef mpl::long_<2 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list2<Arg0 , Arg1> proto_args;
+ typedef basic_expr<Tag, proto_args, 2 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
+ typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1>
+ static expr const make(A0 const &a0 , A1 const &a1)
+ {
+ expr that = {a0 , a1};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2>
+ struct expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 3;
+ typedef mpl::long_<3 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list3<Arg0 , Arg1 , Arg2> proto_args;
+ typedef basic_expr<Tag, proto_args, 3 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
+ typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2)
+ {
+ expr that = {a0 , a1 , a2};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3>
+ struct expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 4;
+ typedef mpl::long_<4 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list4<Arg0 , Arg1 , Arg2 , Arg3> proto_args;
+ typedef basic_expr<Tag, proto_args, 4 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
+ typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3)
+ {
+ expr that = {a0 , a1 , a2 , a3};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4>
+ struct expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 5;
+ typedef mpl::long_<5 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4> proto_args;
+ typedef basic_expr<Tag, proto_args, 5 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
+ typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5>
+ struct expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 6;
+ typedef mpl::long_<6 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5> proto_args;
+ typedef basic_expr<Tag, proto_args, 6 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
+ typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6>
+ struct expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 7;
+ typedef mpl::long_<7 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6> proto_args;
+ typedef basic_expr<Tag, proto_args, 7 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
+ typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7>
+ struct expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 8;
+ typedef mpl::long_<8 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7> proto_args;
+ typedef basic_expr<Tag, proto_args, 8 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
+ typedef void proto_child8; typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8>
+ struct expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 9;
+ typedef mpl::long_<9 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8> proto_args;
+ typedef basic_expr<Tag, proto_args, 9 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
+ typedef void proto_child9;
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9>
+ struct expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10 >
+ {
+ typedef Tag proto_tag;
+ static const long proto_arity_c = 10;
+ typedef mpl::long_<10 > proto_arity;
+ typedef expr proto_base_expr;
+ typedef list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9> proto_args;
+ typedef basic_expr<Tag, proto_args, 10 > proto_grammar;
+ typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
+ typedef proto::tag::proto_expr fusion_tag;
+ typedef expr proto_derived_expr;
+ typedef void proto_is_expr_;
+ typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
+
+
+
+ expr const &proto_base() const
+ {
+ return *this;
+ }
+
+
+ expr &proto_base()
+ {
+ return *this;
+ }
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9)
+ {
+ expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9};
+ return that;
+ }
+
+
+ typedef detail::not_a_valid_type address_of_hack_type_;
+
+
+
+
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > const
+ operator =(expr const &a)
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr &, expr const &>
+ , 2
+ > that = {*this, a};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator =(A &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator =(A const &a) const
+ {
+ proto::expr<
+ proto::tag::assign
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > const
+ operator [](A &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename A>
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
+ operator [](A const &a) const
+ {
+ proto::expr<
+ proto::tag::subscript
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > that = {*this, proto::as_child(a)};
+ return that;
+ }
+
+
+ template<typename Sig>
+ struct result
+ {
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
+ };
+
+
+ template<typename ...A>
+ typename result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::type const
+ operator ()(A const &... a) const
+ {
+ return result_of::funop<
+ expr const(A const &...)
+ , expr
+ , default_domain
+ >::call(*this, a...);
+ }
+ };
+

Added: branches/release/boost/proto/detail/preprocessed/extends_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/extends_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,18 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file extends_funop.hpp
+ /// Definitions for extends\<\>::operator()
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Sig> struct result { typedef typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; };
+ typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) ) ); } typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr , proto_domain >::type ) >::type const operator ()() { typedef boost::proto::result_of::funop0< proto_derived_expr , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) ) ); }
+ template<typename A0> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 ) ); } template<typename A0> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) { typedef boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 ) ); }
+ template<typename A0 , typename A1> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 ) ); } template<typename A0 , typename A1> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) { typedef boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 ) ); }
+ template<typename A0 , typename A1 , typename A2> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 ) ); } template<typename A0 , typename A1 , typename A2> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) { typedef boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(
this) , a0 , a1 , a2 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) { typedef boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A
1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) {
 typedef boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operat
or ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) { typedef boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , co
nst A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) { typedef boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of
::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) { typedef boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename BO
OST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) { typedef boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); }

Added: branches/release/boost/proto/detail/preprocessed/extends_funop_const.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/extends_funop_const.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,18 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file extends_funop_const.hpp
+ /// Definitions for extends\<\>::operator()
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Sig> struct result { typedef typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; };
+ typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) ) ); }
+ template<typename A0> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 ) ); }
+ template<typename A0 , typename A1> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 ) ); }
+ template<typename A0 , typename A1 , typename A2> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); }

Added: branches/release/boost/proto/detail/preprocessed/funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,357 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // funop.hpp
+ // Contains definition of funop[n]\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+ template<typename Expr, typename Domain >
+ struct funop0
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list1<
+ Expr &
+
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+
+ )
+ {
+ type that = {
+ e
+
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename This, typename Domain>
+ struct funop<Expr(), This, Domain>
+ : funop0<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0>
+ struct funop1
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list2<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0, typename This, typename Domain>
+ struct funop<Expr(A0), This, Domain>
+ : funop1<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1>
+ struct funop2
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list3<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1, typename This, typename Domain>
+ struct funop<Expr(A0 , A1), This, Domain>
+ : funop2<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2>
+ struct funop3
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list4<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2), This, Domain>
+ : funop3<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3>
+ struct funop4
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list5<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2 , A3), This, Domain>
+ : funop4<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct funop5
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list6<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2 , A3 , A4), This, Domain>
+ : funop5<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct funop6
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list7<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5), This, Domain>
+ : funop6<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct funop7
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list8<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type , typename proto::result_of::as_child<A6, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5) , proto::as_child<Domain>(a6)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5 , A6), This, Domain>
+ : funop7<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type , typename remove_reference<A6 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct funop8
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list9<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type , typename proto::result_of::as_child<A6, Domain>::type , typename proto::result_of::as_child<A7, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5) , proto::as_child<Domain>(a6) , proto::as_child<Domain>(a7)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), This, Domain>
+ : funop8<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type , typename remove_reference<A6 >::type , typename remove_reference<A7 >::type
+ >
+ {};
+
+
+ template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct funop9
+ {
+ typedef typename proto::base_expr<
+ Domain
+ , tag::function
+ , list10<
+ Expr &
+ , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type , typename proto::result_of::as_child<A6, Domain>::type , typename proto::result_of::as_child<A7, Domain>::type , typename proto::result_of::as_child<A8, Domain>::type
+ >
+ >::type type;
+ static type const call(
+ Expr &e
+ , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8
+ )
+ {
+ type that = {
+ e
+ , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5) , proto::as_child<Domain>(a6) , proto::as_child<Domain>(a7) , proto::as_child<Domain>(a8)
+ };
+ return that;
+ }
+ };
+
+
+ template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename This, typename Domain>
+ struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), This, Domain>
+ : funop9<
+ typename detail::same_cv<Expr, This>::type
+ , Domain
+ , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type , typename remove_reference<A6 >::type , typename remove_reference<A7 >::type , typename remove_reference<A8 >::type
+ >
+ {};

Added: branches/release/boost/proto/detail/preprocessed/generate_by_value.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/generate_by_value.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,467 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file generate_by_value.hpp
+ /// Contains definition of by_value_generator_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Tag , typename Arg0 >
+ struct by_value_generator_<
+ proto::expr<Tag, list1<Arg0>, 1>
+ >
+ {
+ typedef
+ list1<Arg0>
+ src_args;
+ typedef
+ list1<
+ typename uncvref<Arg0 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 1> src_type;
+ typedef proto::expr<Tag, dst_args, 1> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list1<Arg0>, 1>
+ >
+ {
+ typedef
+ list1<Arg0>
+ src_args;
+ typedef
+ list1<
+ typename uncvref<Arg0 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 1> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 1> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 >
+ struct by_value_generator_<
+ proto::expr<Tag, list2<Arg0 , Arg1>, 2>
+ >
+ {
+ typedef
+ list2<Arg0 , Arg1>
+ src_args;
+ typedef
+ list2<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 2> src_type;
+ typedef proto::expr<Tag, dst_args, 2> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list2<Arg0 , Arg1>, 2>
+ >
+ {
+ typedef
+ list2<Arg0 , Arg1>
+ src_args;
+ typedef
+ list2<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 2> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 2> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 >
+ struct by_value_generator_<
+ proto::expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3>
+ >
+ {
+ typedef
+ list3<Arg0 , Arg1 , Arg2>
+ src_args;
+ typedef
+ list3<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 3> src_type;
+ typedef proto::expr<Tag, dst_args, 3> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3>
+ >
+ {
+ typedef
+ list3<Arg0 , Arg1 , Arg2>
+ src_args;
+ typedef
+ list3<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 3> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 3> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
+ struct by_value_generator_<
+ proto::expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4>
+ >
+ {
+ typedef
+ list4<Arg0 , Arg1 , Arg2 , Arg3>
+ src_args;
+ typedef
+ list4<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 4> src_type;
+ typedef proto::expr<Tag, dst_args, 4> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4>
+ >
+ {
+ typedef
+ list4<Arg0 , Arg1 , Arg2 , Arg3>
+ src_args;
+ typedef
+ list4<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 4> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 4> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
+ struct by_value_generator_<
+ proto::expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5>
+ >
+ {
+ typedef
+ list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>
+ src_args;
+ typedef
+ list5<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 5> src_type;
+ typedef proto::expr<Tag, dst_args, 5> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5>
+ >
+ {
+ typedef
+ list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>
+ src_args;
+ typedef
+ list5<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 5> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 5> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 >
+ struct by_value_generator_<
+ proto::expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6>
+ >
+ {
+ typedef
+ list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>
+ src_args;
+ typedef
+ list6<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 6> src_type;
+ typedef proto::expr<Tag, dst_args, 6> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6>
+ >
+ {
+ typedef
+ list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>
+ src_args;
+ typedef
+ list6<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 6> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 6> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 >
+ struct by_value_generator_<
+ proto::expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7>
+ >
+ {
+ typedef
+ list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>
+ src_args;
+ typedef
+ list7<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 7> src_type;
+ typedef proto::expr<Tag, dst_args, 7> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7>
+ >
+ {
+ typedef
+ list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>
+ src_args;
+ typedef
+ list7<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 7> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 7> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 >
+ struct by_value_generator_<
+ proto::expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8>
+ >
+ {
+ typedef
+ list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>
+ src_args;
+ typedef
+ list8<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 8> src_type;
+ typedef proto::expr<Tag, dst_args, 8> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8>
+ >
+ {
+ typedef
+ list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>
+ src_args;
+ typedef
+ list8<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 8> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 8> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 >
+ struct by_value_generator_<
+ proto::expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9>
+ >
+ {
+ typedef
+ list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>
+ src_args;
+ typedef
+ list9<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 9> src_type;
+ typedef proto::expr<Tag, dst_args, 9> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9>
+ >
+ {
+ typedef
+ list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>
+ src_args;
+ typedef
+ list9<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 9> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 9> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 >
+ struct by_value_generator_<
+ proto::expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10>
+ >
+ {
+ typedef
+ list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>
+ src_args;
+ typedef
+ list10<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type , typename uncvref<Arg9 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 10> src_type;
+ typedef proto::expr<Tag, dst_args, 10> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 , e.child9
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10>
+ >
+ {
+ typedef
+ list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>
+ src_args;
+ typedef
+ list10<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type , typename uncvref<Arg9 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 10> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 10> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 , e.child9
+ };
+ return that;
+ }
+ };

Added: branches/release/boost/proto/detail/preprocessed/lambda_matches.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/lambda_matches.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,142 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file lambda_matches.hpp
+ /// Specializations of the lambda_matches template
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<
+ template<typename , typename> class T
+ , typename Expr0 , typename Expr1
+ , typename Grammar0 , typename Grammar1
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1>
+ , T<Grammar0 , Grammar1>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(2)
+ >
+ : and_2<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 >
+ >
+ {};
+ template<
+ template<typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2
+ , typename Grammar0 , typename Grammar1 , typename Grammar2
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2>
+ , T<Grammar0 , Grammar1 , Grammar2>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(3)
+ >
+ : and_3<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(4)
+ >
+ : and_4<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3 , typename Expr4
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3 , typename Grammar4
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3 , Expr4>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3 , Grammar4>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(5)
+ >
+ : and_5<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 > , lambda_matches< Expr4 , Grammar4 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3 , typename Expr4 , typename Expr5
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3 , typename Grammar4 , typename Grammar5
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3 , Expr4 , Expr5>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3 , Grammar4 , Grammar5>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(6)
+ >
+ : and_6<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 > , lambda_matches< Expr4 , Grammar4 > , lambda_matches< Expr5 , Grammar5 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3 , typename Expr4 , typename Expr5 , typename Expr6
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3 , typename Grammar4 , typename Grammar5 , typename Grammar6
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3 , Expr4 , Expr5 , Expr6>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3 , Grammar4 , Grammar5 , Grammar6>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(7)
+ >
+ : and_7<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 > , lambda_matches< Expr4 , Grammar4 > , lambda_matches< Expr5 , Grammar5 > , lambda_matches< Expr6 , Grammar6 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3 , typename Expr4 , typename Expr5 , typename Expr6 , typename Expr7
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3 , typename Grammar4 , typename Grammar5 , typename Grammar6 , typename Grammar7
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3 , Expr4 , Expr5 , Expr6 , Expr7>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3 , Grammar4 , Grammar5 , Grammar6 , Grammar7>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(8)
+ >
+ : and_8<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 > , lambda_matches< Expr4 , Grammar4 > , lambda_matches< Expr5 , Grammar5 > , lambda_matches< Expr6 , Grammar6 > , lambda_matches< Expr7 , Grammar7 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3 , typename Expr4 , typename Expr5 , typename Expr6 , typename Expr7 , typename Expr8
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3 , typename Grammar4 , typename Grammar5 , typename Grammar6 , typename Grammar7 , typename Grammar8
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3 , Expr4 , Expr5 , Expr6 , Expr7 , Expr8>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3 , Grammar4 , Grammar5 , Grammar6 , Grammar7 , Grammar8>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(9)
+ >
+ : and_9<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 > , lambda_matches< Expr4 , Grammar4 > , lambda_matches< Expr5 , Grammar5 > , lambda_matches< Expr6 , Grammar6 > , lambda_matches< Expr7 , Grammar7 > , lambda_matches< Expr8 , Grammar8 >
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename , typename> class T
+ , typename Expr0 , typename Expr1 , typename Expr2 , typename Expr3 , typename Expr4 , typename Expr5 , typename Expr6 , typename Expr7 , typename Expr8 , typename Expr9
+ , typename Grammar0 , typename Grammar1 , typename Grammar2 , typename Grammar3 , typename Grammar4 , typename Grammar5 , typename Grammar6 , typename Grammar7 , typename Grammar8 , typename Grammar9
+ >
+ struct lambda_matches<
+ T<Expr0 , Expr1 , Expr2 , Expr3 , Expr4 , Expr5 , Expr6 , Expr7 , Expr8 , Expr9>
+ , T<Grammar0 , Grammar1 , Grammar2 , Grammar3 , Grammar4 , Grammar5 , Grammar6 , Grammar7 , Grammar8 , Grammar9>
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(10)
+ >
+ : and_10<
+ lambda_matches< Expr0 , Grammar0 >::value,
+ lambda_matches< Expr1 , Grammar1 > , lambda_matches< Expr2 , Grammar2 > , lambda_matches< Expr3 , Grammar3 > , lambda_matches< Expr4 , Grammar4 > , lambda_matches< Expr5 , Grammar5 > , lambda_matches< Expr6 , Grammar6 > , lambda_matches< Expr7 , Grammar7 > , lambda_matches< Expr8 , Grammar8 > , lambda_matches< Expr9 , Grammar9 >
+ >
+ {};

Added: branches/release/boost/proto/detail/preprocessed/make_expr.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/make_expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,313 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr.hpp
+ /// Contains overloads of make_expr() free function.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+ template<typename Tag , typename A0 , typename A1>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1
+ >()(a0 , a1);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1
+ >()(c0 , c1);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2
+ >()(a0 , a1 , a2);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2
+ >()(c0 , c1 , c2);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3
+ >()(a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3
+ >()(c0 , c1 , c2 , c3);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >()(a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4
+ >()(c0 , c1 , c2 , c3 , c4);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >()(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4 , const C5 &c5)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5
+ >()(c0 , c1 , c2 , c3 , c4 , c5);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4 , const C5 &c5 , const C6 &c6)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6
+ >()(c0 , c1 , c2 , c3 , c4 , c5 , c6);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6 , const A7 &a7)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6 , const C7
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4 , const C5 &c5 , const C6 &c6 , const C7 &c7)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6 , const C7
+ >()(c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6 , const A7 &a7 , const A8 &a8)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7 , typename C8>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6 , const C7 , const C8
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4 , const C5 &c5 , const C6 &c6 , const C7 &c7 , const C8 &c8)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6 , const C7 , const C8
+ >()(c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6 , const A7 &a7 , const A8 &a8 , const A9 &a9)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7 , typename C8 , typename C9>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6 , const C7 , const C8 , const C9
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4 , const C5 &c5 , const C6 &c6 , const C7 &c7 , const C8 &c8 , const C9 &c9)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4 , const C5 , const C6 , const C7 , const C8 , const C9
+ >()(c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9);
+ }

Added: branches/release/boost/proto/detail/preprocessed/make_expr_.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/make_expr_.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,320 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<
+ typename Tag
+ , typename Domain
+ , typename A0 = void , typename A1 = void , typename A2 = void , typename A3 = void , typename A4 = void , typename A5 = void , typename A6 = void , typename A7 = void , typename A8 = void , typename A9 = void
+ , typename _ = void
+ >
+ struct make_expr_
+ {};
+ template<typename Domain, typename A>
+ struct make_expr_<tag::terminal, Domain, A
+ , void , void , void , void , void , void , void , void , void , void>
+ {
+ typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
+ result_type operator()(typename add_reference<A>::type a) const
+ {
+ return proto::detail::protoify<A, Domain>()(a);
+ }
+ };
+ template<typename A>
+ struct make_expr_<tag::terminal, deduce_domain, A
+ , void , void , void , void , void , void , void , void , void , void>
+ : make_expr_<tag::terminal, default_domain, A>
+ {};
+ template<typename Tag, typename Domain , typename A0>
+ struct make_expr_<Tag, Domain , A0
+ , void , void , void , void , void , void , void , void , void, void>
+ {
+ typedef
+ list1<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0>
+ struct make_expr_<Tag, deduce_domain , A0
+ , void , void , void , void , void , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain1<A0>::type
+ , A0
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1>
+ struct make_expr_<Tag, Domain , A0 , A1
+ , void , void , void , void , void , void , void , void, void>
+ {
+ typedef
+ list2<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1>
+ struct make_expr_<Tag, deduce_domain , A0 , A1
+ , void , void , void , void , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain2<A0 , A1>::type
+ , A0 , A1
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2
+ , void , void , void , void , void , void , void, void>
+ {
+ typedef
+ list3<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2
+ , void , void , void , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain3<A0 , A1 , A2>::type
+ , A0 , A1 , A2
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3
+ , void , void , void , void , void , void, void>
+ {
+ typedef
+ list4<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3
+ , void , void , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain4<A0 , A1 , A2 , A3>::type
+ , A0 , A1 , A2 , A3
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4
+ , void , void , void , void , void, void>
+ {
+ typedef
+ list5<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4
+ , void , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain5<A0 , A1 , A2 , A3 , A4>::type
+ , A0 , A1 , A2 , A3 , A4
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4 , A5
+ , void , void , void , void, void>
+ {
+ typedef
+ list6<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type , typename boost::proto::detail::protoify< A5 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4 , typename add_reference<A5 >::type a5) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4) , boost::proto::detail::protoify< A5 , Domain >()(a5)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4 , A5
+ , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain6<A0 , A1 , A2 , A3 , A4 , A5>::type
+ , A0 , A1 , A2 , A3 , A4 , A5
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ , void , void , void, void>
+ {
+ typedef
+ list7<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type , typename boost::proto::detail::protoify< A5 , Domain >::result_type , typename boost::proto::detail::protoify< A6 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4 , typename add_reference<A5 >::type a5 , typename add_reference<A6 >::type a6) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4) , boost::proto::detail::protoify< A5 , Domain >()(a5) , boost::proto::detail::protoify< A6 , Domain >()(a6)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain7<A0 , A1 , A2 , A3 , A4 , A5 , A6>::type
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ , void , void, void>
+ {
+ typedef
+ list8<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type , typename boost::proto::detail::protoify< A5 , Domain >::result_type , typename boost::proto::detail::protoify< A6 , Domain >::result_type , typename boost::proto::detail::protoify< A7 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4 , typename add_reference<A5 >::type a5 , typename add_reference<A6 >::type a6 , typename add_reference<A7 >::type a7) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4) , boost::proto::detail::protoify< A5 , Domain >()(a5) , boost::proto::detail::protoify< A6 , Domain >()(a6) , boost::proto::detail::protoify< A7 , Domain >()(a7)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain8<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>::type
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ , void, void>
+ {
+ typedef
+ list9<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type , typename boost::proto::detail::protoify< A5 , Domain >::result_type , typename boost::proto::detail::protoify< A6 , Domain >::result_type , typename boost::proto::detail::protoify< A7 , Domain >::result_type , typename boost::proto::detail::protoify< A8 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4 , typename add_reference<A5 >::type a5 , typename add_reference<A6 >::type a6 , typename add_reference<A7 >::type a7 , typename add_reference<A8 >::type a8) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4) , boost::proto::detail::protoify< A5 , Domain >()(a5) , boost::proto::detail::protoify< A6 , Domain >()(a6) , boost::proto::detail::protoify< A7 , Domain >()(a7) , boost::proto::detail::protoify< A8 , Domain >()(a8)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain9<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>::type
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9
+ , void>
+ {
+ typedef
+ list10<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type , typename boost::proto::detail::protoify< A5 , Domain >::result_type , typename boost::proto::detail::protoify< A6 , Domain >::result_type , typename boost::proto::detail::protoify< A7 , Domain >::result_type , typename boost::proto::detail::protoify< A8 , Domain >::result_type , typename boost::proto::detail::protoify< A9 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4 , typename add_reference<A5 >::type a5 , typename add_reference<A6 >::type a6 , typename add_reference<A7 >::type a7 , typename add_reference<A8 >::type a8 , typename add_reference<A9 >::type a9) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4) , boost::proto::detail::protoify< A5 , Domain >()(a5) , boost::proto::detail::protoify< A6 , Domain >()(a6) , boost::proto::detail::protoify< A7 , Domain >()(a7) , boost::proto::detail::protoify< A8 , Domain >()(a8) , boost::proto::detail::protoify< A9 , Domain >()(a9)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9
+ , void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain10<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>::type
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9
+ >
+ {};

Added: branches/release/boost/proto/detail/preprocessed/make_expr_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/make_expr_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,250 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_funop.hpp
+ /// Contains definition of make_expr\<\>::operator() member functions.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename This , typename A0 , typename A1>
+ struct result<This(A0 , A1)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1
+ >()(a0 , a1);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2>
+ struct result<This(A0 , A1 , A2)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2
+ >()(a0 , a1 , a2);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3>
+ struct result<This(A0 , A1 , A2 , A3)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3
+ >()(a0 , a1 , a2 , a3);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct result<This(A0 , A1 , A2 , A3 , A4)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >()(a0 , a1 , a2 , a3 , a4);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4 , A5
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5
+ >()(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6 , const A7 &a7) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6 , const A7 &a7 , const A8 &a8) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4 , const A5 &a5 , const A6 &a6 , const A7 &a7 , const A8 &a8 , const A9 &a9) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9
+ >()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }

Added: branches/release/boost/proto/detail/preprocessed/matches_.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/matches_.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,277 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file matches_.hpp
+ /// Definitions of matches_ specializations
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1> >
+ : or_2<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1> >
+ : detail::and_2<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 2>, proto::basic_expr<Tag, Args2, 2> >
+ : and_2<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 2>, proto::basic_expr<proto::_, Args2, 2> >
+ : and_2<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2> >
+ : or_3<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2> >
+ : detail::and_3<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 3>, proto::basic_expr<Tag, Args2, 3> >
+ : and_3<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 3>, proto::basic_expr<proto::_, Args2, 3> >
+ : and_3<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3> >
+ : or_4<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3> >
+ : detail::and_4<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 4>, proto::basic_expr<Tag, Args2, 4> >
+ : and_4<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 4>, proto::basic_expr<proto::_, Args2, 4> >
+ : and_4<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3 , G4> >
+ : or_5<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3 , G4
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3 , G4> >
+ : detail::and_5<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar > , matches_< Expr , BasicExpr , typename G4::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 5>, proto::basic_expr<Tag, Args2, 5> >
+ : and_5<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 5>, proto::basic_expr<proto::_, Args2, 5> >
+ : and_5<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3 , G4 , G5> >
+ : or_6<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3 , G4 , G5
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3 , G4 , G5> >
+ : detail::and_6<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar > , matches_< Expr , BasicExpr , typename G4::proto_grammar > , matches_< Expr , BasicExpr , typename G5::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 6>, proto::basic_expr<Tag, Args2, 6> >
+ : and_6<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 6>, proto::basic_expr<proto::_, Args2, 6> >
+ : and_6<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3 , G4 , G5 , G6> >
+ : or_7<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3 , G4 , G5 , G6
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6> >
+ : detail::and_7<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar > , matches_< Expr , BasicExpr , typename G4::proto_grammar > , matches_< Expr , BasicExpr , typename G5::proto_grammar > , matches_< Expr , BasicExpr , typename G6::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 7>, proto::basic_expr<Tag, Args2, 7> >
+ : and_7<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 7>, proto::basic_expr<proto::_, Args2, 7> >
+ : and_7<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7> >
+ : or_8<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7> >
+ : detail::and_8<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar > , matches_< Expr , BasicExpr , typename G4::proto_grammar > , matches_< Expr , BasicExpr , typename G5::proto_grammar > , matches_< Expr , BasicExpr , typename G6::proto_grammar > , matches_< Expr , BasicExpr , typename G7::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 8>, proto::basic_expr<Tag, Args2, 8> >
+ : and_8<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child7>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child7>::value_type::proto_grammar , typename Args2::child7::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 8>, proto::basic_expr<proto::_, Args2, 8> >
+ : and_8<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child7>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child7>::value_type::proto_grammar , typename Args2::child7::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8> >
+ : or_9<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8> >
+ : detail::and_9<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar > , matches_< Expr , BasicExpr , typename G4::proto_grammar > , matches_< Expr , BasicExpr , typename G5::proto_grammar > , matches_< Expr , BasicExpr , typename G6::proto_grammar > , matches_< Expr , BasicExpr , typename G7::proto_grammar > , matches_< Expr , BasicExpr , typename G8::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 9>, proto::basic_expr<Tag, Args2, 9> >
+ : and_9<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child7>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child7>::value_type::proto_grammar , typename Args2::child7::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child8>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child8>::value_type::proto_grammar , typename Args2::child8::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 9>, proto::basic_expr<proto::_, Args2, 9> >
+ : and_9<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child7>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child7>::value_type::proto_grammar , typename Args2::child7::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child8>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child8>::value_type::proto_grammar , typename Args2::child8::proto_grammar >
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9>
+ struct matches_<Expr, BasicExpr, proto::or_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9> >
+ : or_10<
+ matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
+ Expr, BasicExpr , G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9
+ >
+ {};
+
+ template<typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9>
+ struct matches_<Expr, BasicExpr, proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9> >
+ : detail::and_10<
+ matches_< Expr , BasicExpr , typename G0::proto_grammar >::value,
+ matches_< Expr , BasicExpr , typename G1::proto_grammar > , matches_< Expr , BasicExpr , typename G2::proto_grammar > , matches_< Expr , BasicExpr , typename G3::proto_grammar > , matches_< Expr , BasicExpr , typename G4::proto_grammar > , matches_< Expr , BasicExpr , typename G5::proto_grammar > , matches_< Expr , BasicExpr , typename G6::proto_grammar > , matches_< Expr , BasicExpr , typename G7::proto_grammar > , matches_< Expr , BasicExpr , typename G8::proto_grammar > , matches_< Expr , BasicExpr , typename G9::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 10>, proto::basic_expr<Tag, Args2, 10> >
+ : and_10<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child7>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child7>::value_type::proto_grammar , typename Args2::child7::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child8>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child8>::value_type::proto_grammar , typename Args2::child8::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child9>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child9>::value_type::proto_grammar , typename Args2::child9::proto_grammar >
+ >
+ {};
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 10>, proto::basic_expr<proto::_, Args2, 10> >
+ : and_10<
+ matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar >::value,
+ matches_< typename detail::expr_traits<typename Args1::child1>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child1>::value_type::proto_grammar , typename Args2::child1::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child2>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child2>::value_type::proto_grammar , typename Args2::child2::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child3>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child3>::value_type::proto_grammar , typename Args2::child3::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child4>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child4>::value_type::proto_grammar , typename Args2::child4::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child5>::value_type::proto_derived_expr , typename detail::expr_tra
its<typename Args1::child5>::value_type::proto_grammar , typename Args2::child5::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child6>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child6>::value_type::proto_grammar , typename Args2::child6::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child7>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child7>::value_type::proto_grammar , typename Args2::child7::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child8>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child8>::value_type::proto_grammar , typename Args2::child8::proto_grammar > , matches_< typename detail::expr_traits<typename Args1::child9>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child9>::value_type::proto_grammar , typename Args2::child9::proto_grammar >
+ >
+ {};

Added: branches/release/boost/proto/detail/preprocessed/memfun_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/memfun_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,67 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // memfun_funop.hpp
+ // Contains overloads of memfun::operator().
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename A0>
+ result_type operator()(A0 const &a0) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0);
+ }
+ template<typename A0 , typename A1>
+ result_type operator()(A0 const &a0 , A1 const &a1) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1);
+ }
+ template<typename A0 , typename A1 , typename A2>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }

Added: branches/release/boost/proto/detail/preprocessed/or_n.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/or_n.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,123 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file or_n.hpp
+ /// Definitions of or_N
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1>
+ struct or_2
+ : mpl::bool_<matches_<Expr, BasicExpr, typename G1::proto_grammar>::value>
+ {
+ typedef G1 which;
+ };
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1>
+ struct or_2<true, Expr, BasicExpr, G0 , G1>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2>
+ struct or_3
+ : or_2<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2>
+ struct or_3<true, Expr, BasicExpr, G0 , G1 , G2>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3>
+ struct or_4
+ : or_3<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3>
+ struct or_4<true, Expr, BasicExpr, G0 , G1 , G2 , G3>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4>
+ struct or_5
+ : or_4<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3 , G4
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4>
+ struct or_5<true, Expr, BasicExpr, G0 , G1 , G2 , G3 , G4>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5>
+ struct or_6
+ : or_5<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3 , G4 , G5
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5>
+ struct or_6<true, Expr, BasicExpr, G0 , G1 , G2 , G3 , G4 , G5>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6>
+ struct or_7
+ : or_6<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3 , G4 , G5 , G6
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6>
+ struct or_7<true, Expr, BasicExpr, G0 , G1 , G2 , G3 , G4 , G5 , G6>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7>
+ struct or_8
+ : or_7<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3 , G4 , G5 , G6 , G7
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7>
+ struct or_8<true, Expr, BasicExpr, G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8>
+ struct or_9
+ : or_8<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8>
+ struct or_9<true, Expr, BasicExpr, G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+ template<bool B, typename Expr, typename BasicExpr, typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9>
+ struct or_10
+ : or_9<
+ matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
+ , Expr, BasicExpr, G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9
+ >
+ {};
+ template<typename Expr, typename BasicExpr , typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9>
+ struct or_10<true, Expr, BasicExpr, G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };

Added: branches/release/boost/proto/detail/preprocessed/poly_function_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/poly_function_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,237 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_funop.hpp
+ // Contains overloads of poly_function\<\>::operator()
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename This , typename A0>
+ struct result<This(A0)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0>
+ typename result<
+ Derived const(
+ A0 const &
+ )
+ >::type
+ operator ()(A0 const &a0) const
+ {
+ result<
+ Derived const(
+ A0 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0));
+ }
+ template<typename This , typename A0 , typename A1>
+ struct result<This(A0 , A1)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1>
+ typename result<
+ Derived const(
+ A0 const & , A1 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2>
+ struct result<This(A0 , A1 , A2)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3>
+ struct result<This(A0 , A1 , A2 , A3)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct result<This(A0 , A1 , A2 , A3 , A4)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type , typename normalize_arg<A8 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7) , static_cast<typename normalize_arg<A8 const &> ::reference>(a8));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type , typename normalize_arg<A8 >::type , typename normalize_arg<A9 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const & , A9 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const & , A9 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7) , static_cast<typename normalize_arg<A8 const &> ::reference>(a8) , static_cast<typename normalize_arg<A9 const &> ::reference>(a9));
+ }

Added: branches/release/boost/proto/detail/preprocessed/poly_function_traits.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/poly_function_traits.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,247 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_traits.hpp
+ // Contains specializations of poly_function_traits and as_mono_function
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+ template<typename PolyFun , typename A0>
+ struct poly_function_traits<PolyFun, PolyFun(A0), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0>
+ struct as_mono_function_impl<PolyFun(A0), true>
+ {
+ typedef typename PolyFun::template impl<const A0> type;
+ };
+
+ template<typename PolyFun , typename A0>
+ struct as_mono_function_impl<PolyFun(A0), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0>
+ struct as_mono_function<PolyFun(A0)>
+ : as_mono_function_impl<PolyFun(A0), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct as_mono_function_impl<PolyFun(A0 , A1), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct as_mono_function_impl<PolyFun(A0 , A1), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct as_mono_function<PolyFun(A0 , A1)>
+ : as_mono_function_impl<PolyFun(A0 , A1), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct as_mono_function<PolyFun(A0 , A1 , A2)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), is_poly_function<PolyFun>::value>
+ {};

Added: branches/release/boost/proto/detail/preprocessed/template_arity_helper.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/template_arity_helper.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,67 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // template_arity_helper.hpp
+ // Overloads of template_arity_helper, used by the template_arity\<\> class template
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<
+ template<typename P0> class F
+ , typename T0
+ >
+ sized_type<2>::type
+ template_arity_helper(F<T0> **, mpl::int_<1> *);
+ template<
+ template<typename P0 , typename P1> class F
+ , typename T0 , typename T1
+ >
+ sized_type<3>::type
+ template_arity_helper(F<T0 , T1> **, mpl::int_<2> *);
+ template<
+ template<typename P0 , typename P1 , typename P2> class F
+ , typename T0 , typename T1 , typename T2
+ >
+ sized_type<4>::type
+ template_arity_helper(F<T0 , T1 , T2> **, mpl::int_<3> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3> class F
+ , typename T0 , typename T1 , typename T2 , typename T3
+ >
+ sized_type<5>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3> **, mpl::int_<4> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4
+ >
+ sized_type<6>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4> **, mpl::int_<5> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5
+ >
+ sized_type<7>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5> **, mpl::int_<6> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6
+ >
+ sized_type<8>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6> **, mpl::int_<7> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7
+ >
+ sized_type<9>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7> **, mpl::int_<8> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8
+ >
+ sized_type<10>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8> **, mpl::int_<9> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 , typename P9> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9
+ >
+ sized_type<11>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9> **, mpl::int_<10> *);

Added: branches/release/boost/proto/detail/preprocessed/traits.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/traits.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,1464 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file traits.hpp
+ /// Definitions of proto::function, proto::nary_expr and proto::result_of::child_c
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 0>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child0 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child0>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 0>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child0 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child0>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child0;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 0>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child0 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child0>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child0;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0>
+ struct function
+ <
+ A0
+ , void , void , void , void , void , void , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0
+ , void , void , void , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list1<A0>, 1> type;
+ typedef proto::basic_expr<proto::tag::function, list1<A0>, 1> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0;
+ typedef detail::if_vararg<A0> proto_child1; typedef detail::if_vararg<A0> proto_child2; typedef detail::if_vararg<A0> proto_child3; typedef detail::if_vararg<A0> proto_child4; typedef detail::if_vararg<A0> proto_child5; typedef detail::if_vararg<A0> proto_child6; typedef detail::if_vararg<A0> proto_child7; typedef detail::if_vararg<A0> proto_child8; typedef detail::if_vararg<A0> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0>
+ struct nary_expr
+ <
+ Tag
+ , A0
+ , void , void , void , void , void , void , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0
+ , void , void , void , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list1<A0>, 1> type;
+ typedef proto::basic_expr<Tag, list1<A0>, 1> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0;
+ typedef detail::if_vararg<A0> proto_child1; typedef detail::if_vararg<A0> proto_child2; typedef detail::if_vararg<A0> proto_child3; typedef detail::if_vararg<A0> proto_child4; typedef detail::if_vararg<A0> proto_child5; typedef detail::if_vararg<A0> proto_child6; typedef detail::if_vararg<A0> proto_child7; typedef detail::if_vararg<A0> proto_child8; typedef detail::if_vararg<A0> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename> class T
+ , typename A0
+ >
+ struct is_callable_<T<A0> BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)>
+ : is_same<A0, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 1>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child1 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child1>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 1>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child1 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child1>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child1;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 1>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child1 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child1>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child1;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1>
+ struct function
+ <
+ A0 , A1
+ , void , void , void , void , void , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1
+ , void , void , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list2<A0 , A1>, 2> type;
+ typedef proto::basic_expr<proto::tag::function, list2<A0 , A1>, 2> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1;
+ typedef detail::if_vararg<A1> proto_child2; typedef detail::if_vararg<A1> proto_child3; typedef detail::if_vararg<A1> proto_child4; typedef detail::if_vararg<A1> proto_child5; typedef detail::if_vararg<A1> proto_child6; typedef detail::if_vararg<A1> proto_child7; typedef detail::if_vararg<A1> proto_child8; typedef detail::if_vararg<A1> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1
+ , void , void , void , void , void , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1
+ , void , void , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list2<A0 , A1>, 2> type;
+ typedef proto::basic_expr<Tag, list2<A0 , A1>, 2> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1;
+ typedef detail::if_vararg<A1> proto_child2; typedef detail::if_vararg<A1> proto_child3; typedef detail::if_vararg<A1> proto_child4; typedef detail::if_vararg<A1> proto_child5; typedef detail::if_vararg<A1> proto_child6; typedef detail::if_vararg<A1> proto_child7; typedef detail::if_vararg<A1> proto_child8; typedef detail::if_vararg<A1> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename> class T
+ , typename A0 , typename A1
+ >
+ struct is_callable_<T<A0 , A1> BOOST_PROTO_TEMPLATE_ARITY_PARAM(2)>
+ : is_same<A1, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 2>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child2 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child2>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 2>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child2 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child2>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child2;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 2>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child2 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child2>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child2;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2>
+ struct function
+ <
+ A0 , A1 , A2
+ , void , void , void , void , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2
+ , void , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list3<A0 , A1 , A2>, 3> type;
+ typedef proto::basic_expr<proto::tag::function, list3<A0 , A1 , A2>, 3> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2;
+ typedef detail::if_vararg<A2> proto_child3; typedef detail::if_vararg<A2> proto_child4; typedef detail::if_vararg<A2> proto_child5; typedef detail::if_vararg<A2> proto_child6; typedef detail::if_vararg<A2> proto_child7; typedef detail::if_vararg<A2> proto_child8; typedef detail::if_vararg<A2> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2
+ , void , void , void , void , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2
+ , void , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list3<A0 , A1 , A2>, 3> type;
+ typedef proto::basic_expr<Tag, list3<A0 , A1 , A2>, 3> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2;
+ typedef detail::if_vararg<A2> proto_child3; typedef detail::if_vararg<A2> proto_child4; typedef detail::if_vararg<A2> proto_child5; typedef detail::if_vararg<A2> proto_child6; typedef detail::if_vararg<A2> proto_child7; typedef detail::if_vararg<A2> proto_child8; typedef detail::if_vararg<A2> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2
+ >
+ struct is_callable_<T<A0 , A1 , A2> BOOST_PROTO_TEMPLATE_ARITY_PARAM(3)>
+ : is_same<A2, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 3>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child3 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child3>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 3>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child3 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child3>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child3;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 3>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child3 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child3>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child3;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ struct function
+ <
+ A0 , A1 , A2 , A3
+ , void , void , void , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3
+ , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list4<A0 , A1 , A2 , A3>, 4> type;
+ typedef proto::basic_expr<proto::tag::function, list4<A0 , A1 , A2 , A3>, 4> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3;
+ typedef detail::if_vararg<A3> proto_child4; typedef detail::if_vararg<A3> proto_child5; typedef detail::if_vararg<A3> proto_child6; typedef detail::if_vararg<A3> proto_child7; typedef detail::if_vararg<A3> proto_child8; typedef detail::if_vararg<A3> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2 , A3
+ , void , void , void , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3
+ , void , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list4<A0 , A1 , A2 , A3>, 4> type;
+ typedef proto::basic_expr<Tag, list4<A0 , A1 , A2 , A3>, 4> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3;
+ typedef detail::if_vararg<A3> proto_child4; typedef detail::if_vararg<A3> proto_child5; typedef detail::if_vararg<A3> proto_child6; typedef detail::if_vararg<A3> proto_child7; typedef detail::if_vararg<A3> proto_child8; typedef detail::if_vararg<A3> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3> BOOST_PROTO_TEMPLATE_ARITY_PARAM(4)>
+ : is_same<A3, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 4>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child4 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child4>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 4>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child4 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child4>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child4;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 4>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child4 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child4>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child4;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct function
+ <
+ A0 , A1 , A2 , A3 , A4
+ , void , void , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3 , A4
+ , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list5<A0 , A1 , A2 , A3 , A4>, 5> type;
+ typedef proto::basic_expr<proto::tag::function, list5<A0 , A1 , A2 , A3 , A4>, 5> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4;
+ typedef detail::if_vararg<A4> proto_child5; typedef detail::if_vararg<A4> proto_child6; typedef detail::if_vararg<A4> proto_child7; typedef detail::if_vararg<A4> proto_child8; typedef detail::if_vararg<A4> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2 , A3 , A4
+ , void , void , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3 , A4
+ , void , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list5<A0 , A1 , A2 , A3 , A4>, 5> type;
+ typedef proto::basic_expr<Tag, list5<A0 , A1 , A2 , A3 , A4>, 5> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4;
+ typedef detail::if_vararg<A4> proto_child5; typedef detail::if_vararg<A4> proto_child6; typedef detail::if_vararg<A4> proto_child7; typedef detail::if_vararg<A4> proto_child8; typedef detail::if_vararg<A4> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3 , A4> BOOST_PROTO_TEMPLATE_ARITY_PARAM(5)>
+ : is_same<A4, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 5>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child5 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child5>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 5>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child5 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child5>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child5;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 5>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child5 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child5>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child5;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct function
+ <
+ A0 , A1 , A2 , A3 , A4 , A5
+ , void , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3 , A4 , A5
+ , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list6<A0 , A1 , A2 , A3 , A4 , A5>, 6> type;
+ typedef proto::basic_expr<proto::tag::function, list6<A0 , A1 , A2 , A3 , A4 , A5>, 6> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5;
+ typedef detail::if_vararg<A5> proto_child6; typedef detail::if_vararg<A5> proto_child7; typedef detail::if_vararg<A5> proto_child8; typedef detail::if_vararg<A5> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5
+ , void , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5
+ , void , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list6<A0 , A1 , A2 , A3 , A4 , A5>, 6> type;
+ typedef proto::basic_expr<Tag, list6<A0 , A1 , A2 , A3 , A4 , A5>, 6> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5;
+ typedef detail::if_vararg<A5> proto_child6; typedef detail::if_vararg<A5> proto_child7; typedef detail::if_vararg<A5> proto_child8; typedef detail::if_vararg<A5> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3 , A4 , A5> BOOST_PROTO_TEMPLATE_ARITY_PARAM(6)>
+ : is_same<A5, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 6>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child6 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child6>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 6>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child6 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child6>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child6;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 6>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child6 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child6>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child6;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct function
+ <
+ A0 , A1 , A2 , A3 , A4 , A5 , A6
+ , void , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3 , A4 , A5 , A6
+ , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list7<A0 , A1 , A2 , A3 , A4 , A5 , A6>, 7> type;
+ typedef proto::basic_expr<proto::tag::function, list7<A0 , A1 , A2 , A3 , A4 , A5 , A6>, 7> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6;
+ typedef detail::if_vararg<A6> proto_child7; typedef detail::if_vararg<A6> proto_child8; typedef detail::if_vararg<A6> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ , void , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ , void , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list7<A0 , A1 , A2 , A3 , A4 , A5 , A6>, 7> type;
+ typedef proto::basic_expr<Tag, list7<A0 , A1 , A2 , A3 , A4 , A5 , A6>, 7> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6;
+ typedef detail::if_vararg<A6> proto_child7; typedef detail::if_vararg<A6> proto_child8; typedef detail::if_vararg<A6> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3 , A4 , A5 , A6> BOOST_PROTO_TEMPLATE_ARITY_PARAM(7)>
+ : is_same<A6, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 7>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child7 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child7>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 7>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child7 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child7>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child7;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 7>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child7 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child7>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child7;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct function
+ <
+ A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ , void , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list8<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>, 8> type;
+ typedef proto::basic_expr<proto::tag::function, list8<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>, 8> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6; typedef A7 proto_child7;
+ typedef detail::if_vararg<A7> proto_child8; typedef detail::if_vararg<A7> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ , void , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ , void , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list8<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>, 8> type;
+ typedef proto::basic_expr<Tag, list8<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>, 8> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6; typedef A7 proto_child7;
+ typedef detail::if_vararg<A7> proto_child8; typedef detail::if_vararg<A7> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7> BOOST_PROTO_TEMPLATE_ARITY_PARAM(8)>
+ : is_same<A7, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 8>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child8 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child8>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 8>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child8 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child8>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child8;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 8>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child8 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child8>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child8;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct function
+ <
+ A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ , void
+ >
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list9<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>, 9> type;
+ typedef proto::basic_expr<proto::tag::function, list9<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>, 9> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6; typedef A7 proto_child7; typedef A8 proto_child8;
+ typedef detail::if_vararg<A8> proto_child9;
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct nary_expr
+ <
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ , void
+ >
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ , void
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list9<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>, 9> type;
+ typedef proto::basic_expr<Tag, list9<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>, 9> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6; typedef A7 proto_child7; typedef A8 proto_child8;
+ typedef detail::if_vararg<A8> proto_child9;
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8> BOOST_PROTO_TEMPLATE_ARITY_PARAM(9)>
+ : is_same<A8, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 9>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child9 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child9>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 9>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child9 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child9>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child9;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 9>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child9 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child9>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child9;
+ }
+ };
+ }
+
+
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct function
+ : proto::transform<
+ function<
+ A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9
+
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, list10<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>, 10> type;
+ typedef proto::basic_expr<proto::tag::function, list10<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>, 10> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ typedef proto::tag::function proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6; typedef A7 proto_child7; typedef A8 proto_child8; typedef A9 proto_child9;
+
+ };
+
+
+
+
+
+
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct nary_expr
+ : proto::transform<
+ nary_expr<
+ Tag
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9
+
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, list10<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>, 10> type;
+ typedef proto::basic_expr<Tag, list10<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>, 10> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ typedef Tag proto_tag;
+ typedef A0 proto_child0; typedef A1 proto_child1; typedef A2 proto_child2; typedef A3 proto_child3; typedef A4 proto_child4; typedef A5 proto_child5; typedef A6 proto_child6; typedef A7 proto_child7; typedef A8 proto_child8; typedef A9 proto_child9;
+
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename , typename> class T
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9
+ >
+ struct is_callable_<T<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9> BOOST_PROTO_TEMPLATE_ARITY_PARAM(10)>
+ : is_same<A9, callable>
+ {};
+ }
+ namespace result_of
+ {
+
+
+
+
+
+
+ template<typename Expr>
+ struct child_c<Expr, 10>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child10 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child10>::value_type type;
+ };
+ template<typename Expr>
+ struct child_c<Expr &, 10>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child10 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child10>::reference type;
+
+
+ static type call(Expr &e)
+ {
+ return e.proto_base().child10;
+ }
+ };
+ template<typename Expr>
+ struct child_c<Expr const &, 10>
+ {
+
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+
+ typedef typename Expr::proto_child10 value_type;
+
+
+
+
+
+ typedef typename detail::expr_traits<typename Expr::proto_child10>::const_reference type;
+
+
+ static type call(Expr const &e)
+ {
+ return e.proto_base().child10;
+ }
+ };
+ }

Added: branches/release/boost/proto/detail/preprocessed/unpack_expr_.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/unpack_expr_.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,445 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
+ struct unpack_expr_
+ {};
+ template<typename Domain, typename Sequence>
+ struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
+ {
+ typedef
+ typename add_const<
+ typename fusion::result_of::value_of<
+ typename fusion::result_of::begin<Sequence>::type
+ >::type
+ >::type
+ terminal_type;
+ typedef
+ typename proto::detail::protoify<
+ terminal_type
+ , Domain
+ >::result_type
+ type;
+ static type const call(Sequence const &sequence)
+ {
+ return proto::detail::protoify<terminal_type, Domain>()(fusion::at_c<0>(sequence));
+ }
+ };
+ template<typename Sequence>
+ struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
+ : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
+ {};
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 1>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0;
+ typedef
+ list1<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 1>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain1<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type
+ >::type
+ , Sequence
+ , 1
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 2>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1;
+ typedef
+ list2<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 2>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain2<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type
+ >::type
+ , Sequence
+ , 2
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 3>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2;
+ typedef
+ list3<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 3>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain3<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type
+ >::type
+ , Sequence
+ , 3
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 4>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3;
+ typedef
+ list4<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 4>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain4<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type
+ >::type
+ , Sequence
+ , 4
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 5>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4;
+ typedef
+ list5<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 5>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain5<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type
+ >::type
+ , Sequence
+ , 5
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 6>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5;
+ typedef
+ list6<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3); fusion_iterator5 it5 = fusion::next(it4);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >()(*it5)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 6>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain6<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type
+ >::type
+ , Sequence
+ , 6
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 7>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6;
+ typedef
+ list7<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3); fusion_iterator5 it5 = fusion::next(it4); fusion_iterator6 it6 = fusion::next(it5);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >()(*it5) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >()(*it6)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 7>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain7<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type
+ >::type
+ , Sequence
+ , 7
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 8>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6; typedef typename fusion::result_of::next< fusion_iterator6>::type fusion_iterator7;
+ typedef
+ list8<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >::result_type
, typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3); fusion_iterator5 it5 = fusion::next(it4); fusion_iterator6 it6 = fusion::next(it5); fusion_iterator7 it7 = fusion::next(it6);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >()(*it5) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >()(*it6) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::
type >::type , Domain >()(*it7)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 8>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6; typedef typename fusion::result_of::next< fusion_iterator6>::type fusion_iterator7;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain8<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::type >::type
+ >::type
+ , Sequence
+ , 8
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 9>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6; typedef typename fusion::result_of::next< fusion_iterator6>::type fusion_iterator7; typedef typename fusion::result_of::next< fusion_iterator7>::type fusion_iterator8;
+ typedef
+ list9<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >::result_type
, typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator8 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3); fusion_iterator5 it5 = fusion::next(it4); fusion_iterator6 it6 = fusion::next(it5); fusion_iterator7 it7 = fusion::next(it6); fusion_iterator8 it8 = fusion::next(it7);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >()(*it5) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >()(*it6) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::
type >::type , Domain >()(*it7) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator8 >::type >::type , Domain >()(*it8)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 9>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6; typedef typename fusion::result_of::next< fusion_iterator6>::type fusion_iterator7; typedef typename fusion::result_of::next< fusion_iterator7>::type fusion_iterator8;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain9<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator8 >::type >::type
+ >::type
+ , Sequence
+ , 9
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 10>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6; typedef typename fusion::result_of::next< fusion_iterator6>::type fusion_iterator7; typedef typename fusion::result_of::next< fusion_iterator7>::type fusion_iterator8; typedef typename fusion::result_of::next< fusion_iterator8>::type fusion_iterator9;
+ typedef
+ list10<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >::result_type
, typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator8 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator9 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3); fusion_iterator5 it5 = fusion::next(it4); fusion_iterator6 it6 = fusion::next(it5); fusion_iterator7 it7 = fusion::next(it6); fusion_iterator8 it8 = fusion::next(it7); fusion_iterator9 it9 = fusion::next(it8);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , Domain >()(*it5) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , Domain >()(*it6) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::
type >::type , Domain >()(*it7) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator8 >::type >::type , Domain >()(*it8) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator9 >::type >::type , Domain >()(*it9)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 10>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4; typedef typename fusion::result_of::next< fusion_iterator4>::type fusion_iterator5; typedef typename fusion::result_of::next< fusion_iterator5>::type fusion_iterator6; typedef typename fusion::result_of::next< fusion_iterator6>::type fusion_iterator7; typedef typename fusion::result_of::next< fusion_iterator7>::type fusion_iterator8; typedef typename fusion::result_of::next< fusion_iterator8>::type fusion_iterator9;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain10<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator5 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator6 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator7 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator8 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator9 >::type >::type
+ >::type
+ , Sequence
+ , 10
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };

Added: branches/release/boost/proto/detail/preprocessed/vararg_matches_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/preprocessed/vararg_matches_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,178 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file vararg_matches_impl.hpp
+ /// Specializations of the vararg_matches_impl template
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 2, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child1>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child1>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 2 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 2, 2>
+ : matches_<
+ typename detail::expr_traits<typename Args::child1>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child1>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 3, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child2>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child2>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 3 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 3, 3>
+ : matches_<
+ typename detail::expr_traits<typename Args::child2>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child2>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 4, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child3>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child3>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 4 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 4, 4>
+ : matches_<
+ typename detail::expr_traits<typename Args::child3>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child3>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 5, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child4>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child4>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 5 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 5, 5>
+ : matches_<
+ typename detail::expr_traits<typename Args::child4>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child4>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 6, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child5>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child5>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 6 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 6, 6>
+ : matches_<
+ typename detail::expr_traits<typename Args::child5>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child5>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 7, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child6>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child6>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 7 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 7, 7>
+ : matches_<
+ typename detail::expr_traits<typename Args::child6>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child6>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 8, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child7>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child7>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 8 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 8, 8>
+ : matches_<
+ typename detail::expr_traits<typename Args::child7>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child7>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 9, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child8>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child8>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 9 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 9, 9>
+ : matches_<
+ typename detail::expr_traits<typename Args::child8>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child8>::value_type::proto_grammar
+ , Back
+ >
+ {};
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, 10, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::child9>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child9>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, 10 + 1, To>
+ >
+ {};
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, 10, 10>
+ : matches_<
+ typename detail::expr_traits<typename Args::child9>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::child9>::value_type::proto_grammar
+ , Back
+ >
+ {};

Added: branches/release/boost/proto/detail/template_arity.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/template_arity.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,67 @@
+///////////////////////////////////////////////////////////////////////////////
+/// \file template_arity.hpp
+/// Replace all nodes stored by reference by nodes stored by value.
+//
+// Copyright 2011 Eric Niebler. 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)
+//
+// This file is based on a similar one in MPL from Aleksey Gurtovoy.
+
+#ifndef BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
+#define BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
+
+// Somewhat indirect definition of BOOST_PROTO_TEMPLATE_ARITY_PARAM is
+// to overcome a shortcoming of the Wave tool used to generate the
+// pre-preprocessed headers.
+#define BOOST_PROTO_TEMPLATE_ARITY_PARAM BOOST_PROTO_TEMPLATE_ARITY_PARAM2
+#define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param)
+
+#if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) || \
+ (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES))
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/inc.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/proto/proto_fwd.hpp>
+
+#undef BOOST_PROTO_TEMPLATE_ARITY_PARAM2
+#define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) , param
+
+namespace boost { namespace proto { namespace detail
+{
+ sized_type<1>::type template_arity_helper(...);
+
+ // Other overloads generated by the preprocessor
+ #include <boost/proto/detail/template_arity_helper.hpp>
+
+ template<typename F, int N, int Size>
+ struct template_arity_impl2
+ : mpl::int_<Size - 1>
+ {};
+
+ template<typename F, int N = BOOST_PROTO_MAX_ARITY>
+ struct template_arity
+ : template_arity_impl2<
+ F
+ , N
+ , sizeof(detail::template_arity_helper((F **)0, (mpl::int_<N> *)0))
+ >
+ {};
+
+ template<typename F, int N>
+ struct template_arity_impl2<F, N, 1>
+ : template_arity<F, N-1>
+ {};
+
+ template<typename F>
+ struct template_arity_impl2<F, 0, 1>
+ : mpl::int_<-1>
+ {};
+
+}}}
+
+#endif // BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+#endif // BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07

Added: branches/release/boost/proto/detail/template_arity_helper.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/template_arity_helper.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,44 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/template_arity_helper.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/template_arity_helper.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // template_arity_helper.hpp
+ // Overloads of template_arity_helper, used by the template_arity\<\> class template
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/template_arity_helper.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<
+ template<BOOST_PP_ENUM_PARAMS(N, typename P)> class F
+ , BOOST_PP_ENUM_PARAMS(N, typename T)
+ >
+ sized_type<BOOST_PP_INC(N)>::type
+ template_arity_helper(F<BOOST_PP_ENUM_PARAMS(N, T)> **, mpl::int_<N> *);
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: branches/release/boost/proto/detail/traits.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/traits.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,219 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/traits.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_CHILD(Z, N, DATA) \
+ /** INTERNAL ONLY */ \
+ typedef BOOST_PP_CAT(DATA, N) BOOST_PP_CAT(proto_child, N); \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/traits.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file traits.hpp
+ /// Definitions of proto::function, proto::nary_expr and proto::result_of::child_c
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/traits.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_CHILD
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ #if N > 0
+ /// \brief A metafunction for generating function-call expression types,
+ /// a grammar element for matching function-call expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ struct function
+ #if N != BOOST_PROTO_MAX_ARITY
+ <
+ BOOST_PP_ENUM_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
+ >
+ #endif
+ : proto::transform<
+ function<
+ BOOST_PP_ENUM_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
+ >
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
+ typedef proto::basic_expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
+
+ /// INTERNAL ONLY
+ typedef proto::tag::function proto_tag;
+ BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
+ BOOST_PP_REPEAT_FROM_TO(
+ N
+ , BOOST_PROTO_MAX_ARITY
+ , BOOST_PROTO_CHILD
+ , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
+ )
+ };
+
+ /// \brief A metafunction for generating n-ary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching n-ary expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ ///
+ /// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
+ /// n-ary expression; that is, any non-terminal.
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct nary_expr
+ #if N != BOOST_PROTO_MAX_ARITY
+ <
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
+ >
+ #endif
+ : proto::transform<
+ nary_expr<
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
+ >
+ , int
+ >
+ {
+ typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
+ typedef proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
+
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
+ BOOST_PP_REPEAT_FROM_TO(
+ N
+ , BOOST_PROTO_MAX_ARITY
+ , BOOST_PROTO_CHILD
+ , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
+ )
+ };
+
+ namespace detail
+ {
+ template<
+ template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class T
+ , BOOST_PP_ENUM_PARAMS(N, typename A)
+ >
+ struct is_callable_<T<BOOST_PP_ENUM_PARAMS(N, A)> BOOST_PROTO_TEMPLATE_ARITY_PARAM(N)>
+ : is_same<BOOST_PP_CAT(A, BOOST_PP_DEC(N)), callable>
+ {};
+ }
+
+ #endif
+
+ namespace result_of
+ {
+ /// \brief A metafunction that returns the type of the Nth child
+ /// of a Proto expression.
+ ///
+ /// A metafunction that returns the type of the Nth child
+ /// of a Proto expression. \c N must be less than
+ /// \c Expr::proto_arity::value.
+ template<typename Expr>
+ struct child_c<Expr, N>
+ {
+ /// Verify that we are not operating on a terminal
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+ /// The raw type of the Nth child as it is stored within
+ /// \c Expr. This may be a value or a reference
+ typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
+
+ /// The "value" type of the child, suitable for return by value,
+ /// computed as follows:
+ /// \li <tt>T const &</tt> becomes <tt>T</tt>
+ /// \li <tt>T &</tt> becomes <tt>T</tt>
+ /// \li <tt>T</tt> becomes <tt>T</tt>
+ typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::value_type type;
+ };
+
+ template<typename Expr>
+ struct child_c<Expr &, N>
+ {
+ /// Verify that we are not operating on a terminal
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+ /// The raw type of the Nth child as it is stored within
+ /// \c Expr. This may be a value or a reference
+ typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
+
+ /// The "reference" type of the child, suitable for return by
+ /// reference, computed as follows:
+ /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
+ /// \li <tt>T &</tt> becomes <tt>T &</tt>
+ /// \li <tt>T</tt> becomes <tt>T &</tt>
+ typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::reference type;
+
+ /// INTERNAL ONLY
+ ///
+ static type call(Expr &e)
+ {
+ return e.proto_base().BOOST_PP_CAT(child, N);
+ }
+ };
+
+ template<typename Expr>
+ struct child_c<Expr const &, N>
+ {
+ /// Verify that we are not operating on a terminal
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+
+ /// The raw type of the Nth child as it is stored within
+ /// \c Expr. This may be a value or a reference
+ typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
+
+ /// The "const reference" type of the child, suitable for return by
+ /// const reference, computed as follows:
+ /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
+ /// \li <tt>T &</tt> becomes <tt>T &</tt>
+ /// \li <tt>T</tt> becomes <tt>T const &</tt>
+ typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::const_reference type;
+
+ /// INTERNAL ONLY
+ ///
+ static type call(Expr const &e)
+ {
+ return e.proto_base().BOOST_PP_CAT(child, N);
+ }
+ };
+ }
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/detail/unpack_expr_.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/unpack_expr_.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,195 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/unpack_expr_.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE(Z, N, DATA) \
+ typedef typename fusion::result_of::next< \
+ BOOST_PP_CAT(fusion_iterator, N)>::type \
+ BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)); \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_ITERATORS_TYPE(N) \
+ typedef \
+ typename fusion::result_of::begin<Sequence const>::type \
+ fusion_iterator0; \
+ BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE, fusion_iterator) \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
+ typename add_const< \
+ typename fusion::result_of::value_of< \
+ BOOST_PP_CAT(fusion_iterator, N) \
+ >::type \
+ >::type \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_NEXT_ITERATOR(Z, N, DATA) \
+ BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)) BOOST_PP_CAT(it, BOOST_PP_INC(N)) = \
+ fusion::next(BOOST_PP_CAT(it, N)); \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_ITERATORS(N) \
+ fusion_iterator0 it0 = fusion::begin(sequence); \
+ BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR, fusion_iterator) \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AT(Z, N, DATA) \
+ *BOOST_PP_CAT(it, N) \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE(Z, N, DATA) \
+ typename detail::protoify< \
+ BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
+ , Domain \
+ >::result_type \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AS_CHILD_AT(Z, N, DATA) \
+ detail::protoify< \
+ BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
+ , Domain \
+ >()(BOOST_PROTO_FUSION_AT(Z, N, DATA)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/unpack_expr_.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
+ struct unpack_expr_
+ {};
+
+ template<typename Domain, typename Sequence>
+ struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
+ {
+ typedef
+ typename add_const<
+ typename fusion::result_of::value_of<
+ typename fusion::result_of::begin<Sequence>::type
+ >::type
+ >::type
+ terminal_type;
+
+ typedef
+ typename proto::detail::protoify<
+ terminal_type
+ , Domain
+ >::result_type
+ type;
+
+ static type const call(Sequence const &sequence)
+ {
+ return proto::detail::protoify<terminal_type, Domain>()(fusion::at_c<0>(sequence));
+ }
+ };
+
+ template<typename Sequence>
+ struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
+ : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
+ {};
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/unpack_expr_.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_FUSION_AT
+ #undef BOOST_PROTO_FUSION_AT_TYPE
+ #undef BOOST_PROTO_FUSION_AS_CHILD_AT
+ #undef BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE
+ #undef BOOST_PROTO_FUSION_NEXT_ITERATOR
+ #undef BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE
+ #undef BOOST_PROTO_FUSION_ITERATORS
+ #undef BOOST_PROTO_FUSION_ITERATORS_TYPE
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+ #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
+
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, N>
+ {
+ BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
+
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE, ~)
+ >
+ proto_args;
+
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+
+ static type const call(Sequence const &sequence)
+ {
+ BOOST_PROTO_FUSION_ITERATORS(N)
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT, ~)
+ };
+ return proto_generator()(that);
+ }
+ };
+
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, N>
+ {
+ BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
+
+ typedef
+ unpack_expr_<
+ Tag
+ , typename BOOST_PP_CAT(deduce_domain, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AT_TYPE, ~)
+ >::type
+ , Sequence
+ , N
+ >
+ other;
+
+ typedef typename other::type type;
+
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+
+ #undef N
+ #undef M
+
+#endif

Added: branches/release/boost/proto/detail/vararg_matches_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/detail/vararg_matches_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,58 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/vararg_matches_impl.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/vararg_matches_impl.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file vararg_matches_impl.hpp
+ /// Specializations of the vararg_matches_impl template
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/vararg_matches_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Args, typename Back, long To>
+ struct vararg_matches_impl<Args, Back, N, To>
+ : and_2<
+ matches_<
+ typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
+ , Back
+ >::value
+ , vararg_matches_impl<Args, Back, N + 1, To>
+ >
+ {};
+
+ template<typename Args, typename Back>
+ struct vararg_matches_impl<Args, Back, N, N>
+ : matches_<
+ typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
+ , Back
+ >
+ {};
+
+ #undef N
+
+#endif

Modified: branches/release/boost/proto/expr.hpp
==============================================================================
--- branches/release/boost/proto/expr.hpp (original)
+++ branches/release/boost/proto/expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -13,6 +13,7 @@
 #include <boost/preprocessor/arithmetic/dec.hpp>
 #include <boost/preprocessor/selection/max.hpp>
 #include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
 #include <boost/preprocessor/repetition/enum_trailing.hpp>
@@ -37,19 +38,6 @@
 
     namespace detail
     {
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_CHILD(Z, N, DATA) \
- typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
- BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
- /**< INTERNAL ONLY */
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_VOID(Z, N, DATA) \
- typedef void BOOST_PP_CAT(proto_child, N); \
- /**< INTERNAL ONLY */
-
         struct not_a_valid_type
         {
         private:
@@ -118,25 +106,20 @@
         template<typename Sig, typename This, typename Domain>
         struct funop;
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/funop.hpp>))
- #include BOOST_PP_ITERATE()
+ #include <boost/proto/detail/funop.hpp>
     }
 
     namespace exprns_
     {
- // The expr<> specializations are actually defined here.
- #define BOOST_PROTO_DEFINE_TERMINAL
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/proto/detail/expr0.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_DEFINE_TERMINAL
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr0.hpp>))
- #include BOOST_PP_ITERATE()
+ // This is where the basic_expr specializations are
+ // actually defined:
+ #include <boost/proto/detail/basic_expr.hpp>
+
+ // This is where the expr specialization are
+ // actually defined:
+ #include <boost/proto/detail/expr.hpp>
     }
 
- #undef BOOST_PROTO_CHILD
- #undef BOOST_PROTO_VOID
-
     /// \brief Lets you inherit the interface of an expression
     /// while hiding from Proto the fact that the type is a Proto
     /// expression.

Modified: branches/release/boost/proto/extends.hpp
==============================================================================
--- branches/release/boost/proto/extends.hpp (original)
+++ branches/release/boost/proto/extends.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -74,7 +74,7 @@
     ///
     #define BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, DATA, Const) \
         BOOST_PP_IF(N, BOOST_PROTO_TEMPLATE_YES_, BOOST_PROTO_TEMPLATE_NO_)(Z, N) \
- typename BOOST_PROTO_RESULT_OF< \
+ typename BOOST_PROTO_RESULT_OF< \
             proto_generator( \
                 typename boost::proto::result_of::BOOST_PP_CAT(funop, N)< \
                     proto_derived_expr Const() \
@@ -103,7 +103,7 @@
     ///
     #define BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(Const) \
         template<typename... A> \
- typename BOOST_PROTO_RESULT_OF< \
+ typename BOOST_PROTO_RESULT_OF< \
             proto_generator( \
                 typename boost::proto::result_of::funop< \
                     proto_derived_expr Const()(A const &...) \
@@ -168,7 +168,7 @@
         typedef typename proto_base_expr::proto_grammar proto_grammar; \
         typedef typename proto_base_expr::address_of_hack_type_ proto_address_of_hack_type_; \
         typedef void proto_is_expr_; /**< INTERNAL ONLY */ \
- BOOST_STATIC_CONSTANT(long, proto_arity_c = proto_base_expr::proto_arity_c); \
+ static const long proto_arity_c = proto_base_expr::proto_arity_c; \
         typedef boost::proto::tag::proto_expr fusion_tag; \
         BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_EXTENDS_CHILD, ~) \
                                                                                                     \
@@ -202,7 +202,7 @@
 
     #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, Const, Typename) \
         BOOST_PROTO_DISABLE_MSVC_C4522 \
- Typename() BOOST_PROTO_RESULT_OF< \
+ Typename() BOOST_PROTO_RESULT_OF< \
             Typename() This::proto_generator( \
                 Typename() boost::proto::base_expr< \
                     Typename() This::proto_domain \
@@ -251,7 +251,7 @@
         ///
     #define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(ThisConst, ThatConst) \
         template<typename A> \
- typename BOOST_PROTO_RESULT_OF< \
+ typename BOOST_PROTO_RESULT_OF< \
             proto_generator( \
                 typename boost::proto::base_expr< \
                     proto_domain \
@@ -317,7 +317,7 @@
         ///
     #define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(ThisConst, ThatConst) \
         template<typename A> \
- typename BOOST_PROTO_RESULT_OF< \
+ typename BOOST_PROTO_RESULT_OF< \
             proto_generator( \
                 typename boost::proto::base_expr< \
                     proto_domain \
@@ -512,23 +512,7 @@
             // Instead of using BOOST_PROTO_EXTENDS_FUNCTION, which uses
             // nested preprocessor loops, use file iteration here to generate
             // the operator() overloads, which is more efficient.
- BOOST_PROTO_EXTENDS_FUNCTION_()
-
- #ifndef BOOST_NO_VARIADIC_TEMPLATES
- BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST)
- #else
- /// INTERNAL ONLY
- ///
- #define BOOST_PP_LOCAL_MACRO(N) \
- BOOST_PROTO_DEFINE_FUN_OP_CONST(1, N, ~) \
- /**/
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY))
- #include BOOST_PP_LOCAL_ITERATE()
-
- #endif
+ #include <boost/proto/detail/extends_funop_const.hpp>
         };
 
         /// \brief extends\<\> class template for adding behaviors to a Proto expression template
@@ -557,25 +541,7 @@
             // Instead of using BOOST_PROTO_EXTENDS_FUNCTION, which uses
             // nested preprocessor loops, use file iteration here to generate
             // the operator() overloads, which is more efficient.
- BOOST_PROTO_EXTENDS_FUNCTION_()
-
- #ifndef BOOST_NO_VARIADIC_TEMPLATES
- BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PP_EMPTY)
- BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST)
- #else
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PP_LOCAL_MACRO(N) \
- BOOST_PROTO_DEFINE_FUN_OP(1, N, ~) \
- /**/
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY))
- #include BOOST_PP_LOCAL_ITERATE()
-
- #endif
+ #include <boost/proto/detail/extends_funop.hpp>
         };
 
         /// INTERNAL ONLY
@@ -591,7 +557,7 @@
             typedef mpl::long_<2> proto_arity;
             typedef detail::not_a_valid_type proto_address_of_hack_type_;
             typedef void proto_is_expr_; /**< INTERNAL ONLY */
- BOOST_STATIC_CONSTANT(long, proto_arity_c = 2);
+ static const long proto_arity_c = 2;
             typedef boost::proto::tag::proto_expr fusion_tag;
             typedef This &proto_child0;
             typedef expr<tag::terminal, term<Fun> > const &proto_child1;
@@ -601,7 +567,13 @@
 
             BOOST_PROTO_EXTENDS_ASSIGN_()
             BOOST_PROTO_EXTENDS_SUBSCRIPT()
- BOOST_PROTO_EXTENDS_FUNCTION()
+
+ // Instead of using BOOST_PROTO_EXTENDS_FUNCTION, which uses
+ // nested preprocessor loops, use file iteration here to generate
+ // the operator() overloads, which is more efficient.
+ #define BOOST_PROTO_NO_WAVE_OUTPUT
+ #include <boost/proto/detail/extends_funop.hpp>
+ #undef BOOST_PROTO_NO_WAVE_OUTPUT
 
             proto_base_expr const proto_base() const
             {

Modified: branches/release/boost/proto/fusion.hpp
==============================================================================
--- branches/release/boost/proto/fusion.hpp (original)
+++ branches/release/boost/proto/fusion.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -48,7 +48,7 @@
         {
             typedef Expr expr_type;
             typedef typename Expr::proto_tag proto_tag;
- BOOST_STATIC_CONSTANT(long, index = Pos);
+ static const long index = Pos;
             typedef fusion::random_access_traversal_tag category;
             typedef tag::proto_expr_iterator fusion_tag;
 

Modified: branches/release/boost/proto/generate.hpp
==============================================================================
--- branches/release/boost/proto/generate.hpp (original)
+++ branches/release/boost/proto/generate.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,466 +1,399 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file generate.hpp
- /// Contains definition of generate\<\> class template, which end users can
- /// specialize for generating domain-specific expression wrappers.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
- #define BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
-
- #include <boost/config.hpp>
- #include <boost/version.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/utility/result_of.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/args.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file generate.hpp
+/// Contains definition of generate\<\> class template, which end users can
+/// specialize for generating domain-specific expression wrappers.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
+#define BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
+
+#include <boost/config.hpp>
+#include <boost/version.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/args.hpp>
+
+namespace boost { namespace proto
+{
+
+ namespace detail
     {
+ template<typename Expr>
+ struct by_value_generator_;
 
- namespace detail
+ template<typename Tag, typename Arg>
+ struct by_value_generator_<proto::expr<Tag, term<Arg>, 0> >
         {
- template<typename Expr>
- struct by_value_generator_;
+ typedef
+ proto::expr<
+ Tag
+ , term<typename detail::term_traits<Arg>::value_type>
+ , 0
+ >
+ type;
 
- template<typename Tag, typename Arg>
- struct by_value_generator_<proto::expr<Tag, term<Arg>, 0> >
+ static type const call(proto::expr<Tag, term<Arg>, 0> const &e)
             {
- typedef
- proto::expr<
- Tag
- , term<typename detail::term_traits<Arg>::value_type>
- , 0
- >
- type;
-
- static type const call(proto::expr<Tag, term<Arg>, 0> const &e)
- {
- type that = {e.child0};
- return that;
- }
- };
+ type that = {e.child0};
+ return that;
+ }
+ };
 
- template<typename Tag, typename Arg>
- struct by_value_generator_<proto::basic_expr<Tag, term<Arg>, 0> >
+ template<typename Tag, typename Arg>
+ struct by_value_generator_<proto::basic_expr<Tag, term<Arg>, 0> >
+ {
+ typedef
+ proto::basic_expr<
+ Tag
+ , term<typename detail::term_traits<Arg>::value_type>
+ , 0
+ >
+ type;
+
+ static type const call(proto::basic_expr<Tag, term<Arg>, 0> const &e)
             {
- typedef
- proto::basic_expr<
- Tag
- , term<typename detail::term_traits<Arg>::value_type>
- , 0
- >
- type;
-
- static type const call(proto::basic_expr<Tag, term<Arg>, 0> const &e)
- {
- type that = {e.child0};
- return that;
- }
- };
+ type that = {e.child0};
+ return that;
+ }
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/generate.hpp>))
- #include BOOST_PP_ITERATE()
+ // Include the other specializations of by_value_generator_
+ #include <boost/proto/detail/generate_by_value.hpp>
+ }
 
- #undef BOOST_PROTO_DEFINE_BY_VALUE
- #undef BOOST_PROTO_DEFINE_BY_VALUE_TYPE
+ /// \brief A simple generator that passes an expression
+ /// through unchanged.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// The \c default_generator makes no modifications to the expressions
+ /// passed to it.
+ struct default_generator
+ {
+ BOOST_PROTO_CALLABLE()
 
- }
+ template<typename Sig>
+ struct result;
 
- /// \brief A simple generator that passes an expression
- /// through unchanged.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// The \c default_generator makes no modifications to the expressions
- /// passed to it.
- struct default_generator
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
         {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef Expr type;
- };
-
- /// \param expr A Proto expression
- /// \return expr
- template<typename Expr>
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- Expr
- #else
- Expr const &
- #endif
- operator ()(Expr const &e) const
- {
- return e;
- }
+ typedef Expr type;
         };
 
- /// \brief A generator that wraps expressions passed
- /// to it in the specified extension wrapper.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c generator\<\> wraps each expression passed to it in
- /// the \c Extends\<\> wrapper.
- template<template<typename> class Extends>
- struct generator
+ /// \param expr A Proto expression
+ /// \return expr
+ template<typename Expr>
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ Expr
+ #else
+ Expr const &
+ #endif
+ operator ()(Expr const &e) const
         {
- BOOST_PROTO_CALLABLE()
- BOOST_PROTO_USE_BASIC_EXPR()
-
- template<typename Sig>
- struct result;
+ return e;
+ }
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef Extends<Expr> type;
- };
+ /// \brief A generator that wraps expressions passed
+ /// to it in the specified extension wrapper.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c generator\<\> wraps each expression passed to it in
+ /// the \c Extends\<\> wrapper.
+ template<template<typename> class Extends>
+ struct generator
+ {
+ BOOST_PROTO_CALLABLE()
+ BOOST_PROTO_USE_BASIC_EXPR()
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef Extends<Expr> type;
+ };
 
- /// \param expr A Proto expression
- /// \return Extends<Expr>(expr)
- template<typename Expr>
- Extends<Expr> operator ()(Expr const &e) const
- {
- return Extends<Expr>(e);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
+ {
+ typedef Extends<Expr> type;
         };
 
- /// \brief A generator that wraps expressions passed
- /// to it in the specified extension wrapper and uses
- /// aggregate initialization for the wrapper.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c pod_generator\<\> wraps each expression passed to it in
- /// the \c Extends\<\> wrapper, and uses aggregate initialzation
- /// for the wrapped object.
- template<template<typename> class Extends>
- struct pod_generator
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
         {
- BOOST_PROTO_CALLABLE()
- BOOST_PROTO_USE_BASIC_EXPR()
+ typedef Extends<Expr> type;
+ };
 
- template<typename Sig>
- struct result;
+ /// \param expr A Proto expression
+ /// \return Extends<Expr>(expr)
+ template<typename Expr>
+ Extends<Expr> operator ()(Expr const &e) const
+ {
+ return Extends<Expr>(e);
+ }
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef Extends<Expr> type;
- };
+ /// \brief A generator that wraps expressions passed
+ /// to it in the specified extension wrapper and uses
+ /// aggregate initialization for the wrapper.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c pod_generator\<\> wraps each expression passed to it in
+ /// the \c Extends\<\> wrapper, and uses aggregate initialzation
+ /// for the wrapped object.
+ template<template<typename> class Extends>
+ struct pod_generator
+ {
+ BOOST_PROTO_CALLABLE()
+ BOOST_PROTO_USE_BASIC_EXPR()
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef Extends<Expr> type;
+ };
 
- /// \param expr The expression to wrap
- /// \return <tt>Extends\<Expr\> that = {expr}; return that;</tt>
- template<typename Expr>
- Extends<Expr> operator ()(Expr const &e) const
- {
- Extends<Expr> that = {e};
- return that;
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
+ {
+ typedef Extends<Expr> type;
         };
 
- /// \brief A generator that replaces child nodes held by
- /// reference with ones held by value. Use with
- /// \c compose_generators to forward that result to another
- /// generator.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c by_value_generator ensures all child nodes are
- /// held by value. This generator is typically composed with a
- /// second generator for further processing, as
- /// <tt>compose_generators\<by_value_generator, MyGenerator\></tt>.
- struct by_value_generator
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
         {
- BOOST_PROTO_CALLABLE()
+ typedef Extends<Expr> type;
+ };
 
- template<typename Sig>
- struct result;
+ /// \param expr The expression to wrap
+ /// \return <tt>Extends\<Expr\> that = {expr}; return that;</tt>
+ template<typename Expr>
+ Extends<Expr> operator ()(Expr const &e) const
+ {
+ Extends<Expr> that = {e};
+ return that;
+ }
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef
- typename detail::by_value_generator_<Expr>::type
- type;
- };
+ /// \brief A generator that replaces child nodes held by
+ /// reference with ones held by value. Use with
+ /// \c compose_generators to forward that result to another
+ /// generator.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c by_value_generator ensures all child nodes are
+ /// held by value. This generator is typically composed with a
+ /// second generator for further processing, as
+ /// <tt>compose_generators\<by_value_generator, MyGenerator\></tt>.
+ struct by_value_generator
+ {
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef
- typename detail::by_value_generator_<Expr>::type
- type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef
- typename detail::by_value_generator_<Expr>::type
- type;
- };
-
- /// \param expr The expression to modify.
- /// \return <tt>deep_copy(expr)</tt>
- template<typename Expr>
- typename result<by_value_generator(Expr)>::type operator ()(Expr const &e) const
- {
- return detail::by_value_generator_<Expr>::call(e);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef
+ typename detail::by_value_generator_<Expr>::type
+ type;
         };
 
- /// \brief A composite generator that first applies one
- /// transform to an expression and then forwards the result
- /// on to another generator for further transformation.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c compose_generators\<\> is a composite generator that first
- /// applies one transform to an expression and then forwards the
- /// result on to another generator for further transformation.
- template<typename First, typename Second>
- struct compose_generators
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
         {
- BOOST_PROTO_CALLABLE()
+ typedef
+ typename detail::by_value_generator_<Expr>::type
+ type;
+ };
 
- template<typename Sig>
- struct result;
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
+ {
+ typedef
+ typename detail::by_value_generator_<Expr>::type
+ type;
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef
- typename Second::template result<
- Second(typename First::template result<First(Expr)>::type)
- >::type
- type;
- };
+ /// \param expr The expression to modify.
+ /// \return <tt>deep_copy(expr)</tt>
+ template<typename Expr>
+ typename result<by_value_generator(Expr)>::type operator ()(Expr const &e) const
+ {
+ return detail::by_value_generator_<Expr>::call(e);
+ }
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef
- typename Second::template result<
- Second(typename First::template result<First(Expr)>::type)
- >::type
- type;
- };
+ /// \brief A composite generator that first applies one
+ /// transform to an expression and then forwards the result
+ /// on to another generator for further transformation.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c compose_generators\<\> is a composite generator that first
+ /// applies one transform to an expression and then forwards the
+ /// result on to another generator for further transformation.
+ template<typename First, typename Second>
+ struct compose_generators
+ {
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef
- typename Second::template result<
- Second(typename First::template result<First(Expr)>::type)
- >::type
- type;
- };
-
- /// \param expr The expression to modify.
- /// \return Second()(First()(expr))
- template<typename Expr>
- typename result<compose_generators(Expr)>::type operator ()(Expr const &e) const
- {
- return Second()(First()(e));
- }
- };
+ template<typename Sig>
+ struct result;
 
- /// \brief Annotate a generator to indicate that it would
- /// prefer to be passed instances of \c proto::basic_expr\<\> rather
- /// than \c proto::expr\<\>. <tt>use_basic_expr\<Generator\></tt> is
- /// itself a generator.
- ///
- template<typename Generator>
- struct use_basic_expr
- : Generator
- {
- BOOST_PROTO_USE_BASIC_EXPR()
- };
-
- /// \brief Tests a generator to see whether it would prefer
- /// to be passed instances of \c proto::basic_expr\<\> rather than
- /// \c proto::expr\<\>.
- ///
- template<typename Generator, typename Void>
- struct wants_basic_expr
- : mpl::false_
- {};
-
- template<typename Generator>
- struct wants_basic_expr<Generator, typename Generator::proto_use_basic_expr_>
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- template<>
- struct is_callable<default_generator>
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- template<template<typename> class Extends>
- struct is_callable<generator<Extends> >
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- template<template<typename> class Extends>
- struct is_callable<pod_generator<Extends> >
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- template<>
- struct is_callable<by_value_generator>
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- template<typename First, typename Second>
- struct is_callable<compose_generators<First, Second> >
- : mpl::true_
- {};
-
- }}
-
- // Specializations of boost::result_of and boost::tr1_result_of to eliminate
- // some unnecessary template instantiations
- namespace boost
- {
- template<typename Expr>
- struct result_of<proto::default_domain(Expr)>
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
         {
- typedef Expr type;
+ typedef
+ typename Second::template result<
+ Second(typename First::template result<First(Expr)>::type)
+ >::type
+ type;
         };
 
- template<typename Expr>
- struct result_of<proto::default_generator(Expr)>
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
         {
- typedef Expr type;
+ typedef
+ typename Second::template result<
+ Second(typename First::template result<First(Expr)>::type)
+ >::type
+ type;
         };
 
- #if BOOST_VERSION >= 104400
- template<typename Expr>
- struct tr1_result_of<proto::default_domain(Expr)>
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
         {
- typedef Expr type;
+ typedef
+ typename Second::template result<
+ Second(typename First::template result<First(Expr)>::type)
+ >::type
+ type;
         };
 
+ /// \param expr The expression to modify.
+ /// \return Second()(First()(expr))
         template<typename Expr>
- struct tr1_result_of<proto::default_generator(Expr)>
+ typename result<compose_generators(Expr)>::type operator ()(Expr const &e) const
         {
- typedef Expr type;
- };
- #endif
- }
+ return Second()(First()(e));
+ }
+ };
 
- #endif // BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
+ /// \brief Annotate a generator to indicate that it would
+ /// prefer to be passed instances of \c proto::basic_expr\<\> rather
+ /// than \c proto::expr\<\>. <tt>use_basic_expr\<Generator\></tt> is
+ /// itself a generator.
+ ///
+ template<typename Generator>
+ struct use_basic_expr
+ : Generator
+ {
+ BOOST_PROTO_USE_BASIC_EXPR()
+ };
 
-#else // BOOST_PP_IS_ITERATING
+ /// \brief Tests a generator to see whether it would prefer
+ /// to be passed instances of \c proto::basic_expr\<\> rather than
+ /// \c proto::expr\<\>.
+ ///
+ template<typename Generator, typename Void>
+ struct wants_basic_expr
+ : mpl::false_
+ {};
+
+ template<typename Generator>
+ struct wants_basic_expr<Generator, typename Generator::proto_use_basic_expr_>
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ template<>
+ struct is_callable<default_generator>
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ template<template<typename> class Extends>
+ struct is_callable<generator<Extends> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ template<template<typename> class Extends>
+ struct is_callable<pod_generator<Extends> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ template<>
+ struct is_callable<by_value_generator>
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ template<typename First, typename Second>
+ struct is_callable<compose_generators<First, Second> >
+ : mpl::true_
+ {};
+
+}}
+
+// Specializations of boost::result_of and boost::tr1_result_of to eliminate
+// some unnecessary template instantiations
+namespace boost
+{
+ template<typename Expr>
+ struct result_of<proto::default_domain(Expr)>
+ {
+ typedef Expr type;
+ };
 
- #define N BOOST_PP_ITERATION()
+ template<typename Expr>
+ struct result_of<proto::default_generator(Expr)>
+ {
+ typedef Expr type;
+ };
 
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
- struct by_value_generator_<
- proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
- >
- {
- typedef
- BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
- src_args;
-
- typedef
- BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
- >
- dst_args;
-
- typedef proto::expr<Tag, src_args, N> src_type;
- typedef proto::expr<Tag, dst_args, N> type;
-
- static type const call(src_type const &e)
- {
- type that = {
- BOOST_PP_ENUM_PARAMS(N, e.child)
- };
- return that;
- }
- };
-
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
- struct by_value_generator_<
- proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
- >
- {
- typedef
- BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
- src_args;
-
- typedef
- BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
- >
- dst_args;
-
- typedef proto::basic_expr<Tag, src_args, N> src_type;
- typedef proto::basic_expr<Tag, dst_args, N> type;
-
- static type const call(src_type const &e)
- {
- type that = {
- BOOST_PP_ENUM_PARAMS(N, e.child)
- };
- return that;
- }
- };
+ #if BOOST_VERSION >= 104400
+ template<typename Expr>
+ struct tr1_result_of<proto::default_domain(Expr)>
+ {
+ typedef Expr type;
+ };
 
- #undef N
+ template<typename Expr>
+ struct tr1_result_of<proto::default_generator(Expr)>
+ {
+ typedef Expr type;
+ };
+ #endif
+}
 
-#endif
+#endif // BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007

Modified: branches/release/boost/proto/make_expr.hpp
==============================================================================
--- branches/release/boost/proto/make_expr.hpp (original)
+++ branches/release/boost/proto/make_expr.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,821 +1,501 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file make_expr.hpp
- /// Definition of the \c make_expr() and \c unpack_expr() utilities for
- /// building Proto expression nodes from child nodes or from a Fusion
- /// sequence of child nodes, respectively.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
- #define BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
-
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/punctuation/comma_if.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/ref.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/assert.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/add_const.hpp>
- #include <boost/type_traits/add_reference.hpp>
- #include <boost/type_traits/remove_cv.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/domain.hpp>
- #include <boost/proto/generate.hpp>
- #include <boost/fusion/include/begin.hpp>
- #include <boost/fusion/include/next.hpp>
- #include <boost/fusion/include/value_of.hpp>
- #include <boost/fusion/include/size.hpp>
- #include <boost/proto/detail/poly_function.hpp>
- #include <boost/proto/detail/deprecated.hpp>
-
- #ifdef _MSC_VER
- # pragma warning(push)
- # pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
- #endif
+///////////////////////////////////////////////////////////////////////////////
+/// \file make_expr.hpp
+/// Definition of the \c make_expr() and \c unpack_expr() utilities for
+/// building Proto expression nodes from child nodes or from a Fusion
+/// sequence of child nodes, respectively.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
+#define BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/ref.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/domain.hpp>
+#include <boost/proto/generate.hpp>
+#include <boost/fusion/include/begin.hpp>
+#include <boost/fusion/include/next.hpp>
+#include <boost/fusion/include/value_of.hpp>
+#include <boost/fusion/include/size.hpp>
+#include <boost/proto/detail/poly_function.hpp>
+#include <boost/proto/detail/deprecated.hpp>
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
+#endif
+
+namespace boost { namespace proto
+{
+/// INTERNAL ONLY
+///
+#define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
+ typename boost::proto::detail::protoify< \
+ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
+ , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
+ >::result_type \
+ /**/
+
+/// INTERNAL ONLY
+///
+#define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
+ boost::proto::detail::protoify< \
+ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
+ , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
+ >()(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, DATA), N)) \
+ /**/
 
- namespace boost { namespace proto
+ namespace detail
     {
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
- typename boost::proto::detail::protoify< \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
- , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
- >::result_type \
- /**/
+ template<typename T, typename Domain>
+ struct protoify
+ : Domain::template as_expr<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
- boost::proto::detail::protoify< \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
- , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
- >()(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, DATA), N)) \
- /**/
+ template<typename T, typename Domain>
+ struct protoify<T &, Domain>
+ : Domain::template as_child<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE(Z, N, DATA) \
- typedef typename fusion::result_of::next< \
- BOOST_PP_CAT(fusion_iterator, N)>::type \
- BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)); \
- /**/
+ template<typename T, typename Domain>
+ struct protoify<boost::reference_wrapper<T>, Domain>
+ : Domain::template as_child<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_ITERATORS_TYPE(N) \
- typedef \
- typename fusion::result_of::begin<Sequence const>::type \
- fusion_iterator0; \
- BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE, fusion_iterator) \
- /**/
+ template<typename T, typename Domain>
+ struct protoify<boost::reference_wrapper<T> const, Domain>
+ : Domain::template as_child<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
- typename add_const< \
- typename fusion::result_of::value_of< \
- BOOST_PP_CAT(fusion_iterator, N) \
- >::type \
- >::type \
- /**/
+ // Definition of detail::unpack_expr_
+ #include <boost/proto/detail/unpack_expr_.hpp>
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_NEXT_ITERATOR(Z, N, DATA) \
- BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)) BOOST_PP_CAT(it, BOOST_PP_INC(N)) = \
- fusion::next(BOOST_PP_CAT(it, N)); \
- /**/
+ // Definition of detail::make_expr_
+ #include <boost/proto/detail/make_expr_.hpp>
+ }
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_ITERATORS(N) \
- fusion_iterator0 it0 = fusion::begin(sequence); \
- BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR, fusion_iterator) \
- /**/
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AT(Z, N, DATA) \
- *BOOST_PP_CAT(it, N) \
- /**/
+ namespace result_of
+ {
+ /// \brief Metafunction that computes the return type of the
+ /// \c make_expr() function, with a domain deduced from the
+ /// domains of the children.
+ ///
+ /// Use the <tt>result_of::make_expr\<\></tt> metafunction to
+ /// compute the return type of the \c make_expr() function.
+ ///
+ /// In this specialization, the domain is deduced from the
+ /// domains of the child types. (If
+ /// <tt>is_domain\<A0\>::value</tt> is \c true, then another
+ /// specialization is selected.)
+ template<
+ typename Tag
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
+ , typename Void1 // = void
+ , typename Void2 // = void
+ >
+ struct make_expr
+ {
+ /// Same as <tt>result_of::make_expr\<Tag, D, A0, ... AN\>::type</tt>
+ /// where \c D is the deduced domain, which is calculated as follows:
+ ///
+ /// For each \c x in <tt>[0,N)</tt> (proceeding in order beginning with
+ /// <tt>x=0</tt>), if <tt>domain_of\<Ax\>::type</tt> is not
+ /// \c default_domain, then \c D is <tt>domain_of\<Ax\>::type</tt>.
+ /// Otherwise, \c D is \c default_domain.
+ typedef
+ typename detail::make_expr_<
+ Tag
+ , deduce_domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >::result_type
+ type;
+ };
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE(Z, N, DATA) \
- typename detail::protoify< \
- BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
- , Domain \
- >::result_type \
- /**/
+ /// \brief Metafunction that computes the return type of the
+ /// \c make_expr() function, within the specified domain.
+ ///
+ /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
+ /// the return type of the \c make_expr() function.
+ template<
+ typename Tag
+ , typename Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
+ >
+ struct make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ , typename Domain::proto_is_domain_
+ >
+ {
+ /// If \c Tag is <tt>tag::terminal</tt>, then \c type is a
+ /// typedef for <tt>boost::result_of\<Domain(expr\<tag::terminal,
+ /// term\<A0\> \>)\>::type</tt>.
+ ///
+ /// Otherwise, \c type is a typedef for <tt>boost::result_of\<Domain(expr\<Tag,
+ /// listN\< as_child\<A0\>::type, ... as_child\<AN\>::type\>)
+ /// \>::type</tt>, where \c N is the number of non-void template
+ /// arguments, and <tt>as_child\<A\>::type</tt> is evaluated as
+ /// follows:
+ ///
+ /// \li If <tt>is_expr\<A\>::value</tt> is \c true, then the
+ /// child type is \c A.
+ /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
+ /// and <tt>is_expr\<B\>::value</tt> is \c true, then the
+ /// child type is <tt>B &</tt>.
+ /// \li If <tt>is_expr\<A\>::value</tt> is \c false, then the
+ /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<A\> \>
+ /// )\>::type</tt>.
+ /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
+ /// and <tt>is_expr\<B\>::value</tt> is \c false, then the
+ /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<B &\> \>
+ /// )\>::type</tt>.
+ typedef
+ typename detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >::result_type
+ type;
+ };
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AS_CHILD_AT(Z, N, DATA) \
- detail::protoify< \
- BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
- , Domain \
- >()(BOOST_PROTO_FUSION_AT(Z, N, DATA)) \
- /**/
+ /// \brief Metafunction that computes the return type of the
+ /// \c unpack_expr() function, with a domain deduced from the
+ /// domains of the children.
+ ///
+ /// Use the <tt>result_of::unpack_expr\<\></tt> metafunction to
+ /// compute the return type of the \c unpack_expr() function.
+ ///
+ /// \c Sequence is a Fusion Forward Sequence.
+ ///
+ /// In this specialization, the domain is deduced from the
+ /// domains of the child types. (If
+ /// <tt>is_domain\<Sequence>::value</tt> is \c true, then another
+ /// specialization is selected.)
+ template<
+ typename Tag
+ , typename Sequence
+ , typename Void1 // = void
+ , typename Void2 // = void
+ >
+ struct unpack_expr
+ {
+ /// Let \c S be the type of a Fusion Random Access Sequence
+ /// equivalent to \c Sequence. Then \c type is the
+ /// same as <tt>result_of::make_expr\<Tag,
+ /// fusion::result_of::value_at_c\<S, 0\>::type, ...
+ /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
+ /// where \c N is the size of \c S.
+ typedef
+ typename detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence
+ , fusion::result_of::size<Sequence>::type::value
+ >::type
+ type;
+ };
 
- namespace detail
+ /// \brief Metafunction that computes the return type of the
+ /// \c unpack_expr() function, within the specified domain.
+ ///
+ /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
+ /// the return type of the \c make_expr() function.
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
         {
- template<typename T, typename Domain>
- struct protoify
- : Domain::template as_expr<T>
- {};
-
- template<typename T, typename Domain>
- struct protoify<T &, Domain>
- : Domain::template as_child<T>
- {};
-
- template<typename T, typename Domain>
- struct protoify<boost::reference_wrapper<T>, Domain>
- : Domain::template as_child<T>
- {};
+ /// Let \c S be the type of a Fusion Random Access Sequence
+ /// equivalent to \c Sequence. Then \c type is the
+ /// same as <tt>result_of::make_expr\<Tag, Domain,
+ /// fusion::result_of::value_at_c\<S, 0\>::type, ...
+ /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
+ /// where \c N is the size of \c S.
+ typedef
+ typename detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence
+ , fusion::result_of::size<Sequence>::type::value
+ >::type
+ type;
+ };
+ }
 
- template<typename T, typename Domain>
- struct protoify<boost::reference_wrapper<T> const, Domain>
- : Domain::template as_child<T>
- {};
+ namespace functional
+ {
+ /// \brief A callable function object equivalent to the
+ /// \c proto::make_expr() function.
+ ///
+ /// In all cases, <tt>functional::make_expr\<Tag, Domain\>()(a0, ... aN)</tt>
+ /// is equivalent to <tt>proto::make_expr\<Tag, Domain\>(a0, ... aN)</tt>.
+ ///
+ /// <tt>functional::make_expr\<Tag\>()(a0, ... aN)</tt>
+ /// is equivalent to <tt>proto::make_expr\<Tag\>(a0, ... aN)</tt>.
+ template<typename Tag, typename Domain /* = deduce_domain*/>
+ struct make_expr
+ {
+ BOOST_PROTO_CALLABLE()
+ BOOST_PROTO_POLY_FUNCTION()
 
- template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
- struct unpack_expr_
- {};
+ template<typename Sig>
+ struct result;
 
- template<typename Domain, typename Sequence>
- struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
+ template<typename This, typename A0>
+ struct result<This(A0)>
             {
                 typedef
- typename add_const<
- typename fusion::result_of::value_of<
- typename fusion::result_of::begin<Sequence>::type
- >::type
- >::type
- terminal_type;
-
- typedef
- typename proto::detail::protoify<
- terminal_type
+ typename result_of::make_expr<
+ Tag
                       , Domain
- >::result_type
+ , A0
+ >::type
                 type;
-
- static type const call(Sequence const &sequence)
- {
- return proto::detail::protoify<terminal_type, Domain>()(fusion::at_c<0>(sequence));
- }
             };
 
- template<typename Sequence>
- struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
- : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
- {};
+ /// Construct an expression node with tag type \c Tag
+ /// and in the domain \c Domain.
+ ///
+ /// \return <tt>proto::make_expr\<Tag, Domain\>(a0,...aN)</tt>
+ template<typename A0>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 const
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , A0 const
+ >()(a0);
+ }
 
+ // Additional overloads generated by the preprocessor ...
+ #include <boost/proto/detail/make_expr_funop.hpp>
+
+ /// INTERNAL ONLY
+ ///
             template<
- typename Tag
- , typename Domain
- BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ BOOST_PP_ENUM_BINARY_PARAMS(
                     BOOST_PROTO_MAX_ARITY
                   , typename A
                   , = void BOOST_PP_INTERCEPT
                 )
- , typename _ = void
>
- struct make_expr_
- {};
-
- template<typename Domain, typename A>
- struct make_expr_<tag::terminal, Domain, A
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
- {
- typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
-
- result_type operator()(typename add_reference<A>::type a) const
- {
- return proto::detail::protoify<A, Domain>()(a);
- }
- };
-
- template<typename A>
- struct make_expr_<tag::terminal, deduce_domain, A
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
- : make_expr_<tag::terminal, default_domain, A>
+ struct impl
+ : detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >
             {};
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 1)) \
- /**/
-
- #include BOOST_PP_ITERATE()
- }
-
- namespace result_of
+ /// \brief A callable function object equivalent to the
+ /// \c proto::unpack_expr() function.
+ ///
+ /// In all cases, <tt>functional::unpack_expr\<Tag, Domain\>()(seq)</tt>
+ /// is equivalent to <tt>proto::unpack_expr\<Tag, Domain\>(seq)</tt>.
+ ///
+ /// <tt>functional::unpack_expr\<Tag\>()(seq)</tt>
+ /// is equivalent to <tt>proto::unpack_expr\<Tag\>(seq)</tt>.
+ template<typename Tag, typename Domain /* = deduce_domain*/>
+ struct unpack_expr
         {
- /// \brief Metafunction that computes the return type of the
- /// \c make_expr() function, with a domain deduced from the
- /// domains of the children.
- ///
- /// Use the <tt>result_of::make_expr\<\></tt> metafunction to
- /// compute the return type of the \c make_expr() function.
- ///
- /// In this specialization, the domain is deduced from the
- /// domains of the child types. (If
- /// <tt>is_domain\<A0\>::value</tt> is \c true, then another
- /// specialization is selected.)
- template<
- typename Tag
- , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- , typename Void1 // = void
- , typename Void2 // = void
- >
- struct make_expr
- {
- /// Same as <tt>result_of::make_expr\<Tag, D, A0, ... AN\>::type</tt>
- /// where \c D is the deduced domain, which is calculated as follows:
- ///
- /// For each \c x in <tt>[0,N)</tt> (proceeding in order beginning with
- /// <tt>x=0</tt>), if <tt>domain_of\<Ax\>::type</tt> is not
- /// \c default_domain, then \c D is <tt>domain_of\<Ax\>::type</tt>.
- /// Otherwise, \c D is \c default_domain.
- typedef
- typename detail::make_expr_<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >::result_type
- type;
- };
-
- /// \brief Metafunction that computes the return type of the
- /// \c make_expr() function, within the specified domain.
- ///
- /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
- /// the return type of the \c make_expr() function.
- template<
- typename Tag
- , typename Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- >
- struct make_expr<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- , typename Domain::proto_is_domain_
- >
- {
- /// If \c Tag is <tt>tag::terminal</tt>, then \c type is a
- /// typedef for <tt>boost::result_of\<Domain(expr\<tag::terminal,
- /// term\<A0\> \>)\>::type</tt>.
- ///
- /// Otherwise, \c type is a typedef for <tt>boost::result_of\<Domain(expr\<Tag,
- /// listN\< as_child\<A0\>::type, ... as_child\<AN\>::type\>)
- /// \>::type</tt>, where \c N is the number of non-void template
- /// arguments, and <tt>as_child\<A\>::type</tt> is evaluated as
- /// follows:
- ///
- /// \li If <tt>is_expr\<A\>::value</tt> is \c true, then the
- /// child type is \c A.
- /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
- /// and <tt>is_expr\<B\>::value</tt> is \c true, then the
- /// child type is <tt>B &</tt>.
- /// \li If <tt>is_expr\<A\>::value</tt> is \c false, then the
- /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<A\> \>
- /// )\>::type</tt>.
- /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
- /// and <tt>is_expr\<B\>::value</tt> is \c false, then the
- /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<B &\> \>
- /// )\>::type</tt>.
- typedef
- typename detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >::result_type
- type;
- };
+ BOOST_PROTO_CALLABLE()
 
- /// \brief Metafunction that computes the return type of the
- /// \c unpack_expr() function, with a domain deduced from the
- /// domains of the children.
- ///
- /// Use the <tt>result_of::unpack_expr\<\></tt> metafunction to
- /// compute the return type of the \c unpack_expr() function.
- ///
- /// \c Sequence is a Fusion Forward Sequence.
- ///
- /// In this specialization, the domain is deduced from the
- /// domains of the child types. (If
- /// <tt>is_domain\<Sequence>::value</tt> is \c true, then another
- /// specialization is selected.)
- template<
- typename Tag
- , typename Sequence
- , typename Void1 // = void
- , typename Void2 // = void
- >
- struct unpack_expr
- {
- /// Let \c S be the type of a Fusion Random Access Sequence
- /// equivalent to \c Sequence. Then \c type is the
- /// same as <tt>result_of::make_expr\<Tag,
- /// fusion::result_of::value_at_c\<S, 0\>::type, ...
- /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
- /// where \c N is the size of \c S.
- typedef
- typename detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence
- , fusion::result_of::size<Sequence>::type::value
- >::type
- type;
- };
+ template<typename Sig>
+ struct result;
 
- /// \brief Metafunction that computes the return type of the
- /// \c unpack_expr() function, within the specified domain.
- ///
- /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
- /// the return type of the \c make_expr() function.
- template<typename Tag, typename Domain, typename Sequence>
- struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
+ template<typename This, typename Sequence>
+ struct result<This(Sequence)>
             {
- /// Let \c S be the type of a Fusion Random Access Sequence
- /// equivalent to \c Sequence. Then \c type is the
- /// same as <tt>result_of::make_expr\<Tag, Domain,
- /// fusion::result_of::value_at_c\<S, 0\>::type, ...
- /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
- /// where \c N is the size of \c S.
                 typedef
- typename detail::unpack_expr_<
+ typename result_of::unpack_expr<
                         Tag
                       , Domain
- , Sequence
- , fusion::result_of::size<Sequence>::type::value
+ , typename remove_reference<Sequence>::type
>::type
                 type;
             };
- }
 
- namespace functional
- {
- /// \brief A callable function object equivalent to the
- /// \c proto::make_expr() function.
- ///
- /// In all cases, <tt>functional::make_expr\<Tag, Domain\>()(a0, ... aN)</tt>
- /// is equivalent to <tt>proto::make_expr\<Tag, Domain\>(a0, ... aN)</tt>.
+ /// Construct an expression node with tag type \c Tag
+ /// and in the domain \c Domain.
             ///
- /// <tt>functional::make_expr\<Tag\>()(a0, ... aN)</tt>
- /// is equivalent to <tt>proto::make_expr\<Tag\>(a0, ... aN)</tt>.
- template<typename Tag, typename Domain /* = deduce_domain*/>
- struct make_expr
+ /// \param sequence A Fusion Forward Sequence
+ /// \return <tt>proto::unpack_expr\<Tag, Domain\>(sequence)</tt>
+ template<typename Sequence>
+ typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
+ operator ()(Sequence const &sequence) const
             {
- BOOST_PROTO_CALLABLE()
- BOOST_PROTO_POLY_FUNCTION()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename A0>
- struct result<This(A0)>
- {
- typedef
- typename result_of::make_expr<
- Tag
- , Domain
- , A0
- >::type
- type;
- };
-
- /// Construct an expression node with tag type \c Tag
- /// and in the domain \c Domain.
- ///
- /// \return <tt>proto::make_expr\<Tag, Domain\>(a0,...aN)</tt>
- template<typename A0>
- typename result_of::make_expr<
+ return proto::detail::unpack_expr_<
                     Tag
                   , Domain
- , A0 const
- >::type const
- operator ()(A0 const &a0) const
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- , A0 const
- >()(a0);
- }
-
- // Additional overloads generated by the preprocessor ...
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 2)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
- /// INTERNAL ONLY
- ///
- template<
- BOOST_PP_ENUM_BINARY_PARAMS(
- BOOST_PROTO_MAX_ARITY
- , typename A
- , = void BOOST_PP_INTERCEPT
- )
- >
- struct impl
- : detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >
- {};
- };
-
- /// \brief A callable function object equivalent to the
- /// \c proto::unpack_expr() function.
- ///
- /// In all cases, <tt>functional::unpack_expr\<Tag, Domain\>()(seq)</tt>
- /// is equivalent to <tt>proto::unpack_expr\<Tag, Domain\>(seq)</tt>.
- ///
- /// <tt>functional::unpack_expr\<Tag\>()(seq)</tt>
- /// is equivalent to <tt>proto::unpack_expr\<Tag\>(seq)</tt>.
- template<typename Tag, typename Domain /* = deduce_domain*/>
- struct unpack_expr
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Sequence>
- struct result<This(Sequence)>
- {
- typedef
- typename result_of::unpack_expr<
- Tag
- , Domain
- , typename remove_reference<Sequence>::type
- >::type
- type;
- };
-
- /// Construct an expression node with tag type \c Tag
- /// and in the domain \c Domain.
- ///
- /// \param sequence A Fusion Forward Sequence
- /// \return <tt>proto::unpack_expr\<Tag, Domain\>(sequence)</tt>
- template<typename Sequence>
- typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
- operator ()(Sequence const &sequence) const
- {
- return proto::detail::unpack_expr_<
- Tag
- , Domain
- , Sequence const
- , fusion::result_of::size<Sequence>::type::value
- >::call(sequence);
- }
- };
-
- } // namespace functional
-
- /// \brief Construct an expression of the requested tag type
- /// with a domain and with the specified arguments as children.
- ///
- /// This function template may be invoked either with or without
- /// specifying a \c Domain argument. If no domain is specified,
- /// the domain is deduced by examining in order the domains of
- /// the given arguments and taking the first that is not
- /// \c default_domain, if any such domain exists, or
- /// \c default_domain otherwise.
- ///
- /// Let \c wrap_(x) be defined such that:
- /// \li If \c x is a <tt>boost::reference_wrapper\<\></tt>,
- /// \c wrap_(x) is equivalent to <tt>as_child\<Domain\>(x.get())</tt>.
- /// \li Otherwise, \c wrap_(x) is equivalent to
- /// <tt>as_expr\<Domain\>(x)</tt>.
- ///
- /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
- /// <tt>expr\<Tag, listN\<C0,...CN\> \>::make(c0,...cN)</tt>
- /// where \c Bx is the type of \c bx.
- ///
- /// \return <tt>Domain()(make_\<Tag\>(wrap_(a0),...wrap_(aN)))</tt>.
- template<typename Tag, typename A0>
- typename lazy_disable_if<
- is_domain<A0>
- , result_of::make_expr<
- Tag
- , A0 const
- >
- >::type const
- make_expr(A0 const &a0)
- {
- return proto::detail::make_expr_<
- Tag
- , deduce_domain
- , A0 const
- >()(a0);
- }
-
- /// \overload
- ///
- template<typename Tag, typename Domain, typename C0>
- typename result_of::make_expr<
- Tag
- , Domain
- , C0 const
- >::type const
- make_expr(C0 const &c0)
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- , C0 const
- >()(c0);
- }
-
- // Additional overloads generated by the preprocessor...
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 3)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
- /// \brief Construct an expression of the requested tag type
- /// with a domain and with childres from the specified Fusion
- /// Forward Sequence.
- ///
- /// This function template may be invoked either with or without
- /// specifying a \c Domain argument. If no domain is specified,
- /// the domain is deduced by examining in order the domains of the
- /// elements of \c sequence and taking the first that is not
- /// \c default_domain, if any such domain exists, or
- /// \c default_domain otherwise.
- ///
- /// Let \c s be a Fusion Random Access Sequence equivalent to \c sequence.
- /// Let <tt>wrap_\<N\>(s)</tt>, where \c s has type \c S, be defined
- /// such that:
- /// \li If <tt>fusion::result_of::value_at_c\<S,N\>::type</tt> is a reference,
- /// <tt>wrap_\<N\>(s)</tt> is equivalent to
- /// <tt>as_child\<Domain\>(fusion::at_c\<N\>(s))</tt>.
- /// \li Otherwise, <tt>wrap_\<N\>(s)</tt> is equivalent to
- /// <tt>as_expr\<Domain\>(fusion::at_c\<N\>(s))</tt>.
- ///
- /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
- /// <tt>expr\<Tag, listN\<B0,...BN\> \>::make(b0,...bN)</tt>
- /// where \c Bx is the type of \c bx.
- ///
- /// \param sequence a Fusion Forward Sequence.
- /// \return <tt>Domain()(make_\<Tag\>(wrap_\<0\>(s),...wrap_\<N-1\>(s)))</tt>,
- /// where N is the size of \c Sequence.
- template<typename Tag, typename Sequence>
- typename lazy_disable_if<
- is_domain<Sequence>
- , result_of::unpack_expr<Tag, Sequence const>
- >::type const
- unpack_expr(Sequence const &sequence)
- {
- return proto::detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence const
- , fusion::result_of::size<Sequence>::type::value
- >::call(sequence);
- }
-
- /// \overload
- ///
- template<typename Tag, typename Domain, typename Sequence2>
- typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
- unpack_expr(Sequence2 const &sequence2)
- {
- return proto::detail::unpack_expr_<
- Tag
- , Domain
- , Sequence2 const
- , fusion::result_of::size<Sequence2>::type::value
- >::call(sequence2);
- }
-
- /// INTERNAL ONLY
- ///
- template<typename Tag, typename Domain>
- struct is_callable<functional::make_expr<Tag, Domain> >
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- ///
- template<typename Tag, typename Domain>
- struct is_callable<functional::unpack_expr<Tag, Domain> >
- : mpl::true_
- {};
-
- }}
-
- #ifdef _MSC_VER
- # pragma warning(pop)
- #endif
-
- #undef BOOST_PROTO_FUSION_AT
- #undef BOOST_PROTO_FUSION_AT_TYPE
- #undef BOOST_PROTO_FUSION_AS_CHILD_AT
- #undef BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE
- #undef BOOST_PROTO_FUSION_NEXT_ITERATOR
- #undef BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE
- #undef BOOST_PROTO_FUSION_ITERATORS
- #undef BOOST_PROTO_FUSION_ITERATORS_TYPE
-
- #endif // BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
-
-#elif BOOST_PP_ITERATION_FLAGS() == 1
-
- #define N BOOST_PP_ITERATION()
- #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
-
- template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make_expr_<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
- {
- typedef
- BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD_TYPE, (A, ~, Domain))
- >
- proto_args;
-
- typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
- typedef typename Domain::proto_generator proto_generator;
- typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
-
- result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<A, >::type a)) const
- {
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD, (A, a, Domain))
- };
- return proto_generator()(that);
- }
- };
-
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make_expr_<Tag, deduce_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
- : make_expr_<
- Tag
- , typename BOOST_PP_CAT(deduce_domain, N)<BOOST_PP_ENUM_PARAMS(N, A)>::type
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- >
- {};
-
- template<typename Tag, typename Domain, typename Sequence>
- struct unpack_expr_<Tag, Domain, Sequence, N>
- {
- BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
-
- typedef
- BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE, ~)
- >
- proto_args;
-
- typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
- typedef typename Domain::proto_generator proto_generator;
- typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
-
- static type const call(Sequence const &sequence)
- {
- BOOST_PROTO_FUSION_ITERATORS(N)
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT, ~)
- };
- return proto_generator()(that);
- }
- };
-
- template<typename Tag, typename Sequence>
- struct unpack_expr_<Tag, deduce_domain, Sequence, N>
- {
- BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
-
- typedef
- unpack_expr_<
- Tag
- , typename BOOST_PP_CAT(deduce_domain, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AT_TYPE, ~)
- >::type
- , Sequence
- , N
- >
- other;
-
- typedef typename other::type type;
-
- static type const call(Sequence const &sequence)
- {
- return other::call(sequence);
+ , Sequence const
+ , fusion::result_of::size<Sequence>::type::value
+ >::call(sequence);
             }
         };
 
- #undef N
- #undef M
-
-#elif BOOST_PP_ITERATION_FLAGS() == 2
+ } // namespace functional
 
- #define N BOOST_PP_ITERATION()
-
- template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
- {
- typedef
- typename result_of::make_expr<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- >::type
- type;
- };
+ /// \brief Construct an expression of the requested tag type
+ /// with a domain and with the specified arguments as children.
+ ///
+ /// This function template may be invoked either with or without
+ /// specifying a \c Domain argument. If no domain is specified,
+ /// the domain is deduced by examining in order the domains of
+ /// the given arguments and taking the first that is not
+ /// \c default_domain, if any such domain exists, or
+ /// \c default_domain otherwise.
+ ///
+ /// Let \c wrap_(x) be defined such that:
+ /// \li If \c x is a <tt>boost::reference_wrapper\<\></tt>,
+ /// \c wrap_(x) is equivalent to <tt>as_child\<Domain\>(x.get())</tt>.
+ /// \li Otherwise, \c wrap_(x) is equivalent to
+ /// <tt>as_expr\<Domain\>(x)</tt>.
+ ///
+ /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
+ /// <tt>expr\<Tag, listN\<C0,...CN\> \>::make(c0,...cN)</tt>
+ /// where \c Bx is the type of \c bx.
+ ///
+ /// \return <tt>Domain()(make_\<Tag\>(wrap_(a0),...wrap_(aN)))</tt>.
+ template<typename Tag, typename A0>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , A0 const
+ >
+ >::type const
+ make_expr(A0 const &a0)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , A0 const
+ >()(a0);
+ }
 
- /// \overload
- ///
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- typename result_of::make_expr<
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename C0>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , C0 const
+ >::type const
+ make_expr(C0 const &c0)
+ {
+ return proto::detail::make_expr_<
             Tag
           , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >::type const
- operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >()(BOOST_PP_ENUM_PARAMS(N, a));
- }
-
- #undef N
-
-#elif BOOST_PP_ITERATION_FLAGS() == 3
+ , C0 const
+ >()(c0);
+ }
 
- #define N BOOST_PP_ITERATION()
+ // Additional overloads generated by the preprocessor...
+ #include <boost/proto/detail/make_expr.hpp>
 
- /// \overload
- ///
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- typename lazy_disable_if<
- is_domain<A0>
- , result_of::make_expr<
- Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >
- >::type const
- make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a))
- {
- return proto::detail::make_expr_<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >()(BOOST_PP_ENUM_PARAMS(N, a));
- }
+ /// \brief Construct an expression of the requested tag type
+ /// with a domain and with childres from the specified Fusion
+ /// Forward Sequence.
+ ///
+ /// This function template may be invoked either with or without
+ /// specifying a \c Domain argument. If no domain is specified,
+ /// the domain is deduced by examining in order the domains of the
+ /// elements of \c sequence and taking the first that is not
+ /// \c default_domain, if any such domain exists, or
+ /// \c default_domain otherwise.
+ ///
+ /// Let \c s be a Fusion Random Access Sequence equivalent to \c sequence.
+ /// Let <tt>wrap_\<N\>(s)</tt>, where \c s has type \c S, be defined
+ /// such that:
+ /// \li If <tt>fusion::result_of::value_at_c\<S,N\>::type</tt> is a reference,
+ /// <tt>wrap_\<N\>(s)</tt> is equivalent to
+ /// <tt>as_child\<Domain\>(fusion::at_c\<N\>(s))</tt>.
+ /// \li Otherwise, <tt>wrap_\<N\>(s)</tt> is equivalent to
+ /// <tt>as_expr\<Domain\>(fusion::at_c\<N\>(s))</tt>.
+ ///
+ /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
+ /// <tt>expr\<Tag, listN\<B0,...BN\> \>::make(b0,...bN)</tt>
+ /// where \c Bx is the type of \c bx.
+ ///
+ /// \param sequence a Fusion Forward Sequence.
+ /// \return <tt>Domain()(make_\<Tag\>(wrap_\<0\>(s),...wrap_\<N-1\>(s)))</tt>,
+ /// where N is the size of \c Sequence.
+ template<typename Tag, typename Sequence>
+ typename lazy_disable_if<
+ is_domain<Sequence>
+ , result_of::unpack_expr<Tag, Sequence const>
+ >::type const
+ unpack_expr(Sequence const &sequence)
+ {
+ return proto::detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence const
+ , fusion::result_of::size<Sequence>::type::value
+ >::call(sequence);
+ }
 
- /// \overload
- ///
- template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename C)>
- typename result_of::make_expr<
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename Sequence2>
+ typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
+ unpack_expr(Sequence2 const &sequence2)
+ {
+ return proto::detail::unpack_expr_<
             Tag
           , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
- >::type const
- make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const C, &c))
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
- >()(BOOST_PP_ENUM_PARAMS(N, c));
- }
+ , Sequence2 const
+ , fusion::result_of::size<Sequence2>::type::value
+ >::call(sequence2);
+ }
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Tag, typename Domain>
+ struct is_callable<functional::make_expr<Tag, Domain> >
+ : mpl::true_
+ {};
 
- #undef N
+ /// INTERNAL ONLY
+ ///
+ template<typename Tag, typename Domain>
+ struct is_callable<functional::unpack_expr<Tag, Domain> >
+ : mpl::true_
+ {};
+
+}}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
 
-#endif // BOOST_PP_IS_ITERATING
+#endif // BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005

Modified: branches/release/boost/proto/matches.hpp
==============================================================================
--- branches/release/boost/proto/matches.hpp (original)
+++ branches/release/boost/proto/matches.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,1117 +1,918 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file matches.hpp
- /// Contains definition of matches\<\> metafunction for determining if
- /// a given expression matches a given pattern.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006
- #define BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006
-
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/punctuation/comma_if.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_shifted.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/config.hpp>
- #include <boost/mpl/logical.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/mpl/aux_/template_arity.hpp>
- #include <boost/mpl/aux_/lambda_arity_param.hpp>
- #include <boost/utility/enable_if.hpp>
- #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
- #include <boost/type_traits/is_array.hpp>
- #endif
- #include <boost/type_traits/is_const.hpp>
- #include <boost/type_traits/is_convertible.hpp>
- #include <boost/type_traits/is_reference.hpp>
- #include <boost/type_traits/is_pointer.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/when.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- // Some compilers (like GCC) need extra help figuring out a template's arity.
- // I use MPL's BOOST_MPL_AUX_LAMBDA_ARITY_PARAM() macro to disambiguate, which
- // which is controlled by the BOOST_MPL_LIMIT_METAFUNCTION_ARITY macro. If
- // You define BOOST_PROTO_MAX_ARITY to be greater than
- // BOOST_MPL_LIMIT_METAFUNCTION_ARITY on these compilers, things don't work.
- // You must define BOOST_MPL_LIMIT_METAFUNCTION_ARITY to be greater.
- #ifdef BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
- # if BOOST_PROTO_MAX_ARITY > BOOST_MPL_LIMIT_METAFUNCTION_ARITY
- # error BOOST_MPL_LIMIT_METAFUNCTION_ARITY must be at least as large as BOOST_PROTO_MAX_ARITY
- # endif
- #endif
-
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- # pragma warning(push)
- # pragma warning(disable:4305) // 'specialization' : truncation from 'const int' to 'bool'
- #endif
-
- namespace boost { namespace proto
- {
+///////////////////////////////////////////////////////////////////////////////
+/// \file matches.hpp
+/// Contains definition of matches\<\> metafunction for determining if
+/// a given expression matches a given pattern.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006
+#define BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/config.hpp>
+#include <boost/mpl/logical.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/proto/detail/template_arity.hpp>
+#include <boost/utility/enable_if.hpp>
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+#include <boost/type_traits/is_array.hpp>
+#endif
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/when.hpp>
+#include <boost/proto/transform/impl.hpp>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable:4305) // 'specialization' : truncation from 'const int' to 'bool'
+#endif
 
- namespace detail
- {
- template<typename Expr, typename BasicExpr, typename Grammar>
- struct matches_;
+#define BOOST_PROTO_LOGICAL_typename_G BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)
+#define BOOST_PROTO_LOGICAL_G BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)
 
- template<bool B, typename Pred>
- struct and_2;
+namespace boost { namespace proto
+{
 
- template<typename And, typename Expr, typename State, typename Data>
- struct _and_impl;
+ namespace detail
+ {
+ template<typename Expr, typename BasicExpr, typename Grammar>
+ struct matches_;
 
- template<typename T, typename U>
- struct array_matches
- : mpl::false_
- {};
-
- template<typename T, std::size_t M>
- struct array_matches<T[M], T *>
- : mpl::true_
- {};
-
- template<typename T, std::size_t M>
- struct array_matches<T[M], T const *>
- : mpl::true_
- {};
-
- template<typename T, std::size_t M>
- struct array_matches<T[M], T[proto::N]>
- : mpl::true_
- {};
+ template<bool B, typename Pred>
+ struct and_2;
 
- template<typename T, typename U
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(long Arity = mpl::aux::template_arity<U>::value)
- >
- struct lambda_matches
- : mpl::false_
- {};
-
- template<typename T>
- struct lambda_matches<T, proto::_ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
- : mpl::true_
- {};
-
- template<typename T>
- struct lambda_matches<T, T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
- : mpl::true_
- {};
-
- template<typename T, std::size_t M, typename U>
- struct lambda_matches<T[M], U BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
- : array_matches<T[M], U>
- {};
-
- template<typename T, std::size_t M>
- struct lambda_matches<T[M], _ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
- : mpl::true_
- {};
-
- template<typename T, std::size_t M>
- struct lambda_matches<T[M], T[M] BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
- : mpl::true_
- {};
-
- template<template<typename> class T, typename Expr0, typename Grammar0>
- struct lambda_matches<T<Expr0>, T<Grammar0> BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(1) >
- : lambda_matches<Expr0, Grammar0>
- {};
-
- // vararg_matches_impl
- template<typename Args1, typename Back, long From, long To>
- struct vararg_matches_impl;
-
- // vararg_matches
- template<typename Expr, typename Args1, typename Args2, typename Back, bool Can, bool Zero, typename Void = void>
- struct vararg_matches
- : mpl::false_
- {};
-
- template<typename Expr, typename Args1, typename Args2, typename Back>
- struct vararg_matches<Expr, Args1, Args2, Back, true, true, typename Back::proto_is_vararg_>
- : matches_<
- Expr
- , proto::basic_expr<ignore, Args1, Args1::arity>
- , proto::basic_expr<ignore, Args2, Args1::arity>
- >
- {};
+ template<typename And, typename Expr, typename State, typename Data>
+ struct _and_impl;
 
- template<typename Expr, typename Args1, typename Args2, typename Back>
- struct vararg_matches<Expr, Args1, Args2, Back, true, false, typename Back::proto_is_vararg_>
- : and_2<
- matches_<
- Expr
- , proto::basic_expr<ignore, Args1, Args2::arity>
- , proto::basic_expr<ignore, Args2, Args2::arity>
- >::value
- , vararg_matches_impl<Args1, typename Back::proto_grammar, Args2::arity + 1, Args1::arity>
- >
- {};
+ template<typename T, typename U>
+ struct array_matches
+ : mpl::false_
+ {};
 
- // How terminal_matches<> handles references and cv-qualifiers.
- // The cv and ref matter *only* if the grammar has a top-level ref.
- //
- // Expr | Grammar | Matches?
- // -------------------------------------
- // T T yes
- // T & T yes
- // T const & T yes
- // T T & no
- // T & T & yes
- // T const & T & no
- // T T const & no
- // T & T const & no
- // T const & T const & yes
-
- template<typename T, typename U>
- struct is_cv_ref_compatible
- : mpl::true_
- {};
-
- template<typename T, typename U>
- struct is_cv_ref_compatible<T, U &>
- : mpl::false_
- {};
-
- template<typename T, typename U>
- struct is_cv_ref_compatible<T &, U &>
- : mpl::bool_<is_const<T>::value == is_const<U>::value>
- {};
-
- #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
- // MSVC-7.1 has lots of problems with array types that have been
- // deduced. Partially specializing terminal_matches<> on array types
- // doesn't seem to work.
- template<
- typename T
- , typename U
- , bool B = is_array<BOOST_PROTO_UNCVREF(T)>::value
- >
- struct terminal_array_matches
- : mpl::false_
- {};
-
- template<typename T, typename U, std::size_t M>
- struct terminal_array_matches<T, U(&)[M], true>
- : is_convertible<T, U(&)[M]>
- {};
-
- template<typename T, typename U>
- struct terminal_array_matches<T, U(&)[proto::N], true>
- : is_convertible<T, U *>
- {};
-
- template<typename T, typename U>
- struct terminal_array_matches<T, U *, true>
- : is_convertible<T, U *>
- {};
-
- // terminal_matches
- template<typename T, typename U>
- struct terminal_matches
- : mpl::or_<
- mpl::and_<
- is_cv_ref_compatible<T, U>
- , lambda_matches<
- BOOST_PROTO_UNCVREF(T)
- , BOOST_PROTO_UNCVREF(U)
- >
- >
- , terminal_array_matches<T, U>
- >
- {};
- #else
- // terminal_matches
- template<typename T, typename U>
- struct terminal_matches
- : mpl::and_<
- is_cv_ref_compatible<T, U>
- , lambda_matches<
- BOOST_PROTO_UNCVREF(T)
- , BOOST_PROTO_UNCVREF(U)
- >
- >
- {};
+ template<typename T, std::size_t M>
+ struct array_matches<T[M], T *>
+ : mpl::true_
+ {};
 
- template<typename T, std::size_t M>
- struct terminal_matches<T(&)[M], T(&)[proto::N]>
- : mpl::true_
- {};
-
- template<typename T, std::size_t M>
- struct terminal_matches<T(&)[M], T *>
- : mpl::true_
- {};
-
- // Avoid ambiguity errors on MSVC
- #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
- template<typename T, std::size_t M>
- struct terminal_matches<T const (&)[M], T const[M]>
- : mpl::true_
- {};
- #endif
- #endif
+ template<typename T, std::size_t M>
+ struct array_matches<T[M], T const *>
+ : mpl::true_
+ {};
 
- template<typename T>
- struct terminal_matches<T, T>
- : mpl::true_
- {};
-
- template<typename T>
- struct terminal_matches<T &, T>
- : mpl::true_
- {};
-
- template<typename T>
- struct terminal_matches<T const &, T>
- : mpl::true_
- {};
-
- template<typename T>
- struct terminal_matches<T, proto::_>
- : mpl::true_
- {};
-
- template<typename T>
- struct terminal_matches<T, exact<T> >
- : mpl::true_
- {};
-
- template<typename T, typename U>
- struct terminal_matches<T, proto::convertible_to<U> >
- : is_convertible<T, U>
- {};
-
- // matches_
- template<typename Expr, typename BasicExpr, typename Grammar>
- struct matches_
- : mpl::false_
- {};
-
- template<typename Expr, typename BasicExpr>
- struct matches_< Expr, BasicExpr, proto::_ >
- : mpl::true_
- {};
-
- template<typename Expr, typename Tag, typename Args1, long N1, typename Args2, long N2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<Tag, Args2, N2> >
- : vararg_matches< Expr, Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) >
- {};
-
- template<typename Expr, typename Tag, typename Args1, long N1, typename Args2, long N2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<proto::_, Args2, N2> >
- : vararg_matches< Expr, Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) >
- {};
-
- template<typename Expr, typename Tag, typename Args1, typename Args2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<Tag, Args2, 0> >
- : terminal_matches<typename Args1::child0, typename Args2::child0>
- {};
-
- template<typename Expr, typename Tag, typename Args1, typename Args2, long N2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, N2> >
- : mpl::false_
- {};
-
- template<typename Expr, typename Tag, typename Args1, typename Args2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, 0> >
- : terminal_matches<typename Args1::child0, typename Args2::child0>
- {};
-
- template<typename Expr, typename Tag, typename Args1, typename Args2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<Tag, Args2, 1> >
- : matches_<
- typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr
- , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar
- , typename Args2::child0::proto_grammar
- >
- {};
+ template<typename T, std::size_t M>
+ struct array_matches<T[M], T[proto::N]>
+ : mpl::true_
+ {};
 
- template<typename Expr, typename Tag, typename Args1, typename Args2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<proto::_, Args2, 1> >
- : matches_<
- typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr
- , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar
- , typename Args2::child0::proto_grammar
- >
- {};
+ template<typename T, typename U
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(long Arity = detail::template_arity<U>::value)
+ >
+ struct lambda_matches
+ : mpl::false_
+ {};
 
- #define BOOST_PROTO_MATCHES_N_FUN(Z, N, DATA) \
- matches_< \
- typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_derived_expr \
- , typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_grammar \
- , typename Args2::BOOST_PP_CAT(child, N)::proto_grammar \
- >
+ template<typename T>
+ struct lambda_matches<T, proto::_ BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)>
+ : mpl::true_
+ {};
 
- #define BOOST_PROTO_DEFINE_MATCHES(Z, N, DATA) \
- matches_< \
- Expr \
- , BasicExpr \
- , typename BOOST_PP_CAT(G, N)::proto_grammar \
- >
+ template<typename T>
+ struct lambda_matches<T, T BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)>
+ : mpl::true_
+ {};
 
- #define BOOST_PROTO_DEFINE_LAMBDA_MATCHES(Z, N, DATA) \
- lambda_matches< \
- BOOST_PP_CAT(Expr, N) \
- , BOOST_PP_CAT(Grammar, N) \
- >
+ template<typename T, std::size_t M, typename U>
+ struct lambda_matches<T[M], U BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)>
+ : array_matches<T[M], U>
+ {};
 
- #if BOOST_PROTO_MAX_LOGICAL_ARITY > BOOST_PROTO_MAX_ARITY
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (2, BOOST_PROTO_MAX_LOGICAL_ARITY, <boost/proto/matches.hpp>, 1))
- #else
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/matches.hpp>, 1))
- #endif
- #include BOOST_PP_ITERATE()
+ template<typename T, std::size_t M>
+ struct lambda_matches<T[M], _ BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)>
+ : mpl::true_
+ {};
 
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/matches.hpp>, 2))
- #include BOOST_PP_ITERATE()
+ template<typename T, std::size_t M>
+ struct lambda_matches<T[M], T[M] BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)>
+ : mpl::true_
+ {};
 
- #undef BOOST_PROTO_MATCHES_N_FUN
- #undef BOOST_PROTO_DEFINE_MATCHES
- #undef BOOST_PROTO_DEFINE_LAMBDA_MATCHES
-
- // handle proto::if_
- template<typename Expr, typename Tag, typename Args, long Arity, typename If, typename Then, typename Else>
- struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, proto::if_<If, Then, Else> >
- : mpl::eval_if_c<
- remove_reference<
- typename when<_, If>::template impl<Expr, int, int>::result_type
- >::type::value
- , matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Then::proto_grammar>
- , matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Else::proto_grammar>
- >::type
- {
- typedef
- typename mpl::if_c<
- remove_reference<
- typename when<_, If>::template impl<Expr, int, int>::result_type
- >::type::value
- , Then
- , Else
- >::type
- which;
- };
-
- // handle degenerate cases of proto::or_
- template<typename Expr, typename BasicExpr>
- struct matches_<Expr, BasicExpr, or_<> >
- : mpl::false_
- {
- typedef not_<_> which;
- };
+ template<template<typename> class T, typename Expr0, typename Grammar0>
+ struct lambda_matches<T<Expr0>, T<Grammar0> BOOST_PROTO_TEMPLATE_ARITY_PARAM(1) >
+ : lambda_matches<Expr0, Grammar0>
+ {};
 
- template<typename Expr, typename BasicExpr, typename G0>
- struct matches_<Expr, BasicExpr, or_<G0> >
- : matches_<Expr, BasicExpr, typename G0::proto_grammar>
- {
- typedef G0 which;
- };
+ // vararg_matches_impl
+ template<typename Args1, typename Back, long From, long To>
+ struct vararg_matches_impl;
+
+ // vararg_matches
+ template<typename Expr, typename Args1, typename Args2, typename Back, bool Can, bool Zero, typename Void = void>
+ struct vararg_matches
+ : mpl::false_
+ {};
 
- // handle degenerate cases of proto::and_
- template<typename Expr, typename BasicExpr>
- struct matches_<Expr, BasicExpr, and_<> >
- : mpl::true_
- {};
-
- template<typename Expr, typename BasicExpr, typename G0>
- struct matches_<Expr, BasicExpr, and_<G0> >
- : matches_<Expr, BasicExpr, typename G0::proto_grammar>
- {};
-
- // handle proto::not_
- template<typename Expr, typename BasicExpr, typename Grammar>
- struct matches_<Expr, BasicExpr, not_<Grammar> >
- : mpl::not_<matches_<Expr, BasicExpr, typename Grammar::proto_grammar> >
- {};
-
- // handle proto::switch_
- template<typename Expr, typename Tag, typename Args, long Arity, typename Cases>
- struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, switch_<Cases> >
- : matches_<
- Expr
- , proto::basic_expr<Tag, Args, Arity>
- , typename Cases::template case_<Tag>::proto_grammar
- >
- {
- typedef typename Cases::template case_<Tag> which;
- };
- }
-
- /// \brief A Boolean metafunction that evaluates whether a given
- /// expression type matches a grammar.
- ///
- /// <tt>matches\<Expr,Grammar\></tt> inherits (indirectly) from
- /// \c mpl::true_ if <tt>Expr::proto_grammar</tt> matches
- /// <tt>Grammar::proto_grammar</tt>, and from \c mpl::false_
- /// otherwise.
- ///
- /// Non-terminal expressions are matched against a grammar
- /// according to the following rules:
- ///
- /// \li The wildcard pattern, \c _, matches any expression.
- /// \li An expression <tt>expr\<AT, listN\<A0,A1,...An\> \></tt>
- /// matches a grammar <tt>expr\<BT, listN\<B0,B1,...Bn\> \></tt>
- /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx for
- /// each \c x in <tt>[0,n)</tt>.
- /// \li An expression <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
- /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
- /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
- /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
- /// for each \c x in <tt>[0,m)</tt>.
- /// \li An expression \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
- /// matches some \c Bx for \c x in <tt>[0,n)</tt>.
- /// \li An expression \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
- /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
- /// \li An expression \c E matches <tt>if_\<T,U,V\></tt> if
- /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::type::value</tt>
- /// is \c true and \c E matches \c U; or, if
- /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::type::value</tt>
- /// is \c false and \c E matches \c V. (Note: \c U defaults to \c _
- /// and \c V defaults to \c not_\<_\>.)
- /// \li An expression \c E matches <tt>not_\<T\></tt> if \c E does
- /// not match \c T.
- /// \li An expression \c E matches <tt>switch_\<C\></tt> if
- /// \c E matches <tt>C::case_\<E::proto_tag\></tt>.
- ///
- /// A terminal expression <tt>expr\<AT,term\<A\> \></tt> matches
- /// a grammar <tt>expr\<BT,term\<B\> \></tt> if \c BT is \c AT or
- /// \c proto::_ and if one of the following is true:
- ///
- /// \li \c B is the wildcard pattern, \c _
- /// \li \c A is \c B
- /// \li \c A is <tt>B &</tt>
- /// \li \c A is <tt>B const &</tt>
- /// \li \c B is <tt>exact\<A\></tt>
- /// \li \c B is <tt>convertible_to\<X\></tt> and
- /// <tt>is_convertible\<A,X\>::value</tt> is \c true.
- /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
- /// \c B is <tt>X[proto::N]</tt>.
- /// \li \c A is <tt>X(&)[M]</tt> and \c B is <tt>X(&)[proto::N]</tt>.
- /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
- /// \c B is <tt>X*</tt>.
- /// \li \c B lambda-matches \c A (see below).
- ///
- /// A type \c B lambda-matches \c A if one of the following is true:
- ///
- /// \li \c B is \c A
- /// \li \c B is the wildcard pattern, \c _
- /// \li \c B is <tt>T\<B0,B1,...Bn\></tt> and \c A is
- /// <tt>T\<A0,A1,...An\></tt> and for each \c x in
- /// <tt>[0,n)</tt>, \c Ax and \c Bx are types
- /// such that \c Ax lambda-matches \c Bx
- template<typename Expr, typename Grammar>
- struct matches
- : detail::matches_<
- typename Expr::proto_derived_expr
- , typename Expr::proto_grammar
- , typename Grammar::proto_grammar
+ template<typename Expr, typename Args1, typename Args2, typename Back>
+ struct vararg_matches<Expr, Args1, Args2, Back, true, true, typename Back::proto_is_vararg_>
+ : matches_<
+ Expr
+ , proto::basic_expr<ignore, Args1, Args1::arity>
+ , proto::basic_expr<ignore, Args2, Args1::arity>
>
         {};
 
- /// INTERNAL ONLY
- ///
- template<typename Expr, typename Grammar>
- struct matches<Expr &, Grammar>
- : detail::matches_<
- typename Expr::proto_derived_expr
- , typename Expr::proto_grammar
- , typename Grammar::proto_grammar
+ template<typename Expr, typename Args1, typename Args2, typename Back>
+ struct vararg_matches<Expr, Args1, Args2, Back, true, false, typename Back::proto_is_vararg_>
+ : and_2<
+ matches_<
+ Expr
+ , proto::basic_expr<ignore, Args1, Args2::arity>
+ , proto::basic_expr<ignore, Args2, Args2::arity>
+ >::value
+ , vararg_matches_impl<Args1, typename Back::proto_grammar, Args2::arity + 1, Args1::arity>
>
         {};
 
- /// \brief A wildcard grammar element that matches any expression,
- /// and a transform that returns the current expression unchanged.
- ///
- /// The wildcard type, \c _, is a grammar element such that
- /// <tt>matches\<E,_\>::value</tt> is \c true for any expression
- /// type \c E.
- ///
- /// The wildcard can also be used as a stand-in for a template
- /// argument when matching terminals. For instance, the following
- /// is a grammar that will match any <tt>std::complex\<\></tt>
- /// terminal:
- ///
- /// \code
- /// BOOST_MPL_ASSERT((
- /// matches<
- /// terminal<std::complex<double> >::type
- /// , terminal<std::complex< _ > >
- /// >
- /// ));
- /// \endcode
- ///
- /// When used as a transform, \c _ returns the current expression
- /// unchanged. For instance, in the following, \c _ is used with
- /// the \c fold\<\> transform to fold the children of a node:
- ///
- /// \code
- /// struct CountChildren
- /// : or_<
- /// // Terminals have no children
- /// when<terminal<_>, mpl::int_<0>()>
- /// // Use fold<> to count the children of non-terminals
- /// , otherwise<
- /// fold<
- /// _ // <-- fold the current expression
- /// , mpl::int_<0>()
- /// , mpl::plus<_state, mpl::int_<1> >()
- /// >
- /// >
- /// >
- /// {};
- /// \endcode
- struct _ : transform<_>
- {
- typedef _ proto_grammar;
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
- /// \param expr An expression
- /// \return \c e
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
- };
+ // How terminal_matches<> handles references and cv-qualifiers.
+ // The cv and ref matter *only* if the grammar has a top-level ref.
+ //
+ // Expr | Grammar | Matches?
+ // -------------------------------------
+ // T T yes
+ // T & T yes
+ // T const & T yes
+ // T T & no
+ // T & T & yes
+ // T const & T & no
+ // T T const & no
+ // T & T const & no
+ // T const & T const & yes
 
- namespace detail
- {
- template<typename Expr, typename State, typename Data>
- struct _and_impl<proto::and_<>, Expr, State, Data>
- : proto::_::impl<Expr, State, Data>
- {};
-
- template<typename G0, typename Expr, typename State, typename Data>
- struct _and_impl<proto::and_<G0>, Expr, State, Data>
- : proto::when<proto::_, G0>::template impl<Expr, State, Data>
- {};
- }
-
- /// \brief Inverts the set of expressions matched by a grammar. When
- /// used as a transform, \c not_\<\> returns the current expression
- /// unchanged.
- ///
- /// If an expression type \c E does not match a grammar \c G, then
- /// \c E \e does match <tt>not_\<G\></tt>. For example,
- /// <tt>not_\<terminal\<_\> \></tt> will match any non-terminal.
- template<typename Grammar>
- struct not_ : transform<not_<Grammar> >
- {
- typedef not_ proto_grammar;
+ template<typename T, typename U>
+ struct is_cv_ref_compatible
+ : mpl::true_
+ {};
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
+ template<typename T, typename U>
+ struct is_cv_ref_compatible<T, U &>
+ : mpl::false_
+ {};
 
- /// \param e An expression
- /// \pre <tt>matches\<Expr,not_\>::value</tt> is \c true.
- /// \return \c e
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
- };
+ template<typename T, typename U>
+ struct is_cv_ref_compatible<T &, U &>
+ : mpl::bool_<is_const<T>::value == is_const<U>::value>
+ {};
 
- /// \brief Used to select one grammar or another based on the result
- /// of a compile-time Boolean. When used as a transform, \c if_\<\>
- /// selects between two transforms based on a compile-time Boolean.
- ///
- /// When <tt>if_\<If,Then,Else\></tt> is used as a grammar, \c If
- /// must be a Proto transform and \c Then and \c Else must be grammars.
- /// An expression type \c E matches <tt>if_\<If,Then,Else\></tt> if
- /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt>
- /// is \c true and \c E matches \c U; or, if
- /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt>
- /// is \c false and \c E matches \c V.
- ///
- /// The template parameter \c Then defaults to \c _
- /// and \c Else defaults to \c not\<_\>, so an expression type \c E
- /// will match <tt>if_\<If\></tt> if and only if
- /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt>
- /// is \c true.
- ///
- /// \code
- /// // A grammar that only matches integral terminals,
- /// // using is_integral<> from Boost.Type_traits.
- /// struct IsIntegral
- /// : and_<
- /// terminal<_>
- /// , if_< is_integral<_value>() >
- /// >
- /// {};
- /// \endcode
- ///
- /// When <tt>if_\<If,Then,Else\></tt> is used as a transform, \c If,
- /// \c Then and \c Else must be Proto transforms. When applying
- /// the transform to an expression \c E, state \c S and data \c V,
- /// if <tt>boost::result_of\<when\<_,If\>(E,S,V)\>::type::value</tt>
- /// is \c true then the \c Then transform is applied; otherwise
- /// the \c Else transform is applied.
- ///
- /// \code
- /// // Match a terminal. If the terminal is integral, return
- /// // mpl::true_; otherwise, return mpl::false_.
- /// struct IsIntegral2
- /// : when<
- /// terminal<_>
- /// , if_<
- /// is_integral<_value>()
- /// , mpl::true_()
- /// , mpl::false_()
- /// >
- /// >
- /// {};
- /// \endcode
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ // MSVC-7.1 has lots of problems with array types that have been
+ // deduced. Partially specializing terminal_matches<> on array types
+ // doesn't seem to work.
         template<
- typename If
- , typename Then // = _
- , typename Else // = not_<_>
+ typename T
+ , typename U
+ , bool B = is_array<BOOST_PROTO_UNCVREF(T)>::value
>
- struct if_ : transform<if_<If, Then, Else> >
- {
- typedef if_ proto_grammar;
+ struct terminal_array_matches
+ : mpl::false_
+ {};
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef
- typename when<_, If>::template impl<Expr, State, Data>::result_type
- condition;
-
- typedef
- typename mpl::if_c<
- remove_reference<condition>::type::value
- , when<_, Then>
- , when<_, Else>
- >::type
- which;
-
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
- /// \param e An expression
- /// \param s The current state
- /// \param d A data of arbitrary type
- /// \return <tt>which::impl<Expr, State, Data>()(e, s, d)</tt>
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ template<typename T, typename U, std::size_t M>
+ struct terminal_array_matches<T, U(&)[M], true>
+ : is_convertible<T, U(&)[M]>
+ {};
 
- /// \brief For matching one of a set of alternate grammars. Alternates
- /// tried in order to avoid ambiguity. When used as a transform, \c or_\<\>
- /// applies the transform associated with the first grammar that matches
- /// the expression.
- ///
- /// An expression type \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
- /// matches any \c Bx for \c x in <tt>[0,n)</tt>.
- ///
- /// When applying <tt>or_\<B0,B1,...Bn\></tt> as a transform with an
- /// expression \c e of type \c E, state \c s and data \c d, it is
- /// equivalent to <tt>Bx()(e, s, d)</tt>, where \c x is the lowest
- /// number such that <tt>matches\<E,Bx\>::value</tt> is \c true.
- template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
- struct or_ : transform<or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
- {
- typedef or_ proto_grammar;
+ template<typename T, typename U>
+ struct terminal_array_matches<T, U(&)[proto::N], true>
+ : is_convertible<T, U *>
+ {};
 
- /// \param e An expression
- /// \param s The current state
- /// \param d A data of arbitrary type
- /// \pre <tt>matches\<Expr,or_\>::value</tt> is \c true.
- /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is the
- /// sub-grammar that matched <tt>Expr</tt>.
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::matches_<
- typename Expr::proto_derived_expr
- , typename Expr::proto_grammar
- , or_
- >::which::template impl<Expr, State, Data>
- {};
-
- template<typename Expr, typename State, typename Data>
- struct impl<Expr &, State, Data>
- : detail::matches_<
- typename Expr::proto_derived_expr
- , typename Expr::proto_grammar
- , or_
- >::which::template impl<Expr &, State, Data>
- {};
- };
+ template<typename T, typename U>
+ struct terminal_array_matches<T, U *, true>
+ : is_convertible<T, U *>
+ {};
 
- /// \brief For matching all of a set of grammars. When used as a
- /// transform, \c and_\<\> applies the transforms associated with
- /// the each grammar in the set, and returns the result of the last.
- ///
- /// An expression type \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
- /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
- ///
- /// When applying <tt>and_\<B0,B1,...Bn\></tt> as a transform with an
- /// expression \c e, state \c s and data \c d, it is
- /// equivalent to <tt>(B0()(e, s, d),B1()(e, s, d),...Bn()(e, s, d))</tt>.
- template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
- struct and_ : transform<and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
- {
- typedef and_ proto_grammar;
+ // terminal_matches
+ template<typename T, typename U>
+ struct terminal_matches
+ : mpl::or_<
+ mpl::and_<
+ is_cv_ref_compatible<T, U>
+ , lambda_matches<
+ BOOST_PROTO_UNCVREF(T)
+ , BOOST_PROTO_UNCVREF(U)
+ >
+ >
+ , terminal_array_matches<T, U>
+ >
+ {};
+ #else
+ // terminal_matches
+ template<typename T, typename U>
+ struct terminal_matches
+ : mpl::and_<
+ is_cv_ref_compatible<T, U>
+ , lambda_matches<
+ BOOST_PROTO_UNCVREF(T)
+ , BOOST_PROTO_UNCVREF(U)
+ >
+ >
+ {};
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::_and_impl<and_, Expr, State, Data>
- {};
- };
+ template<typename T, std::size_t M>
+ struct terminal_matches<T(&)[M], T(&)[proto::N]>
+ : mpl::true_
+ {};
 
- /// \brief For matching one of a set of alternate grammars, which
- /// are looked up based on an expression's tag type. When used as a
- /// transform, \c switch_\<\> applies the transform associated with
- /// the grammar that matches the expression.
- ///
- /// \note \c switch_\<\> is functionally identical to \c or_\<\> but
- /// is often more efficient. It does a fast, O(1) lookup based on an
- /// expression's tag type to find a sub-grammar that may potentially
- /// match the expression.
- ///
- /// An expression type \c E matches <tt>switch_\<C\></tt> if \c E
- /// matches <tt>C::case_\<E::proto_tag\></tt>.
- ///
- /// When applying <tt>switch_\<C\></tt> as a transform with an
- /// expression \c e of type \c E, state \c s and data \c d, it is
- /// equivalent to <tt>C::case_\<E::proto_tag\>()(e, s, d)</tt>.
- template<typename Cases>
- struct switch_ : transform<switch_<Cases> >
- {
- typedef switch_ proto_grammar;
+ template<typename T, std::size_t M>
+ struct terminal_matches<T(&)[M], T *>
+ : mpl::true_
+ {};
 
- /// \param e An expression
- /// \param s The current state
- /// \param d A data of arbitrary type
- /// \pre <tt>matches\<Expr,switch_\>::value</tt> is \c true.
- /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is
- /// <tt>Cases::case_<typename Expr::proto_tag></tt>
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : Cases::template case_<typename Expr::proto_tag>::template impl<Expr, State, Data>
- {};
-
- template<typename Expr, typename State, typename Data>
- struct impl<Expr &, State, Data>
- : Cases::template case_<typename Expr::proto_tag>::template impl<Expr &, State, Data>
- {};
- };
+ // Avoid ambiguity errors on MSVC
+ #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
+ template<typename T, std::size_t M>
+ struct terminal_matches<T const (&)[M], T const[M]>
+ : mpl::true_
+ {};
+ #endif
+ #endif
 
- /// \brief For forcing exact matches of terminal types.
- ///
- /// By default, matching terminals ignores references and
- /// cv-qualifiers. For instance, a terminal expression of
- /// type <tt>terminal\<int const &\>::type</tt> will match
- /// the grammar <tt>terminal\<int\></tt>. If that is not
- /// desired, you can force an exact match with
- /// <tt>terminal\<exact\<int\> \></tt>. This will only
- /// match integer terminals where the terminal is held by
- /// value.
         template<typename T>
- struct exact
+ struct terminal_matches<T, T>
+ : mpl::true_
         {};
 
- /// \brief For matching terminals that are convertible to
- /// a type.
- ///
- /// Use \c convertible_to\<\> to match a terminal that is
- /// convertible to some type. For example, the grammar
- /// <tt>terminal\<convertible_to\<int\> \></tt> will match
- /// any terminal whose argument is convertible to an integer.
- ///
- /// \note The trait \c is_convertible\<\> from Boost.Type_traits
- /// is used to determinal convertibility.
         template<typename T>
- struct convertible_to
+ struct terminal_matches<T &, T>
+ : mpl::true_
         {};
 
- /// \brief For matching a Grammar to a variable number of
- /// sub-expressions.
- ///
- /// An expression type <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
- /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
- /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
- /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
- /// for each \c x in <tt>[0,m)</tt>.
- ///
- /// For example:
- ///
- /// \code
- /// // Match any function call expression, irregardless
- /// // of the number of function arguments:
- /// struct Function
- /// : function< vararg<_> >
- /// {};
- /// \endcode
- ///
- /// When used as a transform, <tt>vararg\<G\></tt> applies
- /// <tt>G</tt>'s transform.
- template<typename Grammar>
- struct vararg
- : Grammar
- {
- /// INTERNAL ONLY
- typedef void proto_is_vararg_;
- };
-
- /// INTERNAL ONLY
- ///
- template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
- struct is_callable<or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ template<typename T>
+ struct terminal_matches<T const &, T>
           : mpl::true_
         {};
 
- /// INTERNAL ONLY
- ///
- template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
- struct is_callable<and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ template<typename T>
+ struct terminal_matches<T, proto::_>
           : mpl::true_
         {};
 
- /// INTERNAL ONLY
- ///
- template<typename Grammar>
- struct is_callable<not_<Grammar> >
+ template<typename T>
+ struct terminal_matches<T, exact<T> >
           : mpl::true_
         {};
 
- /// INTERNAL ONLY
- ///
- template<typename If, typename Then, typename Else>
- struct is_callable<if_<If, Then, Else> >
- : mpl::true_
+ template<typename T, typename U>
+ struct terminal_matches<T, proto::convertible_to<U> >
+ : is_convertible<T, U>
         {};
 
- /// INTERNAL ONLY
- ///
- template<typename Grammar>
- struct is_callable<vararg<Grammar> >
+ // matches_
+ template<typename Expr, typename BasicExpr, typename Grammar>
+ struct matches_
+ : mpl::false_
+ {};
+
+ template<typename Expr, typename BasicExpr>
+ struct matches_< Expr, BasicExpr, proto::_ >
           : mpl::true_
         {};
 
- /// INTERNAL ONLY
- ///
- template<typename Cases>
- struct is_callable<switch_<Cases> >
+ template<typename Expr, typename Tag, typename Args1, long N1, typename Args2, long N2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<Tag, Args2, N2> >
+ : vararg_matches< Expr, Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) >
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, long N1, typename Args2, long N2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<proto::_, Args2, N2> >
+ : vararg_matches< Expr, Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) >
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<Tag, Args2, 0> >
+ : terminal_matches<typename Args1::child0, typename Args2::child0>
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2, long N2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, N2> >
+ : mpl::false_
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, 0> >
+ : terminal_matches<typename Args1::child0, typename Args2::child0>
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<Tag, Args2, 1> >
+ : matches_<
+ typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar
+ , typename Args2::child0::proto_grammar
+ >
+ {};
+
+ template<typename Expr, typename Tag, typename Args1, typename Args2>
+ struct matches_< Expr, proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<proto::_, Args2, 1> >
+ : matches_<
+ typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr
+ , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar
+ , typename Args2::child0::proto_grammar
+ >
+ {};
+
+ #include <boost/proto/detail/and_n.hpp>
+ #include <boost/proto/detail/or_n.hpp>
+ #include <boost/proto/detail/matches_.hpp>
+ #include <boost/proto/detail/vararg_matches_impl.hpp>
+ #include <boost/proto/detail/lambda_matches.hpp>
+
+ // handle proto::if_
+ template<typename Expr, typename Tag, typename Args, long Arity, typename If, typename Then, typename Else>
+ struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, proto::if_<If, Then, Else> >
+ : mpl::eval_if_c<
+ remove_reference<
+ typename when<_, If>::template impl<Expr, int, int>::result_type
+ >::type::value
+ , matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Then::proto_grammar>
+ , matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Else::proto_grammar>
+ >::type
+ {
+ typedef
+ typename mpl::if_c<
+ remove_reference<
+ typename when<_, If>::template impl<Expr, int, int>::result_type
+ >::type::value
+ , Then
+ , Else
+ >::type
+ which;
+ };
+
+ // handle degenerate cases of proto::or_
+ template<typename Expr, typename BasicExpr>
+ struct matches_<Expr, BasicExpr, or_<> >
+ : mpl::false_
+ {
+ typedef not_<_> which;
+ };
+
+ template<typename Expr, typename BasicExpr, typename G0>
+ struct matches_<Expr, BasicExpr, or_<G0> >
+ : matches_<Expr, BasicExpr, typename G0::proto_grammar>
+ {
+ typedef G0 which;
+ };
+
+ // handle degenerate cases of proto::and_
+ template<typename Expr, typename BasicExpr>
+ struct matches_<Expr, BasicExpr, and_<> >
           : mpl::true_
         {};
 
- }}
+ template<typename Expr, typename BasicExpr, typename G0>
+ struct matches_<Expr, BasicExpr, and_<G0> >
+ : matches_<Expr, BasicExpr, typename G0::proto_grammar>
+ {};
 
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- # pragma warning(pop)
- #endif
+ // handle proto::not_
+ template<typename Expr, typename BasicExpr, typename Grammar>
+ struct matches_<Expr, BasicExpr, not_<Grammar> >
+ : mpl::not_<matches_<Expr, BasicExpr, typename Grammar::proto_grammar> >
+ {};
 
- #endif
+ // handle proto::switch_
+ template<typename Expr, typename Tag, typename Args, long Arity, typename Cases>
+ struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, switch_<Cases> >
+ : matches_<
+ Expr
+ , proto::basic_expr<Tag, Args, Arity>
+ , typename Cases::template case_<Tag>::proto_grammar
+ >
+ {
+ typedef typename Cases::template case_<Tag> which;
+ };
+ }
+
+ /// \brief A Boolean metafunction that evaluates whether a given
+ /// expression type matches a grammar.
+ ///
+ /// <tt>matches\<Expr,Grammar\></tt> inherits (indirectly) from
+ /// \c mpl::true_ if <tt>Expr::proto_grammar</tt> matches
+ /// <tt>Grammar::proto_grammar</tt>, and from \c mpl::false_
+ /// otherwise.
+ ///
+ /// Non-terminal expressions are matched against a grammar
+ /// according to the following rules:
+ ///
+ /// \li The wildcard pattern, \c _, matches any expression.
+ /// \li An expression <tt>expr\<AT, listN\<A0,A1,...An\> \></tt>
+ /// matches a grammar <tt>expr\<BT, listN\<B0,B1,...Bn\> \></tt>
+ /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx for
+ /// each \c x in <tt>[0,n)</tt>.
+ /// \li An expression <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
+ /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
+ /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
+ /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
+ /// for each \c x in <tt>[0,m)</tt>.
+ /// \li An expression \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
+ /// matches some \c Bx for \c x in <tt>[0,n)</tt>.
+ /// \li An expression \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
+ /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
+ /// \li An expression \c E matches <tt>if_\<T,U,V\></tt> if
+ /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::type::value</tt>
+ /// is \c true and \c E matches \c U; or, if
+ /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::type::value</tt>
+ /// is \c false and \c E matches \c V. (Note: \c U defaults to \c _
+ /// and \c V defaults to \c not_\<_\>.)
+ /// \li An expression \c E matches <tt>not_\<T\></tt> if \c E does
+ /// not match \c T.
+ /// \li An expression \c E matches <tt>switch_\<C\></tt> if
+ /// \c E matches <tt>C::case_\<E::proto_tag\></tt>.
+ ///
+ /// A terminal expression <tt>expr\<AT,term\<A\> \></tt> matches
+ /// a grammar <tt>expr\<BT,term\<B\> \></tt> if \c BT is \c AT or
+ /// \c proto::_ and if one of the following is true:
+ ///
+ /// \li \c B is the wildcard pattern, \c _
+ /// \li \c A is \c B
+ /// \li \c A is <tt>B &</tt>
+ /// \li \c A is <tt>B const &</tt>
+ /// \li \c B is <tt>exact\<A\></tt>
+ /// \li \c B is <tt>convertible_to\<X\></tt> and
+ /// <tt>is_convertible\<A,X\>::value</tt> is \c true.
+ /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
+ /// \c B is <tt>X[proto::N]</tt>.
+ /// \li \c A is <tt>X(&)[M]</tt> and \c B is <tt>X(&)[proto::N]</tt>.
+ /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
+ /// \c B is <tt>X*</tt>.
+ /// \li \c B lambda-matches \c A (see below).
+ ///
+ /// A type \c B lambda-matches \c A if one of the following is true:
+ ///
+ /// \li \c B is \c A
+ /// \li \c B is the wildcard pattern, \c _
+ /// \li \c B is <tt>T\<B0,B1,...Bn\></tt> and \c A is
+ /// <tt>T\<A0,A1,...An\></tt> and for each \c x in
+ /// <tt>[0,n)</tt>, \c Ax and \c Bx are types
+ /// such that \c Ax lambda-matches \c Bx
+ template<typename Expr, typename Grammar>
+ struct matches
+ : detail::matches_<
+ typename Expr::proto_derived_expr
+ , typename Expr::proto_grammar
+ , typename Grammar::proto_grammar
+ >
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Expr, typename Grammar>
+ struct matches<Expr &, Grammar>
+ : detail::matches_<
+ typename Expr::proto_derived_expr
+ , typename Expr::proto_grammar
+ , typename Grammar::proto_grammar
+ >
+ {};
 
-#elif BOOST_PP_ITERATION_FLAGS() == 1
+ /// \brief A wildcard grammar element that matches any expression,
+ /// and a transform that returns the current expression unchanged.
+ ///
+ /// The wildcard type, \c _, is a grammar element such that
+ /// <tt>matches\<E,_\>::value</tt> is \c true for any expression
+ /// type \c E.
+ ///
+ /// The wildcard can also be used as a stand-in for a template
+ /// argument when matching terminals. For instance, the following
+ /// is a grammar that will match any <tt>std::complex\<\></tt>
+ /// terminal:
+ ///
+ /// \code
+ /// BOOST_MPL_ASSERT((
+ /// matches<
+ /// terminal<std::complex<double> >::type
+ /// , terminal<std::complex< _ > >
+ /// >
+ /// ));
+ /// \endcode
+ ///
+ /// When used as a transform, \c _ returns the current expression
+ /// unchanged. For instance, in the following, \c _ is used with
+ /// the \c fold\<\> transform to fold the children of a node:
+ ///
+ /// \code
+ /// struct CountChildren
+ /// : or_<
+ /// // Terminals have no children
+ /// when<terminal<_>, mpl::int_<0>()>
+ /// // Use fold<> to count the children of non-terminals
+ /// , otherwise<
+ /// fold<
+ /// _ // <-- fold the current expression
+ /// , mpl::int_<0>()
+ /// , mpl::plus<_state, mpl::int_<1> >()
+ /// >
+ /// >
+ /// >
+ /// {};
+ /// \endcode
+ struct _ : transform<_>
+ {
+ typedef _ proto_grammar;
 
- #define N BOOST_PP_ITERATION()
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
 
- // Assymetry here between the handling of and_N and or_N because
- // and_N is used by lambda_matches up to BOOST_PROTO_MAX_ARITY,
- // regardless of how low BOOST_PROTO_MAX_LOGICAL_ARITY is.
- template<bool B, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), typename P)>
- struct BOOST_PP_CAT(and_, N)
- #if 2 == N
- : mpl::bool_<P0::value>
- {};
+ /// \param expr An expression
+ /// \return \c e
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
             #else
- : BOOST_PP_CAT(and_, BOOST_PP_DEC(N))<
- P0::value BOOST_PP_COMMA_IF(BOOST_PP_SUB(N,2))
- BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_DEC(N), P)
- >
- {};
+ typename impl::expr_param
             #endif
-
- template<BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), typename P)>
- struct BOOST_PP_CAT(and_, N)<false, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), P)>
- : mpl::false_
- {};
-
- #if N <= BOOST_PROTO_MAX_LOGICAL_ARITY
- template<BOOST_PP_ENUM_PARAMS(N, typename G), typename Expr, typename State, typename Data>
- struct _and_impl<proto::and_<BOOST_PP_ENUM_PARAMS(N, G)>, Expr, State, Data>
- : proto::transform_impl<Expr, State, Data>
- {
- #define M0(Z, N, DATA) \
- typedef \
- typename proto::when<proto::_, BOOST_PP_CAT(G, N)> \
- ::template impl<Expr, State, Data> \
- BOOST_PP_CAT(Gimpl, N); \
- /**/
- BOOST_PP_REPEAT(N, M0, ~)
- #undef M0
-
- typedef typename BOOST_PP_CAT(Gimpl, BOOST_PP_DEC(N))::result_type result_type;
-
- result_type operator()(
- typename _and_impl::expr_param e
- , typename _and_impl::state_param s
- , typename _and_impl::data_param d
- ) const
- {
- // Fix: jfalcou - 12/29/2010
- // Avoid the use of comma operator here so as not to find Proto's
- // by accident.
- // expands to G0()(e,s,d); G1()(e,s,d); ... G{N-1}()(e,s,d);
- #define M0(Z,N,DATA) BOOST_PP_CAT(Gimpl,N)()(e,s,d);
- BOOST_PP_REPEAT(BOOST_PP_DEC(N),M0,~)
- return BOOST_PP_CAT(Gimpl,BOOST_PP_DEC(N))()(e,s,d);
- #undef M0
- }
- };
-
- template<bool B, typename Expr, typename BasicExpr, BOOST_PP_ENUM_PARAMS(N, typename G)>
- struct BOOST_PP_CAT(or_, N)
- #if 2 == N
- : mpl::bool_<matches_<Expr, BasicExpr, typename G1::proto_grammar>::value>
+ operator()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
             {
- typedef G1 which;
- };
+ return e;
+ }
+ };
+ };
+
+ namespace detail
+ {
+ template<typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<>, Expr, State, Data>
+ : proto::_::impl<Expr, State, Data>
+ {};
+
+ template<typename G0, typename Expr, typename State, typename Data>
+ struct _and_impl<proto::and_<G0>, Expr, State, Data>
+ : proto::when<proto::_, G0>::template impl<Expr, State, Data>
+ {};
+ }
+
+ /// \brief Inverts the set of expressions matched by a grammar. When
+ /// used as a transform, \c not_\<\> returns the current expression
+ /// unchanged.
+ ///
+ /// If an expression type \c E does not match a grammar \c G, then
+ /// \c E \e does match <tt>not_\<G\></tt>. For example,
+ /// <tt>not_\<terminal\<_\> \></tt> will match any non-terminal.
+ template<typename Grammar>
+ struct not_ : transform<not_<Grammar> >
+ {
+ typedef not_ proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
+
+ /// \param e An expression
+ /// \pre <tt>matches\<Expr,not_\>::value</tt> is \c true.
+ /// \return \c e
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
             #else
- : BOOST_PP_CAT(or_, BOOST_PP_DEC(N))<
- matches_<Expr, BasicExpr, typename G1::proto_grammar>::value
- , Expr, BasicExpr, BOOST_PP_ENUM_SHIFTED_PARAMS(N, G)
- >
- {};
+ typename impl::expr_param
             #endif
+ operator()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ return e;
+ }
+ };
+ };
+
+ /// \brief Used to select one grammar or another based on the result
+ /// of a compile-time Boolean. When used as a transform, \c if_\<\>
+ /// selects between two transforms based on a compile-time Boolean.
+ ///
+ /// When <tt>if_\<If,Then,Else\></tt> is used as a grammar, \c If
+ /// must be a Proto transform and \c Then and \c Else must be grammars.
+ /// An expression type \c E matches <tt>if_\<If,Then,Else\></tt> if
+ /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt>
+ /// is \c true and \c E matches \c U; or, if
+ /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt>
+ /// is \c false and \c E matches \c V.
+ ///
+ /// The template parameter \c Then defaults to \c _
+ /// and \c Else defaults to \c not\<_\>, so an expression type \c E
+ /// will match <tt>if_\<If\></tt> if and only if
+ /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt>
+ /// is \c true.
+ ///
+ /// \code
+ /// // A grammar that only matches integral terminals,
+ /// // using is_integral<> from Boost.Type_traits.
+ /// struct IsIntegral
+ /// : and_<
+ /// terminal<_>
+ /// , if_< is_integral<_value>() >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// When <tt>if_\<If,Then,Else\></tt> is used as a transform, \c If,
+ /// \c Then and \c Else must be Proto transforms. When applying
+ /// the transform to an expression \c E, state \c S and data \c V,
+ /// if <tt>boost::result_of\<when\<_,If\>(E,S,V)\>::type::value</tt>
+ /// is \c true then the \c Then transform is applied; otherwise
+ /// the \c Else transform is applied.
+ ///
+ /// \code
+ /// // Match a terminal. If the terminal is integral, return
+ /// // mpl::true_; otherwise, return mpl::false_.
+ /// struct IsIntegral2
+ /// : when<
+ /// terminal<_>
+ /// , if_<
+ /// is_integral<_value>()
+ /// , mpl::true_()
+ /// , mpl::false_()
+ /// >
+ /// >
+ /// {};
+ /// \endcode
+ template<
+ typename If
+ , typename Then // = _
+ , typename Else // = not_<_>
+ >
+ struct if_ : transform<if_<If, Then, Else> >
+ {
+ typedef if_ proto_grammar;
 
- template<typename Expr, typename BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, typename G)>
- struct BOOST_PP_CAT(or_, N)<true, Expr, BasicExpr, BOOST_PP_ENUM_PARAMS(N, G)>
- : mpl::true_
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef
+ typename when<_, If>::template impl<Expr, State, Data>::result_type
+ condition;
+
+ typedef
+ typename mpl::if_c<
+ remove_reference<condition>::type::value
+ , when<_, Then>
+ , when<_, Else>
+ >::type
+ which;
+
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+ /// \param e An expression
+ /// \param s The current state
+ /// \param d A data of arbitrary type
+ /// \return <tt>which::impl<Expr, State, Data>()(e, s, d)</tt>
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
             {
- typedef G0 which;
- };
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
 
- // handle proto::or_
- template<typename Expr, typename BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, typename G)>
- struct matches_<Expr, BasicExpr, proto::or_<BOOST_PP_ENUM_PARAMS(N, G)> >
- : BOOST_PP_CAT(or_, N)<
- matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
- Expr, BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, G)
- >
- {};
+ /// \brief For matching one of a set of alternate grammars. Alternates
+ /// tried in order to avoid ambiguity. When used as a transform, \c or_\<\>
+ /// applies the transform associated with the first grammar that matches
+ /// the expression.
+ ///
+ /// An expression type \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
+ /// matches any \c Bx for \c x in <tt>[0,n)</tt>.
+ ///
+ /// When applying <tt>or_\<B0,B1,...Bn\></tt> as a transform with an
+ /// expression \c e of type \c E, state \c s and data \c d, it is
+ /// equivalent to <tt>Bx()(e, s, d)</tt>, where \c x is the lowest
+ /// number such that <tt>matches\<E,Bx\>::value</tt> is \c true.
+ template<BOOST_PROTO_LOGICAL_typename_G>
+ struct or_ : transform<or_<BOOST_PROTO_LOGICAL_G> >
+ {
+ typedef or_ proto_grammar;
 
- // handle proto::and_
- template<typename Expr, typename BasicExpr, BOOST_PP_ENUM_PARAMS(N, typename G)>
- struct matches_<Expr, BasicExpr, proto::and_<BOOST_PP_ENUM_PARAMS(N, G)> >
- : detail::BOOST_PP_CAT(and_, N)<
- BOOST_PROTO_DEFINE_MATCHES(~, 0, ~)::value,
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_MATCHES, ~)
- >
- {};
- #endif
+ /// \param e An expression
+ /// \param s The current state
+ /// \param d A data of arbitrary type
+ /// \pre <tt>matches\<Expr,or_\>::value</tt> is \c true.
+ /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is the
+ /// sub-grammar that matched <tt>Expr</tt>.
 
- #undef N
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::matches_<
+ typename Expr::proto_derived_expr
+ , typename Expr::proto_grammar
+ , or_
+ >::which::template impl<Expr, State, Data>
+ {};
 
-#elif BOOST_PP_ITERATION_FLAGS() == 2
+ template<typename Expr, typename State, typename Data>
+ struct impl<Expr &, State, Data>
+ : detail::matches_<
+ typename Expr::proto_derived_expr
+ , typename Expr::proto_grammar
+ , or_
+ >::which::template impl<Expr &, State, Data>
+ {};
+ };
 
- #define N BOOST_PP_ITERATION()
+ /// \brief For matching all of a set of grammars. When used as a
+ /// transform, \c and_\<\> applies the transforms associated with
+ /// the each grammar in the set, and returns the result of the last.
+ ///
+ /// An expression type \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
+ /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
+ ///
+ /// When applying <tt>and_\<B0,B1,...Bn\></tt> as a transform with an
+ /// expression \c e, state \c s and data \c d, it is
+ /// equivalent to <tt>(B0()(e, s, d),B1()(e, s, d),...Bn()(e, s, d))</tt>.
+ template<BOOST_PROTO_LOGICAL_typename_G>
+ struct and_ : transform<and_<BOOST_PROTO_LOGICAL_G> >
+ {
+ typedef and_ proto_grammar;
 
- template<typename Args, typename Back, long To>
- struct vararg_matches_impl<Args, Back, N, To>
- : and_2<
- matches_<
- typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr
- , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
- , Back
- >::value
- , vararg_matches_impl<Args, Back, N + 1, To>
- >
- {};
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::_and_impl<and_, Expr, State, Data>
+ {};
+ };
 
- template<typename Args, typename Back>
- struct vararg_matches_impl<Args, Back, N, N>
- : matches_<
- typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr
- , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
- , Back
- >
- {};
+ /// \brief For matching one of a set of alternate grammars, which
+ /// are looked up based on an expression's tag type. When used as a
+ /// transform, \c switch_\<\> applies the transform associated with
+ /// the grammar that matches the expression.
+ ///
+ /// \note \c switch_\<\> is functionally identical to \c or_\<\> but
+ /// is often more efficient. It does a fast, O(1) lookup based on an
+ /// expression's tag type to find a sub-grammar that may potentially
+ /// match the expression.
+ ///
+ /// An expression type \c E matches <tt>switch_\<C\></tt> if \c E
+ /// matches <tt>C::case_\<E::proto_tag\></tt>.
+ ///
+ /// When applying <tt>switch_\<C\></tt> as a transform with an
+ /// expression \c e of type \c E, state \c s and data \c d, it is
+ /// equivalent to <tt>C::case_\<E::proto_tag\>()(e, s, d)</tt>.
+ template<typename Cases>
+ struct switch_ : transform<switch_<Cases> >
+ {
+ typedef switch_ proto_grammar;
 
- template<
- template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class T
- BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Expr)
- BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Grammar)
- >
- struct lambda_matches<
- T<BOOST_PP_ENUM_PARAMS(N, Expr)>
- , T<BOOST_PP_ENUM_PARAMS(N, Grammar)>
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(N)
- >
- : BOOST_PP_CAT(and_, N)<
- BOOST_PROTO_DEFINE_LAMBDA_MATCHES(~, 0, ~)::value,
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_LAMBDA_MATCHES, ~)
- >
- {};
+ /// \param e An expression
+ /// \param s The current state
+ /// \param d A data of arbitrary type
+ /// \pre <tt>matches\<Expr,switch_\>::value</tt> is \c true.
+ /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is
+ /// <tt>Cases::case_<typename Expr::proto_tag></tt>
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : Cases::template case_<typename Expr::proto_tag>::template impl<Expr, State, Data>
+ {};
 
- template<typename Expr, typename Tag, typename Args1, typename Args2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, N>, proto::basic_expr<Tag, Args2, N> >
- : BOOST_PP_CAT(and_, N)<
- BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)
- >
- {};
+ template<typename Expr, typename State, typename Data>
+ struct impl<Expr &, State, Data>
+ : Cases::template case_<typename Expr::proto_tag>::template impl<Expr &, State, Data>
+ {};
+ };
 
- template<typename Expr, typename Tag, typename Args1, typename Args2>
- struct matches_< Expr, proto::basic_expr<Tag, Args1, N>, proto::basic_expr<proto::_, Args2, N> >
- : BOOST_PP_CAT(and_, N)<
- BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)
- >
- {};
+ /// \brief For forcing exact matches of terminal types.
+ ///
+ /// By default, matching terminals ignores references and
+ /// cv-qualifiers. For instance, a terminal expression of
+ /// type <tt>terminal\<int const &\>::type</tt> will match
+ /// the grammar <tt>terminal\<int\></tt>. If that is not
+ /// desired, you can force an exact match with
+ /// <tt>terminal\<exact\<int\> \></tt>. This will only
+ /// match integer terminals where the terminal is held by
+ /// value.
+ template<typename T>
+ struct exact
+ {};
+
+ /// \brief For matching terminals that are convertible to
+ /// a type.
+ ///
+ /// Use \c convertible_to\<\> to match a terminal that is
+ /// convertible to some type. For example, the grammar
+ /// <tt>terminal\<convertible_to\<int\> \></tt> will match
+ /// any terminal whose argument is convertible to an integer.
+ ///
+ /// \note The trait \c is_convertible\<\> from Boost.Type_traits
+ /// is used to determinal convertibility.
+ template<typename T>
+ struct convertible_to
+ {};
+
+ /// \brief For matching a Grammar to a variable number of
+ /// sub-expressions.
+ ///
+ /// An expression type <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
+ /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
+ /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
+ /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
+ /// for each \c x in <tt>[0,m)</tt>.
+ ///
+ /// For example:
+ ///
+ /// \code
+ /// // Match any function call expression, irregardless
+ /// // of the number of function arguments:
+ /// struct Function
+ /// : function< vararg<_> >
+ /// {};
+ /// \endcode
+ ///
+ /// When used as a transform, <tt>vararg\<G\></tt> applies
+ /// <tt>G</tt>'s transform.
+ template<typename Grammar>
+ struct vararg
+ : Grammar
+ {
+ /// INTERNAL ONLY
+ typedef void proto_is_vararg_;
+ };
 
- #undef N
+ /// INTERNAL ONLY
+ ///
+ template<BOOST_PROTO_LOGICAL_typename_G>
+ struct is_callable<or_<BOOST_PROTO_LOGICAL_G> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<BOOST_PROTO_LOGICAL_typename_G>
+ struct is_callable<and_<BOOST_PROTO_LOGICAL_G> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Grammar>
+ struct is_callable<not_<Grammar> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename If, typename Then, typename Else>
+ struct is_callable<if_<If, Then, Else> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Grammar>
+ struct is_callable<vararg<Grammar> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Cases>
+ struct is_callable<switch_<Cases> >
+ : mpl::true_
+ {};
 
+}}
+
+#undef BOOST_PROTO_LOGICAL_typename_G
+#undef BOOST_PROTO_LOGICAL_G
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
 #endif
 
+#endif

Modified: branches/release/boost/proto/proto_fwd.hpp
==============================================================================
--- branches/release/boost/proto/proto_fwd.hpp (original)
+++ branches/release/boost/proto/proto_fwd.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -24,13 +24,14 @@
 #include <boost/mpl/long.hpp>
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/type_traits/remove_reference.hpp>
+#include <boost/mpl/aux_/config/ttp.hpp>
 
 #ifndef BOOST_PROTO_MAX_ARITY
-# define BOOST_PROTO_MAX_ARITY 5
+# define BOOST_PROTO_MAX_ARITY 10
 #endif
 
 #ifndef BOOST_PROTO_MAX_LOGICAL_ARITY
-# define BOOST_PROTO_MAX_LOGICAL_ARITY 8
+# define BOOST_PROTO_MAX_LOGICAL_ARITY 10
 #endif
 
 #ifndef BOOST_PROTO_MAX_FUNCTION_CALL_ARITY
@@ -45,6 +46,14 @@
 # error BOOST_PROTO_MAX_FUNCTION_CALL_ARITY cannot be larger than BOOST_PROTO_MAX_ARITY
 #endif
 
+#ifndef BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
+ #if 10 < BOOST_PROTO_MAX_ARITY || \
+ 10 < BOOST_PROTO_MAX_LOGICAL_ARITY || \
+ 10 < BOOST_PROTO_MAX_FUNCTION_CALL_ARITY
+ #define BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
+ #endif
+#endif
+
 #ifndef BOOST_PROTO_BROKEN_CONST_OVERLOADS
 # if BOOST_WORKAROUND(__GNUC__, == 3) \
   || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(310))
@@ -89,6 +98,10 @@
 # define BOOST_PROTO_RESULT_OF boost::tr1_result_of
 #endif
 
+#ifdef BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+# define BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+#endif
+
 namespace boost { namespace proto
 {
     namespace detail
@@ -96,6 +109,12 @@
         typedef char yes_type;
         typedef char (&no_type)[2];
 
+ template<int N>
+ struct sized_type
+ {
+ typedef char (&type)[N];
+ };
+
         struct dont_care;
         struct undefined; // leave this undefined
         struct not_a_valid_type;

Modified: branches/release/boost/proto/traits.hpp
==============================================================================
--- branches/release/boost/proto/traits.hpp (original)
+++ branches/release/boost/proto/traits.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,1405 +1,1212 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file traits.hpp
- /// Contains definitions for child\<\>, child_c\<\>, left\<\>,
- /// right\<\>, tag_of\<\>, and the helper functions child(), child_c(),
- /// value(), left() and right().
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005
- #define BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005
-
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/repetition/repeat_from_to.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/static_assert.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/mpl/aux_/template_arity.hpp>
- #include <boost/mpl/aux_/lambda_arity_param.hpp>
- #include <boost/type_traits/is_pod.hpp>
- #include <boost/type_traits/is_same.hpp>
- #include <boost/type_traits/add_const.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/args.hpp>
- #include <boost/proto/domain.hpp>
- #include <boost/proto/transform/pass_through.hpp>
-
- #if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
- #pragma warning(push)
- #pragma warning(disable: 4180) // warning C4180: qualifier applied to function type has no meaning; ignored
- #endif
+///////////////////////////////////////////////////////////////////////////////
+/// \file traits.hpp
+/// Contains definitions for child\<\>, child_c\<\>, left\<\>,
+/// right\<\>, tag_of\<\>, and the helper functions child(), child_c(),
+/// value(), left() and right().
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005
+#define BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/proto/detail/template_arity.hpp>
+#include <boost/type_traits/is_pod.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/args.hpp>
+#include <boost/proto/domain.hpp>
+#include <boost/proto/transform/pass_through.hpp>
+
+#if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
+ #pragma warning(push)
+ #pragma warning(disable: 4180) // warning C4180: qualifier applied to function type has no meaning; ignored
+#endif
 
- namespace boost { namespace proto
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
- {
- template<typename T, typename Void = void>
- struct if_vararg
- {};
-
- template<typename T>
- struct if_vararg<T, typename T::proto_is_vararg_>
- : T
- {};
-
- template<typename T, typename Void = void>
- struct is_callable2_
- : mpl::false_
- {};
-
- template<typename T>
- struct is_callable2_<T, typename T::proto_is_callable_>
- : mpl::true_
- {};
-
- template<typename T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(long Arity = mpl::aux::template_arity<T>::value)>
- struct is_callable_
- : is_callable2_<T>
- {};
-
- }
-
- /// \brief Boolean metafunction which detects whether a type is
- /// a callable function object type or not.
- ///
- /// <tt>is_callable\<\></tt> is used by the <tt>when\<\></tt> transform
- /// to determine whether a function type <tt>R(A1,A2,...AN)</tt> is a
- /// callable transform or an object transform. (The former are evaluated
- /// using <tt>call\<\></tt> and the later with <tt>make\<\></tt>.) If
- /// <tt>is_callable\<R\>::value</tt> is \c true, the function type is
- /// a callable transform; otherwise, it is an object transform.
- ///
- /// Unless specialized for a type \c T, <tt>is_callable\<T\>::value</tt>
- /// is computed as follows:
- ///
- /// \li If \c T is a template type <tt>X\<Y0,Y1,...YN\></tt>, where all \c Yx
- /// are types for \c x in <tt>[0,N]</tt>, <tt>is_callable\<T\>::value</tt>
- /// is <tt>is_same\<YN, proto::callable\>::value</tt>.
- /// \li If \c T has a nested type \c proto_is_callable_ that is a typedef
- /// for \c void, <tt>is_callable\<T\>::value</tt> is \c true. (Note: this is
- /// the case for any type that derives from \c proto::callable.)
- /// \li Otherwise, <tt>is_callable\<T\>::value</tt> is \c false.
- template<typename T>
- struct is_callable
- : proto::detail::is_callable_<T>
- {};
-
- /// INTERNAL ONLY
- ///
- template<>
- struct is_callable<proto::_>
- : mpl::true_
+ template<typename T, typename Void = void>
+ struct if_vararg
         {};
 
- /// INTERNAL ONLY
- ///
- template<>
- struct is_callable<proto::callable>
- : mpl::false_
- {};
-
- /// INTERNAL ONLY
- ///
- template<typename PrimitiveTransform, typename X>
- struct is_callable<proto::transform<PrimitiveTransform, X> >
- : mpl::false_
- {};
-
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
- // work around GCC bug
- template<typename Tag, typename Args, long N>
- struct is_callable<proto::expr<Tag, Args, N> >
- : mpl::false_
- {};
-
- // work around GCC bug
- template<typename Tag, typename Args, long N>
- struct is_callable<proto::basic_expr<Tag, Args, N> >
- : mpl::false_
+ template<typename T>
+ struct if_vararg<T, typename T::proto_is_vararg_>
+ : T
         {};
- #endif
 
- /// \brief Boolean metafunction which detects whether a type is
- /// a PrimitiveTransform type or not.
- ///
- /// <tt>is_transform\<\></tt> is used by the <tt>call\<\></tt> transform
- /// to determine whether the function types <tt>R()</tt>, <tt>R(A1)</tt>,
- /// and <tt>R(A1, A2)</tt> should be passed the expression, state and data
- /// parameters (as needed).
- ///
- /// Unless specialized for a type \c T, <tt>is_transform\<T\>::value</tt>
- /// is computed as follows:
- ///
- /// \li If \c T has a nested type \c proto_is_transform_ that is a typedef
- /// for \c void, <tt>is_transform\<T\>::value</tt> is \c true. (Note: this is
- /// the case for any type that derives from an instantiation of \c proto::transform.)
- /// \li Otherwise, <tt>is_transform\<T\>::value</tt> is \c false.
- template<typename T, typename Void /*= void*/>
- struct is_transform
+ template<typename T, typename Void = void>
+ struct is_callable2_
           : mpl::false_
         {};
 
         template<typename T>
- struct is_transform<T, typename T::proto_is_transform_>
+ struct is_callable2_<T, typename T::proto_is_callable_>
           : mpl::true_
         {};
 
- /// \brief A Boolean metafunction that indicates whether a type requires
- /// aggregate initialization.
- ///
- /// <tt>is_aggregate\<\></tt> is used by the <tt>make\<\></tt> transform
- /// to determine how to construct an object of some type \c T, given some
- /// initialization arguments <tt>a0,a1,...aN</tt>.
- /// If <tt>is_aggregate\<T\>::value</tt> is \c true, then an object of
- /// type T will be initialized as <tt>T t = {a0,a1,...aN};</tt>. Otherwise,
- /// it will be initialized as <tt>T t(a0,a1,...aN)</tt>.
- template<typename T, typename Void>
- struct is_aggregate
- : is_pod<T>
- {};
+ template<typename T BOOST_PROTO_TEMPLATE_ARITY_PARAM(long Arity = boost::proto::detail::template_arity<T>::value)>
+ struct is_callable_
+ : is_callable2_<T>
+ {};
+
+ }
+
+ /// \brief Boolean metafunction which detects whether a type is
+ /// a callable function object type or not.
+ ///
+ /// <tt>is_callable\<\></tt> is used by the <tt>when\<\></tt> transform
+ /// to determine whether a function type <tt>R(A1,A2,...AN)</tt> is a
+ /// callable transform or an object transform. (The former are evaluated
+ /// using <tt>call\<\></tt> and the later with <tt>make\<\></tt>.) If
+ /// <tt>is_callable\<R\>::value</tt> is \c true, the function type is
+ /// a callable transform; otherwise, it is an object transform.
+ ///
+ /// Unless specialized for a type \c T, <tt>is_callable\<T\>::value</tt>
+ /// is computed as follows:
+ ///
+ /// \li If \c T is a template type <tt>X\<Y0,Y1,...YN\></tt>, where all \c Yx
+ /// are types for \c x in <tt>[0,N]</tt>, <tt>is_callable\<T\>::value</tt>
+ /// is <tt>is_same\<YN, proto::callable\>::value</tt>.
+ /// \li If \c T has a nested type \c proto_is_callable_ that is a typedef
+ /// for \c void, <tt>is_callable\<T\>::value</tt> is \c true. (Note: this is
+ /// the case for any type that derives from \c proto::callable.)
+ /// \li Otherwise, <tt>is_callable\<T\>::value</tt> is \c false.
+ template<typename T>
+ struct is_callable
+ : proto::detail::is_callable_<T>
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<>
+ struct is_callable<proto::_>
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<>
+ struct is_callable<proto::callable>
+ : mpl::false_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename PrimitiveTransform, typename X>
+ struct is_callable<proto::transform<PrimitiveTransform, X> >
+ : mpl::false_
+ {};
+
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+ // work around GCC bug
+ template<typename Tag, typename Args, long N>
+ struct is_callable<proto::expr<Tag, Args, N> >
+ : mpl::false_
+ {};
+
+ // work around GCC bug
+ template<typename Tag, typename Args, long N>
+ struct is_callable<proto::basic_expr<Tag, Args, N> >
+ : mpl::false_
+ {};
+ #endif
 
- /// \brief Specialization of <tt>is_aggregate\<\></tt> that indicates
- /// that objects of <tt>expr\<\></tt> type require aggregate initialization.
- template<typename Tag, typename Args, long N>
- struct is_aggregate<proto::expr<Tag, Args, N>, void>
- : mpl::true_
- {};
+ /// \brief Boolean metafunction which detects whether a type is
+ /// a PrimitiveTransform type or not.
+ ///
+ /// <tt>is_transform\<\></tt> is used by the <tt>call\<\></tt> transform
+ /// to determine whether the function types <tt>R()</tt>, <tt>R(A1)</tt>,
+ /// and <tt>R(A1, A2)</tt> should be passed the expression, state and data
+ /// parameters (as needed).
+ ///
+ /// Unless specialized for a type \c T, <tt>is_transform\<T\>::value</tt>
+ /// is computed as follows:
+ ///
+ /// \li If \c T has a nested type \c proto_is_transform_ that is a typedef
+ /// for \c void, <tt>is_transform\<T\>::value</tt> is \c true. (Note: this is
+ /// the case for any type that derives from an instantiation of \c proto::transform.)
+ /// \li Otherwise, <tt>is_transform\<T\>::value</tt> is \c false.
+ template<typename T, typename Void /*= void*/>
+ struct is_transform
+ : mpl::false_
+ {};
+
+ template<typename T>
+ struct is_transform<T, typename T::proto_is_transform_>
+ : mpl::true_
+ {};
+
+ /// \brief A Boolean metafunction that indicates whether a type requires
+ /// aggregate initialization.
+ ///
+ /// <tt>is_aggregate\<\></tt> is used by the <tt>make\<\></tt> transform
+ /// to determine how to construct an object of some type \c T, given some
+ /// initialization arguments <tt>a0,a1,...aN</tt>.
+ /// If <tt>is_aggregate\<T\>::value</tt> is \c true, then an object of
+ /// type T will be initialized as <tt>T t = {a0,a1,...aN};</tt>. Otherwise,
+ /// it will be initialized as <tt>T t(a0,a1,...aN)</tt>.
+ template<typename T, typename Void>
+ struct is_aggregate
+ : is_pod<T>
+ {};
+
+ /// \brief Specialization of <tt>is_aggregate\<\></tt> that indicates
+ /// that objects of <tt>expr\<\></tt> type require aggregate initialization.
+ template<typename Tag, typename Args, long N>
+ struct is_aggregate<proto::expr<Tag, Args, N>, void>
+ : mpl::true_
+ {};
+
+ template<typename Tag, typename Args, long N>
+ struct is_aggregate<proto::basic_expr<Tag, Args, N>, void>
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ template<typename T>
+ struct is_aggregate<T, typename T::proto_is_aggregate_>
+ : mpl::true_
+ {};
+
+ /// \brief A Boolean metafunction that indicates whether a given
+ /// type \c T is a Proto expression type.
+ ///
+ /// If \c T has a nested type \c proto_is_expr_ that is a typedef
+ /// for \c void, <tt>is_expr\<T\>::value</tt> is \c true. (Note, this
+ /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
+ /// from <tt>proto::extends\<\></tt> or that uses the
+ /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
+ /// <tt>is_expr\<T\>::value</tt> is \c false.
+ template<typename T, typename Void /* = void*/>
+ struct is_expr
+ : mpl::false_
+ {};
+
+ /// \brief A Boolean metafunction that indicates whether a given
+ /// type \c T is a Proto expression type.
+ ///
+ /// If \c T has a nested type \c proto_is_expr_ that is a typedef
+ /// for \c void, <tt>is_expr\<T\>::value</tt> is \c true. (Note, this
+ /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
+ /// from <tt>proto::extends\<\></tt> or that uses the
+ /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
+ /// <tt>is_expr\<T\>::value</tt> is \c false.
+ template<typename T>
+ struct is_expr<T, typename T::proto_is_expr_>
+ : mpl::true_
+ {};
+
+ template<typename T>
+ struct is_expr<T &, void>
+ : is_expr<T>
+ {};
+
+ /// \brief A metafunction that returns the tag type of a
+ /// Proto expression.
+ template<typename Expr>
+ struct tag_of
+ {
+ typedef typename Expr::proto_tag type;
+ };
 
- template<typename Tag, typename Args, long N>
- struct is_aggregate<proto::basic_expr<Tag, Args, N>, void>
- : mpl::true_
- {};
+ template<typename Expr>
+ struct tag_of<Expr &>
+ {
+ typedef typename Expr::proto_tag type;
+ };
 
- /// INTERNAL ONLY
- template<typename T>
- struct is_aggregate<T, typename T::proto_is_aggregate_>
- : mpl::true_
- {};
+ /// \brief A metafunction that returns the arity of a
+ /// Proto expression.
+ template<typename Expr>
+ struct arity_of
+ : Expr::proto_arity
+ {};
+
+ template<typename Expr>
+ struct arity_of<Expr &>
+ : Expr::proto_arity
+ {};
 
- /// \brief A Boolean metafunction that indicates whether a given
- /// type \c T is a Proto expression type.
+ namespace result_of
+ {
+ /// \brief A metafunction that computes the return type of the \c as_expr()
+ /// function.
+ template<typename T, typename Domain /*= default_domain*/>
+ struct as_expr
+ {
+ typedef typename Domain::template as_expr<T>::result_type type;
+ };
+
+ /// \brief A metafunction that computes the return type of the \c as_child()
+ /// function.
+ template<typename T, typename Domain /*= default_domain*/>
+ struct as_child
+ {
+ typedef typename Domain::template as_child<T>::result_type type;
+ };
+
+ /// \brief A metafunction that returns the type of the Nth child
+ /// of a Proto expression, where N is an MPL Integral Constant.
         ///
- /// If \c T has a nested type \c proto_is_expr_ that is a typedef
- /// for \c void, <tt>is_expr\<T\>::value</tt> is \c true. (Note, this
- /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
- /// from <tt>proto::extends\<\></tt> or that uses the
- /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
- /// <tt>is_expr\<T\>::value</tt> is \c false.
- template<typename T, typename Void /* = void*/>
- struct is_expr
- : mpl::false_
+ /// <tt>result_of::child\<Expr, N\></tt> is equivalent to
+ /// <tt>result_of::child_c\<Expr, N::value\></tt>.
+ template<typename Expr, typename N /* = mpl::long_<0>*/>
+ struct child
+ : child_c<Expr, N::value>
         {};
 
- /// \brief A Boolean metafunction that indicates whether a given
- /// type \c T is a Proto expression type.
+ /// \brief A metafunction that returns the type of the value
+ /// of a terminal Proto expression.
         ///
- /// If \c T has a nested type \c proto_is_expr_ that is a typedef
- /// for \c void, <tt>is_expr\<T\>::value</tt> is \c true. (Note, this
- /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
- /// from <tt>proto::extends\<\></tt> or that uses the
- /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
- /// <tt>is_expr\<T\>::value</tt> is \c false.
- template<typename T>
- struct is_expr<T, typename T::proto_is_expr_>
- : mpl::true_
- {};
-
- template<typename T>
- struct is_expr<T &, void>
- : is_expr<T>
- {};
+ template<typename Expr>
+ struct value
+ {
+ /// Verify that we are actually operating on a terminal
+ BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
+
+ /// The raw type of the Nth child as it is stored within
+ /// \c Expr. This may be a value or a reference
+ typedef typename Expr::proto_child0 value_type;
+
+ /// The "value" type of the child, suitable for storage by value,
+ /// computed as follows:
+ /// \li <tt>T const(&)[N]</tt> becomes <tt>T[N]</tt>
+ /// \li <tt>T[N]</tt> becomes <tt>T[N]</tt>
+ /// \li <tt>T(&)[N]</tt> becomes <tt>T[N]</tt>
+ /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt>
+ /// \li <tt>T const &</tt> becomes <tt>T</tt>
+ /// \li <tt>T &</tt> becomes <tt>T</tt>
+ /// \li <tt>T</tt> becomes <tt>T</tt>
+ typedef typename detail::term_traits<typename Expr::proto_child0>::value_type type;
+ };
 
- /// \brief A metafunction that returns the tag type of a
- /// Proto expression.
         template<typename Expr>
- struct tag_of
+ struct value<Expr &>
         {
- typedef typename Expr::proto_tag type;
+ /// Verify that we are actually operating on a terminal
+ BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
+
+ /// The raw type of the Nth child as it is stored within
+ /// \c Expr. This may be a value or a reference
+ typedef typename Expr::proto_child0 value_type;
+
+ /// The "reference" type of the child, suitable for storage by
+ /// reference, computed as follows:
+ /// \li <tt>T const(&)[N]</tt> becomes <tt>T const(&)[N]</tt>
+ /// \li <tt>T[N]</tt> becomes <tt>T(&)[N]</tt>
+ /// \li <tt>T(&)[N]</tt> becomes <tt>T(&)[N]</tt>
+ /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt>
+ /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
+ /// \li <tt>T &</tt> becomes <tt>T &</tt>
+ /// \li <tt>T</tt> becomes <tt>T &</tt>
+ typedef typename detail::term_traits<typename Expr::proto_child0>::reference type;
         };
 
         template<typename Expr>
- struct tag_of<Expr &>
+ struct value<Expr const &>
         {
- typedef typename Expr::proto_tag type;
+ /// Verify that we are actually operating on a terminal
+ BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
+
+ /// The raw type of the Nth child as it is stored within
+ /// \c Expr. This may be a value or a reference
+ typedef typename Expr::proto_child0 value_type;
+
+ /// The "const reference" type of the child, suitable for storage by
+ /// const reference, computed as follows:
+ /// \li <tt>T const(&)[N]</tt> becomes <tt>T const(&)[N]</tt>
+ /// \li <tt>T[N]</tt> becomes <tt>T const(&)[N]</tt>
+ /// \li <tt>T(&)[N]</tt> becomes <tt>T(&)[N]</tt>
+ /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt>
+ /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
+ /// \li <tt>T &</tt> becomes <tt>T &</tt>
+ /// \li <tt>T</tt> becomes <tt>T const &</tt>
+ typedef typename detail::term_traits<typename Expr::proto_child0>::const_reference type;
         };
 
- /// \brief A metafunction that returns the arity of a
- /// Proto expression.
+ /// \brief A metafunction that returns the type of the left child
+ /// of a binary Proto expression.
+ ///
+ /// <tt>result_of::left\<Expr\></tt> is equivalent to
+ /// <tt>result_of::child_c\<Expr, 0\></tt>.
         template<typename Expr>
- struct arity_of
- : Expr::proto_arity
+ struct left
+ : child_c<Expr, 0>
         {};
 
+ /// \brief A metafunction that returns the type of the right child
+ /// of a binary Proto expression.
+ ///
+ /// <tt>result_of::right\<Expr\></tt> is equivalent to
+ /// <tt>result_of::child_c\<Expr, 1\></tt>.
         template<typename Expr>
- struct arity_of<Expr &>
- : Expr::proto_arity
+ struct right
+ : child_c<Expr, 1>
         {};
 
- namespace result_of
- {
- /// \brief A metafunction that computes the return type of the \c as_expr()
- /// function.
- template<typename T, typename Domain /*= default_domain*/>
- struct as_expr
- {
- typedef typename Domain::template as_expr<T>::result_type type;
- };
+ } // namespace result_of
 
- /// \brief A metafunction that computes the return type of the \c as_child()
- /// function.
- template<typename T, typename Domain /*= default_domain*/>
- struct as_child
- {
- typedef typename Domain::template as_child<T>::result_type type;
- };
+ /// \brief A metafunction for generating terminal expression types,
+ /// a grammar element for matching terminal expressions, and a
+ /// PrimitiveTransform that returns the current expression unchanged.
+ template<typename T>
+ struct terminal
+ : proto::transform<terminal<T>, int>
+ {
+ typedef proto::expr<proto::tag::terminal, term<T>, 0> type;
+ typedef proto::basic_expr<proto::tag::terminal, term<T>, 0> proto_grammar;
 
- /// \brief A metafunction that returns the type of the Nth child
- /// of a Proto expression, where N is an MPL Integral Constant.
- ///
- /// <tt>result_of::child\<Expr, N\></tt> is equivalent to
- /// <tt>result_of::child_c\<Expr, N::value\></tt>.
- template<typename Expr, typename N /* = mpl::long_<0>*/>
- struct child
- : child_c<Expr, N::value>
- {};
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
 
- /// \brief A metafunction that returns the type of the value
- /// of a terminal Proto expression.
- ///
- template<typename Expr>
- struct value
+ /// \param e The current expression
+ /// \pre <tt>matches\<Expr, terminal\<T\> \>::value</tt> is \c true.
+ /// \return \c e
+ /// \throw nothrow
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
             {
- /// Verify that we are actually operating on a terminal
- BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
-
- /// The raw type of the Nth child as it is stored within
- /// \c Expr. This may be a value or a reference
- typedef typename Expr::proto_child0 value_type;
-
- /// The "value" type of the child, suitable for storage by value,
- /// computed as follows:
- /// \li <tt>T const(&)[N]</tt> becomes <tt>T[N]</tt>
- /// \li <tt>T[N]</tt> becomes <tt>T[N]</tt>
- /// \li <tt>T(&)[N]</tt> becomes <tt>T[N]</tt>
- /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt>
- /// \li <tt>T const &</tt> becomes <tt>T</tt>
- /// \li <tt>T &</tt> becomes <tt>T</tt>
- /// \li <tt>T</tt> becomes <tt>T</tt>
- typedef typename detail::term_traits<typename Expr::proto_child0>::value_type type;
- };
+ return e;
+ }
+ };
 
- template<typename Expr>
- struct value<Expr &>
- {
- /// Verify that we are actually operating on a terminal
- BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
+ /// INTERNAL ONLY
+ typedef proto::tag::terminal proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ };
 
- /// The raw type of the Nth child as it is stored within
- /// \c Expr. This may be a value or a reference
- typedef typename Expr::proto_child0 value_type;
-
- /// The "reference" type of the child, suitable for storage by
- /// reference, computed as follows:
- /// \li <tt>T const(&)[N]</tt> becomes <tt>T const(&)[N]</tt>
- /// \li <tt>T[N]</tt> becomes <tt>T(&)[N]</tt>
- /// \li <tt>T(&)[N]</tt> becomes <tt>T(&)[N]</tt>
- /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt>
- /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
- /// \li <tt>T &</tt> becomes <tt>T &</tt>
- /// \li <tt>T</tt> becomes <tt>T &</tt>
- typedef typename detail::term_traits<typename Expr::proto_child0>::reference type;
- };
+ /// \brief A metafunction for generating ternary conditional expression types,
+ /// a grammar element for matching ternary conditional expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ template<typename T, typename U, typename V>
+ struct if_else_
+ : proto::transform<if_else_<T, U, V>, int>
+ {
+ typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type;
+ typedef proto::basic_expr<proto::tag::if_else_, list3<T, U, V>, 3> proto_grammar;
 
- template<typename Expr>
- struct value<Expr const &>
- {
- /// Verify that we are actually operating on a terminal
- BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<if_else_, Expr, State, Data>
+ {};
 
- /// The raw type of the Nth child as it is stored within
- /// \c Expr. This may be a value or a reference
- typedef typename Expr::proto_child0 value_type;
-
- /// The "const reference" type of the child, suitable for storage by
- /// const reference, computed as follows:
- /// \li <tt>T const(&)[N]</tt> becomes <tt>T const(&)[N]</tt>
- /// \li <tt>T[N]</tt> becomes <tt>T const(&)[N]</tt>
- /// \li <tt>T(&)[N]</tt> becomes <tt>T(&)[N]</tt>
- /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt>
- /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
- /// \li <tt>T &</tt> becomes <tt>T &</tt>
- /// \li <tt>T</tt> becomes <tt>T const &</tt>
- typedef typename detail::term_traits<typename Expr::proto_child0>::const_reference type;
- };
+ /// INTERNAL ONLY
+ typedef proto::tag::if_else_ proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ /// INTERNAL ONLY
+ typedef U proto_child1;
+ /// INTERNAL ONLY
+ typedef V proto_child2;
+ };
 
- /// \brief A metafunction that returns the type of the left child
- /// of a binary Proto expression.
- ///
- /// <tt>result_of::left\<Expr\></tt> is equivalent to
- /// <tt>result_of::child_c\<Expr, 0\></tt>.
- template<typename Expr>
- struct left
- : child_c<Expr, 0>
- {};
+ /// \brief A metafunction for generating nullary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching nullary expressions, and a
+ /// PrimitiveTransform that returns the current expression unchanged.
+ ///
+ /// Use <tt>nullary_expr\<_, _\></tt> as a grammar element to match any
+ /// nullary expression.
+ template<typename Tag, typename T>
+ struct nullary_expr
+ : proto::transform<nullary_expr<Tag, T>, int>
+ {
+ typedef proto::expr<Tag, term<T>, 0> type;
+ typedef proto::basic_expr<Tag, term<T>, 0> proto_grammar;
 
- /// \brief A metafunction that returns the type of the right child
- /// of a binary Proto expression.
- ///
- /// <tt>result_of::right\<Expr\></tt> is equivalent to
- /// <tt>result_of::child_c\<Expr, 1\></tt>.
- template<typename Expr>
- struct right
- : child_c<Expr, 1>
- {};
-
- } // namespace result_of
-
- /// \brief A metafunction for generating terminal expression types,
- /// a grammar element for matching terminal expressions, and a
- /// PrimitiveTransform that returns the current expression unchanged.
- template<typename T>
- struct terminal
- : proto::transform<terminal<T>, int>
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
         {
- typedef proto::expr<proto::tag::terminal, term<T>, 0> type;
- typedef proto::basic_expr<proto::tag::terminal, term<T>, 0> proto_grammar;
+ typedef Expr result_type;
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ /// \param e The current expression
+ /// \pre <tt>matches\<Expr, nullary_expr\<Tag, T\> \>::value</tt> is \c true.
+ /// \return \c e
+ /// \throw nothrow
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
             {
- typedef Expr result_type;
+ return e;
+ }
+ };
 
- /// \param e The current expression
- /// \pre <tt>matches\<Expr, terminal\<T\> \>::value</tt> is \c true.
- /// \return \c e
- /// \throw nothrow
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator ()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ };
 
- /// INTERNAL ONLY
- typedef proto::tag::terminal proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- };
+ /// \brief A metafunction for generating unary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching unary expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ ///
+ /// Use <tt>unary_expr\<_, _\></tt> as a grammar element to match any
+ /// unary expression.
+ template<typename Tag, typename T>
+ struct unary_expr
+ : proto::transform<unary_expr<Tag, T>, int>
+ {
+ typedef proto::expr<Tag, list1<T>, 1> type;
+ typedef proto::basic_expr<Tag, list1<T>, 1> proto_grammar;
 
- /// \brief A metafunction for generating ternary conditional expression types,
- /// a grammar element for matching ternary conditional expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- template<typename T, typename U, typename V>
- struct if_else_
- : proto::transform<if_else_<T, U, V>, int>
- {
- typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type;
- typedef proto::basic_expr<proto::tag::if_else_, list3<T, U, V>, 3> proto_grammar;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<unary_expr, Expr, State, Data>
+ {};
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<if_else_, Expr, State, Data>
- {};
-
- /// INTERNAL ONLY
- typedef proto::tag::if_else_ proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- /// INTERNAL ONLY
- typedef U proto_child1;
- /// INTERNAL ONLY
- typedef V proto_child2;
- };
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ };
 
- /// \brief A metafunction for generating nullary expression types with a
- /// specified tag type,
- /// a grammar element for matching nullary expressions, and a
- /// PrimitiveTransform that returns the current expression unchanged.
- ///
- /// Use <tt>nullary_expr\<_, _\></tt> as a grammar element to match any
- /// nullary expression.
- template<typename Tag, typename T>
- struct nullary_expr
- : proto::transform<nullary_expr<Tag, T>, int>
- {
- typedef proto::expr<Tag, term<T>, 0> type;
- typedef proto::basic_expr<Tag, term<T>, 0> proto_grammar;
+ /// \brief A metafunction for generating binary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching binary expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ ///
+ /// Use <tt>binary_expr\<_, _, _\></tt> as a grammar element to match any
+ /// binary expression.
+ template<typename Tag, typename T, typename U>
+ struct binary_expr
+ : proto::transform<binary_expr<Tag, T, U>, int>
+ {
+ typedef proto::expr<Tag, list2<T, U>, 2> type;
+ typedef proto::basic_expr<Tag, list2<T, U>, 2> proto_grammar;
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<binary_expr, Expr, State, Data>
+ {};
 
- /// \param e The current expression
- /// \pre <tt>matches\<Expr, nullary_expr\<Tag, T\> \>::value</tt> is \c true.
- /// \return \c e
- /// \throw nothrow
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator ()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ /// INTERNAL ONLY
+ typedef U proto_child1;
+ };
 
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- };
+#define BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(Op) \
+ template<typename T> \
+ struct Op \
+ : proto::transform<Op<T>, int> \
+ { \
+ typedef proto::expr<proto::tag::Op, list1<T>, 1> type; \
+ typedef proto::basic_expr<proto::tag::Op, list1<T>, 1> proto_grammar; \
+ \
+ template<typename Expr, typename State, typename Data> \
+ struct impl \
+ : detail::pass_through_impl<Op, Expr, State, Data> \
+ {}; \
+ \
+ typedef proto::tag::Op proto_tag; \
+ typedef T proto_child0; \
+ }; \
+ /**/
+
+#define BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(Op) \
+ template<typename T, typename U> \
+ struct Op \
+ : proto::transform<Op<T, U>, int> \
+ { \
+ typedef proto::expr<proto::tag::Op, list2<T, U>, 2> type; \
+ typedef proto::basic_expr<proto::tag::Op, list2<T, U>, 2> proto_grammar; \
+ \
+ template<typename Expr, typename State, typename Data> \
+ struct impl \
+ : detail::pass_through_impl<Op, Expr, State, Data> \
+ {}; \
+ \
+ typedef proto::tag::Op proto_tag; \
+ typedef T proto_child0; \
+ typedef U proto_child1; \
+ }; \
+ /**/
+
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(unary_plus)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(negate)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(dereference)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(complement)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(address_of)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(logical_not)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_inc)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_dec)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_inc)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_dec)
+
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less_equal)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater_equal)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(equal_to)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(not_equal_to)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_or)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_and)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(comma)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(mem_ptr)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(subscript)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(member)
 
- /// \brief A metafunction for generating unary expression types with a
- /// specified tag type,
- /// a grammar element for matching unary expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- ///
- /// Use <tt>unary_expr\<_, _\></tt> as a grammar element to match any
- /// unary expression.
- template<typename Tag, typename T>
- struct unary_expr
- : proto::transform<unary_expr<Tag, T>, int>
- {
- typedef proto::expr<Tag, list1<T>, 1> type;
- typedef proto::basic_expr<Tag, list1<T>, 1> proto_grammar;
+ #undef BOOST_PROTO_DEFINE_UNARY_METAFUNCTION
+ #undef BOOST_PROTO_DEFINE_BINARY_METAFUNCTION
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<unary_expr, Expr, State, Data>
- {};
-
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- };
+ #include <boost/proto/detail/traits.hpp>
 
- /// \brief A metafunction for generating binary expression types with a
- /// specified tag type,
- /// a grammar element for matching binary expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- ///
- /// Use <tt>binary_expr\<_, _, _\></tt> as a grammar element to match any
- /// binary expression.
- template<typename Tag, typename T, typename U>
- struct binary_expr
- : proto::transform<binary_expr<Tag, T, U>, int>
+ namespace functional
+ {
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c as_expr() function.
+ template<typename Domain /* = default_domain*/>
+ struct as_expr
         {
- typedef proto::expr<Tag, list2<T, U>, 2> type;
- typedef proto::basic_expr<Tag, list2<T, U>, 2> proto_grammar;
+ BOOST_PROTO_CALLABLE()
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<binary_expr, Expr, State, Data>
- {};
-
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- /// INTERNAL ONLY
- typedef U proto_child1;
- };
+ template<typename Sig>
+ struct result;
 
- #define BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(Op) \
- template<typename T> \
- struct Op \
- : proto::transform<Op<T>, int> \
- { \
- typedef proto::expr<proto::tag::Op, list1<T>, 1> type; \
- typedef proto::basic_expr<proto::tag::Op, list1<T>, 1> proto_grammar; \
- \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : detail::pass_through_impl<Op, Expr, State, Data> \
- {}; \
- \
- typedef proto::tag::Op proto_tag; \
- typedef T proto_child0; \
- }; \
- /**/
-
- #define BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(Op) \
- template<typename T, typename U> \
- struct Op \
- : proto::transform<Op<T, U>, int> \
- { \
- typedef proto::expr<proto::tag::Op, list2<T, U>, 2> type; \
- typedef proto::basic_expr<proto::tag::Op, list2<T, U>, 2> proto_grammar; \
- \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : detail::pass_through_impl<Op, Expr, State, Data> \
- {}; \
- \
- typedef proto::tag::Op proto_tag; \
- typedef T proto_child0; \
- typedef U proto_child1; \
- }; \
- /**/
-
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(unary_plus)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(negate)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(dereference)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(complement)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(address_of)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(logical_not)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_inc)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_dec)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_inc)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_dec)
-
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less_equal)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater_equal)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(equal_to)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(not_equal_to)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_or)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_and)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(comma)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(mem_ptr)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(subscript)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(member)
+ template<typename This, typename T>
+ struct result<This(T)>
+ {
+ typedef typename Domain::template as_expr<T>::result_type type;
+ };
 
- #undef BOOST_PROTO_DEFINE_UNARY_METAFUNCTION
- #undef BOOST_PROTO_DEFINE_BINARY_METAFUNCTION
+ template<typename This, typename T>
+ struct result<This(T &)>
+ {
+ typedef typename Domain::template as_expr<T>::result_type type;
+ };
 
- #define BOOST_PROTO_CHILD(Z, N, DATA) \
- /** INTERNAL ONLY */ \
- typedef BOOST_PP_CAT(DATA, N) BOOST_PP_CAT(proto_child, N); \
- /**/
+ /// \brief Wrap an object in a Proto terminal if it isn't a
+ /// Proto expression already.
+ /// \param t The object to wrap.
+ /// \return <tt>proto::as_expr\<Domain\>(t)</tt>
+ template<typename T>
+ typename add_const<typename result<as_expr(T &)>::type>::type
+ operator ()(T &t) const
+ {
+ return typename Domain::template as_expr<T>()(t);
+ }
+
+ /// \overload
+ ///
+ template<typename T>
+ typename add_const<typename result<as_expr(T const &)>::type>::type
+ operator ()(T const &t) const
+ {
+ return typename Domain::template as_expr<T const>()(t);
+ }
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/traits.hpp>))
- #include BOOST_PP_ITERATE()
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ template<typename T, std::size_t N_>
+ typename add_const<typename result<as_expr(T (&)[N_])>::type>::type
+ operator ()(T (&t)[N_]) const
+ {
+ return typename Domain::template as_expr<T[N_]>()(t);
+ }
 
- #undef BOOST_PROTO_CHILD
- #undef BOOST_PROTO_IMPLICIT_ARG
+ template<typename T, std::size_t N_>
+ typename add_const<typename result<as_expr(T const (&)[N_])>::type>::type
+ operator ()(T const (&t)[N_]) const
+ {
+ return typename Domain::template as_expr<T const[N_]>()(t);
+ }
+ #endif
+ };
 
- namespace functional
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c as_child() function.
+ template<typename Domain /* = default_domain*/>
+ struct as_child
         {
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c as_expr() function.
- template<typename Domain /* = default_domain*/>
- struct as_expr
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename T>
- struct result<This(T)>
- {
- typedef typename Domain::template as_expr<T>::result_type type;
- };
-
- template<typename This, typename T>
- struct result<This(T &)>
- {
- typedef typename Domain::template as_expr<T>::result_type type;
- };
-
- /// \brief Wrap an object in a Proto terminal if it isn't a
- /// Proto expression already.
- /// \param t The object to wrap.
- /// \return <tt>proto::as_expr\<Domain\>(t)</tt>
- template<typename T>
- typename add_const<typename result<as_expr(T &)>::type>::type
- operator ()(T &t) const
- {
- return typename Domain::template as_expr<T>()(t);
- }
-
- /// \overload
- ///
- template<typename T>
- typename add_const<typename result<as_expr(T const &)>::type>::type
- operator ()(T const &t) const
- {
- return typename Domain::template as_expr<T const>()(t);
- }
-
- #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
- template<typename T, std::size_t N_>
- typename add_const<typename result<as_expr(T (&)[N_])>::type>::type
- operator ()(T (&t)[N_]) const
- {
- return typename Domain::template as_expr<T[N_]>()(t);
- }
-
- template<typename T, std::size_t N_>
- typename add_const<typename result<as_expr(T const (&)[N_])>::type>::type
- operator ()(T const (&t)[N_]) const
- {
- return typename Domain::template as_expr<T const[N_]>()(t);
- }
- #endif
- };
+ BOOST_PROTO_CALLABLE()
+
+ template<typename Sig>
+ struct result;
 
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c as_child() function.
- template<typename Domain /* = default_domain*/>
- struct as_child
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename T>
- struct result<This(T)>
- {
- typedef typename Domain::template as_child<T>::result_type type;
- };
-
- template<typename This, typename T>
- struct result<This(T &)>
- {
- typedef typename Domain::template as_child<T>::result_type type;
- };
-
- /// \brief Wrap an object in a Proto terminal if it isn't a
- /// Proto expression already.
- /// \param t The object to wrap.
- /// \return <tt>proto::as_child\<Domain\>(t)</tt>
- template<typename T>
- typename add_const<typename result<as_child(T &)>::type>::type
- operator ()(T &t) const
- {
- return typename Domain::template as_child<T>()(t);
- }
-
- /// \overload
- ///
- template<typename T>
- typename add_const<typename result<as_child(T const &)>::type>::type
- operator ()(T const &t) const
- {
- return typename Domain::template as_child<T const>()(t);
- }
+ template<typename This, typename T>
+ struct result<This(T)>
+ {
+ typedef typename Domain::template as_child<T>::result_type type;
             };
 
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c child_c() function.
- template<long N>
- struct child_c
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::child_c<Expr, N>::type type;
- };
-
- /// \brief Return the Nth child of the given expression.
- /// \param expr The expression node.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
- /// \pre <tt>N \< Expr::proto_arity::value</tt>
- /// \return <tt>proto::child_c\<N\>(expr)</tt>
- /// \throw nothrow
- template<typename Expr>
- typename result_of::child_c<Expr &, N>::type
- operator ()(Expr &e) const
- {
- return result_of::child_c<Expr &, N>::call(e);
- }
-
- /// \overload
- ///
- template<typename Expr>
- typename result_of::child_c<Expr const &, N>::type
- operator ()(Expr const &e) const
- {
- return result_of::child_c<Expr const &, N>::call(e);
- }
+ template<typename This, typename T>
+ struct result<This(T &)>
+ {
+ typedef typename Domain::template as_child<T>::result_type type;
             };
 
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c child() function.
+ /// \brief Wrap an object in a Proto terminal if it isn't a
+ /// Proto expression already.
+ /// \param t The object to wrap.
+ /// \return <tt>proto::as_child\<Domain\>(t)</tt>
+ template<typename T>
+ typename add_const<typename result<as_child(T &)>::type>::type
+ operator ()(T &t) const
+ {
+ return typename Domain::template as_child<T>()(t);
+ }
+
+ /// \overload
             ///
- /// A callable PolymorphicFunctionObject that is
- /// equivalent to the \c child() function. \c N is required
- /// to be an MPL Integral Constant.
- template<typename N /* = mpl::long_<0>*/>
- struct child
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::child<Expr, N>::type type;
- };
-
- /// \brief Return the Nth child of the given expression.
- /// \param expr The expression node.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
- /// \pre <tt>N::value \< Expr::proto_arity::value</tt>
- /// \return <tt>proto::child\<N\>(expr)</tt>
- /// \throw nothrow
- template<typename Expr>
- typename result_of::child<Expr &, N>::type
- operator ()(Expr &e) const
- {
- return result_of::child<Expr &, N>::call(e);
- }
-
- /// \overload
- ///
- template<typename Expr>
- typename result_of::child<Expr const &, N>::type
- operator ()(Expr const &e) const
- {
- return result_of::child<Expr const &, N>::call(e);
- }
- };
+ template<typename T>
+ typename add_const<typename result<as_child(T const &)>::type>::type
+ operator ()(T const &t) const
+ {
+ return typename Domain::template as_child<T const>()(t);
+ }
+ };
 
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c value() function.
- struct value
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::value<Expr>::type type;
- };
-
- /// \brief Return the value of the given terminal expression.
- /// \param expr The terminal expression node.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
- /// \pre <tt>0 == Expr::proto_arity::value</tt>
- /// \return <tt>proto::value(expr)</tt>
- /// \throw nothrow
- template<typename Expr>
- typename result_of::value<Expr &>::type
- operator ()(Expr &e) const
- {
- return e.proto_base().child0;
- }
-
- /// \overload
- ///
- template<typename Expr>
- typename result_of::value<Expr const &>::type
- operator ()(Expr const &e) const
- {
- return e.proto_base().child0;
- }
- };
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c child_c() function.
+ template<long N>
+ struct child_c
+ {
+ BOOST_PROTO_CALLABLE()
 
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c left() function.
- struct left
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::left<Expr>::type type;
- };
-
- /// \brief Return the left child of the given binary expression.
- /// \param expr The expression node.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
- /// \pre <tt>2 == Expr::proto_arity::value</tt>
- /// \return <tt>proto::left(expr)</tt>
- /// \throw nothrow
- template<typename Expr>
- typename result_of::left<Expr &>::type
- operator ()(Expr &e) const
- {
- return e.proto_base().child0;
- }
-
- /// \overload
- ///
- template<typename Expr>
- typename result_of::left<Expr const &>::type
- operator ()(Expr const &e) const
- {
- return e.proto_base().child0;
- }
- };
+ template<typename Sig>
+ struct result;
 
- /// \brief A callable PolymorphicFunctionObject that is
- /// equivalent to the \c right() function.
- struct right
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::right<Expr>::type type;
- };
-
- /// \brief Return the right child of the given binary expression.
- /// \param expr The expression node.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
- /// \pre <tt>2 == Expr::proto_arity::value</tt>
- /// \return <tt>proto::right(expr)</tt>
- /// \throw nothrow
- template<typename Expr>
- typename result_of::right<Expr &>::type
- operator ()(Expr &e) const
- {
- return e.proto_base().child1;
- }
-
- template<typename Expr>
- typename result_of::right<Expr const &>::type
- operator ()(Expr const &e) const
- {
- return e.proto_base().child1;
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef typename result_of::child_c<Expr, N>::type type;
             };
 
- }
+ /// \brief Return the Nth child of the given expression.
+ /// \param expr The expression node.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
+ /// \pre <tt>N \< Expr::proto_arity::value</tt>
+ /// \return <tt>proto::child_c\<N\>(expr)</tt>
+ /// \throw nothrow
+ template<typename Expr>
+ typename result_of::child_c<Expr &, N>::type
+ operator ()(Expr &e) const
+ {
+ return result_of::child_c<Expr &, N>::call(e);
+ }
 
- /// \brief A function that wraps non-Proto expression types in Proto
- /// terminals and leaves Proto expression types alone.
- ///
- /// The <tt>as_expr()</tt> function turns objects into Proto terminals if
- /// they are not Proto expression types already. Non-Proto types are
- /// held by value, if possible. Types which are already Proto types are
- /// left alone and returned by reference.
- ///
- /// This function can be called either with an explicitly specified
- /// \c Domain parameter (i.e., <tt>as_expr\<Domain\>(t)</tt>), or
- /// without (i.e., <tt>as_expr(t)</tt>). If no domain is
- /// specified, \c default_domain is assumed.
- ///
- /// If <tt>is_expr\<T\>::value</tt> is \c true, then the argument is
- /// returned unmodified, by reference. Otherwise, the argument is wrapped
- /// in a Proto terminal expression node according to the following rules.
- /// If \c T is a function type, let \c A be <tt>T &</tt>. Otherwise, let
- /// \c A be the type \c T stripped of cv-qualifiers. Then, \c as_expr()
- /// returns <tt>Domain()(terminal\<A\>::type::make(t))</tt>.
- ///
- /// \param t The object to wrap.
- template<typename T>
- typename add_const<typename result_of::as_expr<T, default_domain>::type>::type
- as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return default_domain::as_expr<T>()(t);
- }
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::child_c<Expr const &, N>::type
+ operator ()(Expr const &e) const
+ {
+ return result_of::child_c<Expr const &, N>::call(e);
+ }
+ };
 
- /// \overload
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c child() function.
         ///
- template<typename T>
- typename add_const<typename result_of::as_expr<T const, default_domain>::type>::type
- as_expr(T const &t)
+ /// A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c child() function. \c N is required
+ /// to be an MPL Integral Constant.
+ template<typename N /* = mpl::long_<0>*/>
+ struct child
         {
- return default_domain::as_expr<T const>()(t);
- }
+ BOOST_PROTO_CALLABLE()
 
- /// \overload
- ///
- template<typename Domain, typename T>
- typename add_const<typename result_of::as_expr<T, Domain>::type>::type
- as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return typename Domain::template as_expr<T>()(t);
- }
+ template<typename Sig>
+ struct result;
 
- /// \overload
- ///
- template<typename Domain, typename T>
- typename add_const<typename result_of::as_expr<T const, Domain>::type>::type
- as_expr(T const &t)
- {
- return typename Domain::template as_expr<T const>()(t);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef typename result_of::child<Expr, N>::type type;
+ };
 
- /// \brief A function that wraps non-Proto expression types in Proto
- /// terminals (by reference) and returns Proto expression types by
- /// reference
- ///
- /// The <tt>as_child()</tt> function turns objects into Proto terminals if
- /// they are not Proto expression types already. Non-Proto types are
- /// held by reference. Types which are already Proto types are simply
- /// returned as-is.
- ///
- /// This function can be called either with an explicitly specified
- /// \c Domain parameter (i.e., <tt>as_child\<Domain\>(t)</tt>), or
- /// without (i.e., <tt>as_child(t)</tt>). If no domain is
- /// specified, \c default_domain is assumed.
- ///
- /// If <tt>is_expr\<T\>::value</tt> is \c true, then the argument is
- /// returned as-is. Otherwise, \c as_child() returns
- /// <tt>Domain()(terminal\<T &\>::type::make(t))</tt>.
- ///
- /// \param t The object to wrap.
- template<typename T>
- typename add_const<typename result_of::as_child<T, default_domain>::type>::type
- as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return default_domain::as_child<T>()(t);
- }
+ /// \brief Return the Nth child of the given expression.
+ /// \param expr The expression node.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
+ /// \pre <tt>N::value \< Expr::proto_arity::value</tt>
+ /// \return <tt>proto::child\<N\>(expr)</tt>
+ /// \throw nothrow
+ template<typename Expr>
+ typename result_of::child<Expr &, N>::type
+ operator ()(Expr &e) const
+ {
+ return result_of::child<Expr &, N>::call(e);
+ }
 
- /// \overload
- ///
- template<typename T>
- typename add_const<typename result_of::as_child<T const, default_domain>::type>::type
- as_child(T const &t)
- {
- return default_domain::as_child<T const>()(t);
- }
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::child<Expr const &, N>::type
+ operator ()(Expr const &e) const
+ {
+ return result_of::child<Expr const &, N>::call(e);
+ }
+ };
 
- /// \overload
- ///
- template<typename Domain, typename T>
- typename add_const<typename result_of::as_child<T, Domain>::type>::type
- as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c value() function.
+ struct value
         {
- return typename Domain::template as_child<T>()(t);
- }
+ BOOST_PROTO_CALLABLE()
 
- /// \overload
- ///
- template<typename Domain, typename T>
- typename add_const<typename result_of::as_child<T const, Domain>::type>::type
- as_child(T const &t)
- {
- return typename Domain::template as_child<T const>()(t);
- }
+ template<typename Sig>
+ struct result;
 
- /// \brief Return the Nth child of the specified Proto expression.
- ///
- /// Return the Nth child of the specified Proto expression. If
- /// \c N is not specified, as in \c child(expr), then \c N is assumed
- /// to be <tt>mpl::long_\<0\></tt>. The child is returned by
- /// reference.
- ///
- /// \param expr The Proto expression.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
- /// \pre \c N is an MPL Integral Constant.
- /// \pre <tt>N::value \< Expr::proto_arity::value</tt>
- /// \throw nothrow
- /// \return A reference to the Nth child
- template<typename N, typename Expr>
- typename result_of::child<Expr &, N>::type
- child(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return result_of::child<Expr &, N>::call(e);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef typename result_of::value<Expr>::type type;
+ };
 
- /// \overload
- ///
- template<typename N, typename Expr>
- typename result_of::child<Expr const &, N>::type
- child(Expr const &e)
- {
- return result_of::child<Expr const &, N>::call(e);
- }
+ /// \brief Return the value of the given terminal expression.
+ /// \param expr The terminal expression node.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
+ /// \pre <tt>0 == Expr::proto_arity::value</tt>
+ /// \return <tt>proto::value(expr)</tt>
+ /// \throw nothrow
+ template<typename Expr>
+ typename result_of::value<Expr &>::type
+ operator ()(Expr &e) const
+ {
+ return e.proto_base().child0;
+ }
 
- /// \overload
- ///
- template<typename Expr2>
- typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::reference
- child(Expr2 &expr2 BOOST_PROTO_DISABLE_IF_IS_CONST(Expr2))
- {
- return expr2.proto_base().child0;
- }
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::value<Expr const &>::type
+ operator ()(Expr const &e) const
+ {
+ return e.proto_base().child0;
+ }
+ };
 
- /// \overload
- ///
- template<typename Expr2>
- typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::const_reference
- child(Expr2 const &expr2)
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c left() function.
+ struct left
         {
- return expr2.proto_base().child0;
- }
+ BOOST_PROTO_CALLABLE()
 
- /// \brief Return the Nth child of the specified Proto expression.
- ///
- /// Return the Nth child of the specified Proto expression. The child
- /// is returned by reference.
- ///
- /// \param expr The Proto expression.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
- /// \pre <tt>N \< Expr::proto_arity::value</tt>
- /// \throw nothrow
- /// \return A reference to the Nth child
- template<long N, typename Expr>
- typename result_of::child_c<Expr &, N>::type
- child_c(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return result_of::child_c<Expr &, N>::call(e);
- }
+ template<typename Sig>
+ struct result;
 
- /// \overload
- ///
- template<long N, typename Expr>
- typename result_of::child_c<Expr const &, N>::type
- child_c(Expr const &e)
- {
- return result_of::child_c<Expr const &, N>::call(e);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef typename result_of::left<Expr>::type type;
+ };
 
- /// \brief Return the value stored within the specified Proto
- /// terminal expression.
- ///
- /// Return the the value stored within the specified Proto
- /// terminal expression. The value is returned by
- /// reference.
- ///
- /// \param expr The Proto terminal expression.
- /// \pre <tt>N::value == 0</tt>
- /// \throw nothrow
- /// \return A reference to the terminal's value
- template<typename Expr>
- typename result_of::value<Expr &>::type
- value(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return e.proto_base().child0;
- }
+ /// \brief Return the left child of the given binary expression.
+ /// \param expr The expression node.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
+ /// \pre <tt>2 == Expr::proto_arity::value</tt>
+ /// \return <tt>proto::left(expr)</tt>
+ /// \throw nothrow
+ template<typename Expr>
+ typename result_of::left<Expr &>::type
+ operator ()(Expr &e) const
+ {
+ return e.proto_base().child0;
+ }
 
- /// \overload
- ///
- template<typename Expr>
- typename result_of::value<Expr const &>::type
- value(Expr const &e)
- {
- return e.proto_base().child0;
- }
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::left<Expr const &>::type
+ operator ()(Expr const &e) const
+ {
+ return e.proto_base().child0;
+ }
+ };
 
- /// \brief Return the left child of the specified binary Proto
- /// expression.
- ///
- /// Return the left child of the specified binary Proto expression. The
- /// child is returned by reference.
- ///
- /// \param expr The Proto expression.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
- /// \pre <tt>2 == Expr::proto_arity::value</tt>
- /// \throw nothrow
- /// \return A reference to the left child
- template<typename Expr>
- typename result_of::left<Expr &>::type
- left(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
+ /// \brief A callable PolymorphicFunctionObject that is
+ /// equivalent to the \c right() function.
+ struct right
         {
- return e.proto_base().child0;
- }
+ BOOST_PROTO_CALLABLE()
 
- /// \overload
- ///
- template<typename Expr>
- typename result_of::left<Expr const &>::type
- left(Expr const &e)
- {
- return e.proto_base().child0;
- }
+ template<typename Sig>
+ struct result;
 
- /// \brief Return the right child of the specified binary Proto
- /// expression.
- ///
- /// Return the right child of the specified binary Proto expression. The
- /// child is returned by reference.
- ///
- /// \param expr The Proto expression.
- /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
- /// \pre <tt>2 == Expr::proto_arity::value</tt>
- /// \throw nothrow
- /// \return A reference to the right child
- template<typename Expr>
- typename result_of::right<Expr &>::type
- right(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return e.proto_base().child1;
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef typename result_of::right<Expr>::type type;
+ };
 
- /// \overload
- ///
- template<typename Expr>
- typename result_of::right<Expr const &>::type
- right(Expr const &e)
- {
- return e.proto_base().child1;
- }
+ /// \brief Return the right child of the given binary expression.
+ /// \param expr The expression node.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true
+ /// \pre <tt>2 == Expr::proto_arity::value</tt>
+ /// \return <tt>proto::right(expr)</tt>
+ /// \throw nothrow
+ template<typename Expr>
+ typename result_of::right<Expr &>::type
+ operator ()(Expr &e) const
+ {
+ return e.proto_base().child1;
+ }
 
- /// INTERNAL ONLY
- ///
- template<typename Domain>
- struct is_callable<functional::as_expr<Domain> >
- : mpl::true_
- {};
+ template<typename Expr>
+ typename result_of::right<Expr const &>::type
+ operator ()(Expr const &e) const
+ {
+ return e.proto_base().child1;
+ }
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename Domain>
- struct is_callable<functional::as_child<Domain> >
- : mpl::true_
- {};
+ }
 
- /// INTERNAL ONLY
- ///
- template<long N>
- struct is_callable<functional::child_c<N> >
- : mpl::true_
- {};
+ /// \brief A function that wraps non-Proto expression types in Proto
+ /// terminals and leaves Proto expression types alone.
+ ///
+ /// The <tt>as_expr()</tt> function turns objects into Proto terminals if
+ /// they are not Proto expression types already. Non-Proto types are
+ /// held by value, if possible. Types which are already Proto types are
+ /// left alone and returned by reference.
+ ///
+ /// This function can be called either with an explicitly specified
+ /// \c Domain parameter (i.e., <tt>as_expr\<Domain\>(t)</tt>), or
+ /// without (i.e., <tt>as_expr(t)</tt>). If no domain is
+ /// specified, \c default_domain is assumed.
+ ///
+ /// If <tt>is_expr\<T\>::value</tt> is \c true, then the argument is
+ /// returned unmodified, by reference. Otherwise, the argument is wrapped
+ /// in a Proto terminal expression node according to the following rules.
+ /// If \c T is a function type, let \c A be <tt>T &</tt>. Otherwise, let
+ /// \c A be the type \c T stripped of cv-qualifiers. Then, \c as_expr()
+ /// returns <tt>Domain()(terminal\<A\>::type::make(t))</tt>.
+ ///
+ /// \param t The object to wrap.
+ template<typename T>
+ typename add_const<typename result_of::as_expr<T, default_domain>::type>::type
+ as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
+ {
+ return default_domain::as_expr<T>()(t);
+ }
 
- /// INTERNAL ONLY
- ///
- template<typename N>
- struct is_callable<functional::child<N> >
- : mpl::true_
- {};
+ /// \overload
+ ///
+ template<typename T>
+ typename add_const<typename result_of::as_expr<T const, default_domain>::type>::type
+ as_expr(T const &t)
+ {
+ return default_domain::as_expr<T const>()(t);
+ }
 
- }}
+ /// \overload
+ ///
+ template<typename Domain, typename T>
+ typename add_const<typename result_of::as_expr<T, Domain>::type>::type
+ as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
+ {
+ return typename Domain::template as_expr<T>()(t);
+ }
 
- #if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
- #pragma warning(pop)
- #endif
+ /// \overload
+ ///
+ template<typename Domain, typename T>
+ typename add_const<typename result_of::as_expr<T const, Domain>::type>::type
+ as_expr(T const &t)
+ {
+ return typename Domain::template as_expr<T const>()(t);
+ }
 
- #endif
+ /// \brief A function that wraps non-Proto expression types in Proto
+ /// terminals (by reference) and returns Proto expression types by
+ /// reference
+ ///
+ /// The <tt>as_child()</tt> function turns objects into Proto terminals if
+ /// they are not Proto expression types already. Non-Proto types are
+ /// held by reference. Types which are already Proto types are simply
+ /// returned as-is.
+ ///
+ /// This function can be called either with an explicitly specified
+ /// \c Domain parameter (i.e., <tt>as_child\<Domain\>(t)</tt>), or
+ /// without (i.e., <tt>as_child(t)</tt>). If no domain is
+ /// specified, \c default_domain is assumed.
+ ///
+ /// If <tt>is_expr\<T\>::value</tt> is \c true, then the argument is
+ /// returned as-is. Otherwise, \c as_child() returns
+ /// <tt>Domain()(terminal\<T &\>::type::make(t))</tt>.
+ ///
+ /// \param t The object to wrap.
+ template<typename T>
+ typename add_const<typename result_of::as_child<T, default_domain>::type>::type
+ as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
+ {
+ return default_domain::as_child<T>()(t);
+ }
 
-#else // PP_IS_ITERATING
+ /// \overload
+ ///
+ template<typename T>
+ typename add_const<typename result_of::as_child<T const, default_domain>::type>::type
+ as_child(T const &t)
+ {
+ return default_domain::as_child<T const>()(t);
+ }
 
- #define N BOOST_PP_ITERATION()
- #if N > 0
- /// \brief A metafunction for generating function-call expression types,
- /// a grammar element for matching function-call expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- struct function
- #if N != BOOST_PROTO_MAX_ARITY
- <
- BOOST_PP_ENUM_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- #endif
- : proto::transform<
- function<
- BOOST_PP_ENUM_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- , int
- >
- {
- typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
- typedef proto::basic_expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
+ /// \overload
+ ///
+ template<typename Domain, typename T>
+ typename add_const<typename result_of::as_child<T, Domain>::type>::type
+ as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
+ {
+ return typename Domain::template as_child<T>()(t);
+ }
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<function, Expr, State, Data>
- {};
-
- /// INTERNAL ONLY
- typedef proto::tag::function proto_tag;
- BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
- BOOST_PP_REPEAT_FROM_TO(
- N
- , BOOST_PROTO_MAX_ARITY
- , BOOST_PROTO_CHILD
- , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
- )
- };
+ /// \overload
+ ///
+ template<typename Domain, typename T>
+ typename add_const<typename result_of::as_child<T const, Domain>::type>::type
+ as_child(T const &t)
+ {
+ return typename Domain::template as_child<T const>()(t);
+ }
 
- /// \brief A metafunction for generating n-ary expression types with a
- /// specified tag type,
- /// a grammar element for matching n-ary expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- ///
- /// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
- /// n-ary expression; that is, any non-terminal.
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct nary_expr
- #if N != BOOST_PROTO_MAX_ARITY
- <
- Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- #endif
- : proto::transform<
- nary_expr<
- Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- , int
- >
- {
- typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
- typedef proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
+ /// \brief Return the Nth child of the specified Proto expression.
+ ///
+ /// Return the Nth child of the specified Proto expression. If
+ /// \c N is not specified, as in \c child(expr), then \c N is assumed
+ /// to be <tt>mpl::long_\<0\></tt>. The child is returned by
+ /// reference.
+ ///
+ /// \param expr The Proto expression.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
+ /// \pre \c N is an MPL Integral Constant.
+ /// \pre <tt>N::value \< Expr::proto_arity::value</tt>
+ /// \throw nothrow
+ /// \return A reference to the Nth child
+ template<typename N, typename Expr>
+ typename result_of::child<Expr &, N>::type
+ child(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
+ {
+ return result_of::child<Expr &, N>::call(e);
+ }
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<nary_expr, Expr, State, Data>
- {};
-
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
- BOOST_PP_REPEAT_FROM_TO(
- N
- , BOOST_PROTO_MAX_ARITY
- , BOOST_PROTO_CHILD
- , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
- )
- };
+ /// \overload
+ ///
+ template<typename N, typename Expr>
+ typename result_of::child<Expr const &, N>::type
+ child(Expr const &e)
+ {
+ return result_of::child<Expr const &, N>::call(e);
+ }
 
- namespace detail
- {
- template<
- template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class T
- , BOOST_PP_ENUM_PARAMS(N, typename A)
- >
- struct is_callable_<T<BOOST_PP_ENUM_PARAMS(N, A)> BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(N)>
- : is_same<BOOST_PP_CAT(A, BOOST_PP_DEC(N)), callable>
- {};
- }
+ /// \overload
+ ///
+ template<typename Expr2>
+ typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::reference
+ child(Expr2 &expr2 BOOST_PROTO_DISABLE_IF_IS_CONST(Expr2))
+ {
+ return expr2.proto_base().child0;
+ }
 
- #endif
+ /// \overload
+ ///
+ template<typename Expr2>
+ typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::const_reference
+ child(Expr2 const &expr2)
+ {
+ return expr2.proto_base().child0;
+ }
 
- namespace result_of
- {
- /// \brief A metafunction that returns the type of the Nth child
- /// of a Proto expression.
- ///
- /// A metafunction that returns the type of the Nth child
- /// of a Proto expression. \c N must be less than
- /// \c Expr::proto_arity::value.
- template<typename Expr>
- struct child_c<Expr, N>
- {
- /// Verify that we are not operating on a terminal
- BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ /// \brief Return the Nth child of the specified Proto expression.
+ ///
+ /// Return the Nth child of the specified Proto expression. The child
+ /// is returned by reference.
+ ///
+ /// \param expr The Proto expression.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
+ /// \pre <tt>N \< Expr::proto_arity::value</tt>
+ /// \throw nothrow
+ /// \return A reference to the Nth child
+ template<long N, typename Expr>
+ typename result_of::child_c<Expr &, N>::type
+ child_c(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
+ {
+ return result_of::child_c<Expr &, N>::call(e);
+ }
 
- /// The raw type of the Nth child as it is stored within
- /// \c Expr. This may be a value or a reference
- typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
-
- /// The "value" type of the child, suitable for return by value,
- /// computed as follows:
- /// \li <tt>T const &</tt> becomes <tt>T</tt>
- /// \li <tt>T &</tt> becomes <tt>T</tt>
- /// \li <tt>T</tt> becomes <tt>T</tt>
- typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::value_type type;
- };
+ /// \overload
+ ///
+ template<long N, typename Expr>
+ typename result_of::child_c<Expr const &, N>::type
+ child_c(Expr const &e)
+ {
+ return result_of::child_c<Expr const &, N>::call(e);
+ }
 
- template<typename Expr>
- struct child_c<Expr &, N>
- {
- /// Verify that we are not operating on a terminal
- BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ /// \brief Return the value stored within the specified Proto
+ /// terminal expression.
+ ///
+ /// Return the the value stored within the specified Proto
+ /// terminal expression. The value is returned by
+ /// reference.
+ ///
+ /// \param expr The Proto terminal expression.
+ /// \pre <tt>N::value == 0</tt>
+ /// \throw nothrow
+ /// \return A reference to the terminal's value
+ template<typename Expr>
+ typename result_of::value<Expr &>::type
+ value(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
+ {
+ return e.proto_base().child0;
+ }
 
- /// The raw type of the Nth child as it is stored within
- /// \c Expr. This may be a value or a reference
- typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
-
- /// The "reference" type of the child, suitable for return by
- /// reference, computed as follows:
- /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
- /// \li <tt>T &</tt> becomes <tt>T &</tt>
- /// \li <tt>T</tt> becomes <tt>T &</tt>
- typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::reference type;
-
- /// INTERNAL ONLY
- ///
- static type call(Expr &e)
- {
- return e.proto_base().BOOST_PP_CAT(child, N);
- }
- };
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::value<Expr const &>::type
+ value(Expr const &e)
+ {
+ return e.proto_base().child0;
+ }
 
- template<typename Expr>
- struct child_c<Expr const &, N>
- {
- /// Verify that we are not operating on a terminal
- BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ /// \brief Return the left child of the specified binary Proto
+ /// expression.
+ ///
+ /// Return the left child of the specified binary Proto expression. The
+ /// child is returned by reference.
+ ///
+ /// \param expr The Proto expression.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
+ /// \pre <tt>2 == Expr::proto_arity::value</tt>
+ /// \throw nothrow
+ /// \return A reference to the left child
+ template<typename Expr>
+ typename result_of::left<Expr &>::type
+ left(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
+ {
+ return e.proto_base().child0;
+ }
 
- /// The raw type of the Nth child as it is stored within
- /// \c Expr. This may be a value or a reference
- typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
-
- /// The "const reference" type of the child, suitable for return by
- /// const reference, computed as follows:
- /// \li <tt>T const &</tt> becomes <tt>T const &</tt>
- /// \li <tt>T &</tt> becomes <tt>T &</tt>
- /// \li <tt>T</tt> becomes <tt>T const &</tt>
- typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::const_reference type;
-
- /// INTERNAL ONLY
- ///
- static type call(Expr const &e)
- {
- return e.proto_base().BOOST_PP_CAT(child, N);
- }
- };
- }
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::left<Expr const &>::type
+ left(Expr const &e)
+ {
+ return e.proto_base().child0;
+ }
+
+ /// \brief Return the right child of the specified binary Proto
+ /// expression.
+ ///
+ /// Return the right child of the specified binary Proto expression. The
+ /// child is returned by reference.
+ ///
+ /// \param expr The Proto expression.
+ /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true.
+ /// \pre <tt>2 == Expr::proto_arity::value</tt>
+ /// \throw nothrow
+ /// \return A reference to the right child
+ template<typename Expr>
+ typename result_of::right<Expr &>::type
+ right(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
+ {
+ return e.proto_base().child1;
+ }
 
- #undef N
+ /// \overload
+ ///
+ template<typename Expr>
+ typename result_of::right<Expr const &>::type
+ right(Expr const &e)
+ {
+ return e.proto_base().child1;
+ }
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Domain>
+ struct is_callable<functional::as_expr<Domain> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Domain>
+ struct is_callable<functional::as_child<Domain> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<long N>
+ struct is_callable<functional::child_c<N> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename N>
+ struct is_callable<functional::child<N> >
+ : mpl::true_
+ {};
+
+}}
+
+#if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
+ #pragma warning(pop)
+#endif
 
 #endif

Modified: branches/release/boost/proto/transform/call.hpp
==============================================================================
--- branches/release/boost/proto/transform/call.hpp (original)
+++ branches/release/boost/proto/transform/call.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,416 +1,355 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file call.hpp
- /// Contains definition of the call<> transform.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
- #define BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/ref.hpp>
- #include <boost/utility/result_of.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/impl.hpp>
- #include <boost/proto/detail/as_lvalue.hpp>
- #include <boost/proto/detail/poly_function.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file call.hpp
+/// Contains definition of the call<> transform.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
+#define BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/ref.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/detail/as_lvalue.hpp>
+#include <boost/proto/detail/poly_function.hpp>
+
+namespace boost { namespace proto
+{
+ /// \brief Wrap \c PrimitiveTransform so that <tt>when\<\></tt> knows
+ /// it is callable. Requires that the parameter is actually a
+ /// PrimitiveTransform.
+ ///
+ /// This form of <tt>call\<\></tt> is useful for annotating an
+ /// arbitrary PrimitiveTransform as callable when using it with
+ /// <tt>when\<\></tt>. Consider the following transform, which
+ /// is parameterized with another transform.
+ ///
+ /// \code
+ /// template<typename Grammar>
+ /// struct Foo
+ /// : when<
+ /// unary_plus<Grammar>
+ /// , Grammar(_child) // May or may not work.
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The problem with the above is that <tt>when\<\></tt> may or
+ /// may not recognize \c Grammar as callable, depending on how
+ /// \c Grammar is implemented. (See <tt>is_callable\<\></tt> for
+ /// a discussion of this issue.) You can guard against
+ /// the issue by wrapping \c Grammar in <tt>call\<\></tt>, such
+ /// as:
+ ///
+ /// \code
+ /// template<typename Grammar>
+ /// struct Foo
+ /// : when<
+ /// unary_plus<Grammar>
+ /// , call<Grammar>(_child) // OK, this works
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The above could also have been written as:
+ ///
+ /// \code
+ /// template<typename Grammar>
+ /// struct Foo
+ /// : when<
+ /// unary_plus<Grammar>
+ /// , call<Grammar(_child)> // OK, this works, too
+ /// >
+ /// {};
+ /// \endcode
+ template<typename PrimitiveTransform>
+ struct call
+ : PrimitiveTransform
+ {};
+
+ /// \brief Either call the PolymorphicFunctionObject with 0
+ /// arguments, or invoke the PrimitiveTransform with 3
+ /// arguments.
+ template<typename Fun>
+ struct call<Fun()> : transform<call<Fun()> >
     {
- /// \brief Wrap \c PrimitiveTransform so that <tt>when\<\></tt> knows
- /// it is callable. Requires that the parameter is actually a
- /// PrimitiveTransform.
- ///
- /// This form of <tt>call\<\></tt> is useful for annotating an
- /// arbitrary PrimitiveTransform as callable when using it with
- /// <tt>when\<\></tt>. Consider the following transform, which
- /// is parameterized with another transform.
- ///
- /// \code
- /// template<typename Grammar>
- /// struct Foo
- /// : when<
- /// unary_plus<Grammar>
- /// , Grammar(_child) // May or may not work.
- /// >
- /// {};
- /// \endcode
- ///
- /// The problem with the above is that <tt>when\<\></tt> may or
- /// may not recognize \c Grammar as callable, depending on how
- /// \c Grammar is implemented. (See <tt>is_callable\<\></tt> for
- /// a discussion of this issue.) You can guard against
- /// the issue by wrapping \c Grammar in <tt>call\<\></tt>, such
- /// as:
- ///
- /// \code
- /// template<typename Grammar>
- /// struct Foo
- /// : when<
- /// unary_plus<Grammar>
- /// , call<Grammar>(_child) // OK, this works
- /// >
- /// {};
- /// \endcode
+ /// INTERNAL ONLY
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename BOOST_PROTO_RESULT_OF<Fun()>::type result_type;
+
+ result_type operator()(
+ typename impl2::expr_param
+ , typename impl2::state_param
+ , typename impl2::data_param
+ ) const
+ {
+ return Fun()();
+ }
+ };
+
+ /// INTERNAL ONLY
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : Fun::template impl<Expr, State, Data>
+ {};
+
+ /// Either call the PolymorphicFunctionObject \c Fun with 0 arguments; or
+ /// invoke the PrimitiveTransform \c Fun with 3 arguments: the current
+ /// expression, state, and data.
         ///
- /// The above could also have been written as:
+ /// If \c Fun is a nullary PolymorphicFunctionObject, return <tt>Fun()()</tt>.
+ /// Otherwise, return <tt>Fun()(e, s, d)</tt>.
         ///
- /// \code
- /// template<typename Grammar>
- /// struct Foo
- /// : when<
- /// unary_plus<Grammar>
- /// , call<Grammar(_child)> // OK, this works, too
- /// >
- /// {};
- /// \endcode
- template<typename PrimitiveTransform>
- struct call
- : PrimitiveTransform
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+
+ /// If \c Fun is a nullary PolymorphicFunctionObject, \c type is a typedef
+ /// for <tt>boost::result_of\<Fun()\>::type</tt>. Otherwise, it is
+ /// a typedef for <tt>boost::result_of\<Fun(Expr, State, Data)\>::type</tt>.
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
         {};
+ };
 
- /// \brief Either call the PolymorphicFunctionObject with 0
- /// arguments, or invoke the PrimitiveTransform with 3
- /// arguments.
- template<typename Fun>
- struct call<Fun()> : transform<call<Fun()> >
+ /// \brief Either call the PolymorphicFunctionObject with 1
+ /// argument, or invoke the PrimitiveTransform with 3
+ /// arguments.
+ template<typename Fun, typename A0>
+ struct call<Fun(A0)> : transform<call<Fun(A0)> >
+ {
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
         {
- /// INTERNAL ONLY
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename detail::poly_function_traits<Fun, Fun(a0)>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename BOOST_PROTO_RESULT_OF<Fun()>::type result_type;
-
- result_type operator()(
- typename impl2::expr_param
- , typename impl2::state_param
- , typename impl2::data_param
- ) const
- {
- return Fun()();
- }
- };
-
- /// INTERNAL ONLY
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : Fun::template impl<Expr, State, Data>
- {};
-
- /// Either call the PolymorphicFunctionObject \c Fun with 0 arguments; or
- /// invoke the PrimitiveTransform \c Fun with 3 arguments: the current
- /// expression, state, and data.
- ///
- /// If \c Fun is a nullary PolymorphicFunctionObject, return <tt>Fun()()</tt>.
- /// Otherwise, return <tt>Fun()(e, s, d)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
-
- /// If \c Fun is a nullary PolymorphicFunctionObject, \c type is a typedef
- /// for <tt>boost::result_of\<Fun()\>::type</tt>. Otherwise, it is
- /// a typedef for <tt>boost::result_of\<Fun(Expr, State, Data)\>::type</tt>.
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename detail::poly_function_traits<Fun, Fun(a0)>::function_type()(
+ detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
+ );
+ }
         };
 
- /// \brief Either call the PolymorphicFunctionObject with 1
- /// argument, or invoke the PrimitiveTransform with 3
- /// arguments.
- template<typename Fun, typename A0>
- struct call<Fun(A0)> : transform<call<Fun(A0)> >
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename detail::poly_function_traits<Fun, Fun(a0)>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename detail::poly_function_traits<Fun, Fun(a0)>::function_type()(
- detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
- );
- }
- };
-
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename Fun::template impl<a0, State, Data>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename Fun::template impl<a0, State, Data>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename Fun::template impl<a0, State, Data>()(
- typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
- , s
- , d
- );
- }
- };
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
- /// be the type of \c x.
- /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
- /// then \c type is a typedef for <tt>boost::result_of\<Fun(X)\>::type</tt>.
- /// Otherwise, it is a typedef for <tt>boost::result_of\<Fun(X, State, Data)\>::type</tt>.
-
- /// Either call the PolymorphicFunctionObject with 1 argument:
- /// the result of applying the \c A0 transform; or
- /// invoke the PrimitiveTransform with 3 arguments:
- /// result of applying the \c A0 transform, the state, and the
- /// data.
- ///
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
- /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
- /// then return <tt>Fun()(x)</tt>. Otherwise, return
- /// <tt>Fun()(x, s, d)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename Fun::template impl<a0, State, Data>()(
+ typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
+ , s
+ , d
+ );
+ }
         };
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
+ /// be the type of \c x.
+ /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
+ /// then \c type is a typedef for <tt>boost::result_of\<Fun(X)\>::type</tt>.
+ /// Otherwise, it is a typedef for <tt>boost::result_of\<Fun(X, State, Data)\>::type</tt>.
+
+ /// Either call the PolymorphicFunctionObject with 1 argument:
+ /// the result of applying the \c A0 transform; or
+ /// invoke the PrimitiveTransform with 3 arguments:
+ /// result of applying the \c A0 transform, the state, and the
+ /// data.
+ ///
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
+ /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
+ /// then return <tt>Fun()(x)</tt>. Otherwise, return
+ /// <tt>Fun()(x, s, d)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
+ {};
+ };
 
- /// \brief Either call the PolymorphicFunctionObject with 2
- /// arguments, or invoke the PrimitiveTransform with 3
- /// arguments.
- template<typename Fun, typename A0, typename A1>
- struct call<Fun(A0, A1)> : transform<call<Fun(A0, A1)> >
+ /// \brief Either call the PolymorphicFunctionObject with 2
+ /// arguments, or invoke the PrimitiveTransform with 3
+ /// arguments.
+ template<typename Fun, typename A0, typename A1>
+ struct call<Fun(A0, A1)> : transform<call<Fun(A0, A1)> >
+ {
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename detail::poly_function_traits<Fun, Fun(a0, a1)>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename detail::poly_function_traits<Fun, Fun(a0, a1)>::function_type()(
- detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
- , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
- );
- }
- };
-
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename detail::poly_function_traits<Fun, Fun(a0, a1)>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename Fun::template impl<a0, a1, Data>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename Fun::template impl<a0, a1, Data>()(
- typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
- , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
- , d
- );
- }
- };
-
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
- /// be the type of \c x.
- /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt> and \c Y
- /// be the type of \c y.
- /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
- /// and \c y, then \c type is a typedef for
- /// <tt>boost::result_of\<Fun(X, Y)\>::type</tt>. Otherwise, it is
- /// a typedef for <tt>boost::result_of\<Fun(X, Y, Data)\>::type</tt>.
-
- /// Either call the PolymorphicFunctionObject with 2 arguments:
- /// the result of applying the \c A0 transform, and the
- /// result of applying the \c A1 transform; or invoke the
- /// PrimitiveTransform with 3 arguments: the result of applying
- /// the \c A0 transform, the result of applying the \c A1
- /// transform, and the data.
- ///
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
- /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
- /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
- /// and \c y, return <tt>Fun()(x, y)</tt>. Otherwise, return
- /// <tt>Fun()(x, y, d)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename detail::poly_function_traits<Fun, Fun(a0, a1)>::function_type()(
+ detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
+ , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
+ );
+ }
         };
 
- /// \brief Call the PolymorphicFunctionObject or the
- /// PrimitiveTransform with the current expression, state
- /// and data, transformed according to \c A0, \c A1, and
- /// \c A2, respectively.
- template<typename Fun, typename A0, typename A1, typename A2>
- struct call<Fun(A0, A1, A2)> : transform<call<Fun(A0, A1, A2)> >
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename Fun::template impl<a0, a1, Data>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
- typedef typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::function_type()(
- detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
- , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
- , detail::as_lvalue(typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d))
- );
- }
- };
-
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
- typedef typename Fun::template impl<a0, a1, a2>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename Fun::template impl<a0, a1, a2>()(
- typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
- , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
- , typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d)
- );
- }
- };
-
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
- /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
- /// Let \c z be <tt>when\<_, A2\>()(e, s, d)</tt>.
- /// Return <tt>Fun()(x, y, z)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename Fun::template impl<a0, a1, Data>()(
+ typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
+ , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
+ , d
+ );
+ }
         };
 
- #if BOOST_PROTO_MAX_ARITY > 3
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (4, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/call.hpp>))
- #include BOOST_PP_ITERATE()
- #endif
-
- /// INTERNAL ONLY
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
+ /// be the type of \c x.
+ /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt> and \c Y
+ /// be the type of \c y.
+ /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
+ /// and \c y, then \c type is a typedef for
+ /// <tt>boost::result_of\<Fun(X, Y)\>::type</tt>. Otherwise, it is
+ /// a typedef for <tt>boost::result_of\<Fun(X, Y, Data)\>::type</tt>.
+
+ /// Either call the PolymorphicFunctionObject with 2 arguments:
+ /// the result of applying the \c A0 transform, and the
+ /// result of applying the \c A1 transform; or invoke the
+ /// PrimitiveTransform with 3 arguments: the result of applying
+ /// the \c A0 transform, the result of applying the \c A1
+ /// transform, and the data.
         ///
- template<typename Fun>
- struct is_callable<call<Fun> >
- : mpl::true_
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
+ /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
+ /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
+ /// and \c y, return <tt>Fun()(x, y)</tt>. Otherwise, return
+ /// <tt>Fun()(x, y, d)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
         {};
+ };
 
- }} // namespace boost::proto
-
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
+ /// \brief Call the PolymorphicFunctionObject or the
+ /// PrimitiveTransform with the current expression, state
+ /// and data, transformed according to \c A0, \c A1, and
+ /// \c A2, respectively.
+ template<typename Fun, typename A0, typename A1, typename A2>
+ struct call<Fun(A0, A1, A2)> : transform<call<Fun(A0, A1, A2)> >
+ {
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
+ typedef typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
+ {
+ return typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::function_type()(
+ detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
+ , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
+ , detail::as_lvalue(typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d))
+ );
+ }
+ };
 
- /// \brief Call the PolymorphicFunctionObject \c Fun with the
- /// current expression, state and data, transformed according
- /// to \c A0 through \c AN.
- template<typename Fun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> : transform<call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> >
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
+ typedef typename Fun::template impl<a0, a1, a2>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- #define M0(Z, M, DATA) \
- typedef \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data> \
- ::result_type \
- BOOST_PP_CAT(a, M); \
- /**/
- BOOST_PP_REPEAT(N, M0, ~)
- #undef M0
-
- typedef
- typename detail::poly_function_traits<Fun, Fun(BOOST_PP_ENUM_PARAMS(N, a))>::result_type
- result_type;
-
- /// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
- /// for each \c x in <tt>[0,N]</tt>.
- /// Return <tt>Fun()(a0, a1,... aN)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- #define M0(Z, M, DATA) \
- detail::as_lvalue( \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data>()(e, s, d)) \
- /**/
- return typename detail::poly_function_traits<Fun, Fun(BOOST_PP_ENUM_PARAMS(N, a))>::function_type()(
- BOOST_PP_ENUM(N, M0, ~)
- );
- #undef M0
- }
- };
+ return typename Fun::template impl<a0, a1, a2>()(
+ typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
+ , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
+ , typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d)
+ );
+ }
         };
 
- #undef N
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
+ /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
+ /// Let \c z be <tt>when\<_, A2\>()(e, s, d)</tt>.
+ /// Return <tt>Fun()(x, y, z)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
+ {};
+ };
+
+ #include <boost/proto/transform/detail/call.hpp>
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Fun>
+ struct is_callable<call<Fun> >
+ : mpl::true_
+ {};
+
+}} // namespace boost::proto
 
 #endif

Modified: branches/release/boost/proto/transform/default.hpp
==============================================================================
--- branches/release/boost/proto/transform/default.hpp (original)
+++ branches/release/boost/proto/transform/default.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,621 +1,510 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file default.hpp
- /// Contains definition of the _default transform, which gives operators their
- /// usual C++ meanings and uses Boost.Typeof to deduce return types.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_DEFAULT_HPP_EAN_04_04_2008
- #define BOOST_PROTO_TRANSFORM_DEFAULT_HPP_EAN_04_04_2008
-
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/arithmetic/add.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_shifted.hpp>
- #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
- #include <boost/ref.hpp>
- #include <boost/get_pointer.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/is_member_pointer.hpp>
- #include <boost/type_traits/is_member_object_pointer.hpp>
- #include <boost/type_traits/is_member_function_pointer.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/impl.hpp>
- #include <boost/proto/transform/arg.hpp>
- #include <boost/proto/detail/decltype.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file default.hpp
+/// Contains definition of the _default transform, which gives operators their
+/// usual C++ meanings and uses Boost.Typeof to deduce return types.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_DEFAULT_HPP_EAN_04_04_2008
+#define BOOST_PROTO_TRANSFORM_DEFAULT_HPP_EAN_04_04_2008
+
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_shifted.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/ref.hpp>
+#include <boost/get_pointer.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_member_pointer.hpp>
+#include <boost/type_traits/is_member_object_pointer.hpp>
+#include <boost/type_traits/is_member_function_pointer.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/transform/arg.hpp>
+#include <boost/proto/detail/decltype.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
+ template<typename Grammar, typename Tag>
+ struct default_case
+ : not_<_>
+ {};
+
+ template<typename Grammar>
+ struct default_case<Grammar, tag::terminal>
+ : when<terminal<_>, _value>
+ {};
+
+ template<typename Grammar>
+ struct default_cases
         {
- template<typename Grammar, typename Tag>
- struct default_case
- : not_<_>
+ template<typename Tag>
+ struct case_
+ : default_case<Grammar, Tag>
             {};
+ };
 
- template<typename Grammar>
- struct default_case<Grammar, tag::terminal>
- : when<terminal<_>, _value>
- {};
+ #define BOOST_PROTO_UNARY_DEFAULT_EVAL(OP, TAG, MAKE) \
+ template<typename Grammar> \
+ struct BOOST_PP_CAT(default_, TAG) \
+ : transform<BOOST_PP_CAT(default_, TAG)<Grammar> > \
+ { \
+ template<typename Expr, typename State, typename Data> \
+ struct impl \
+ : transform_impl<Expr, State, Data> \
+ { \
+ private: \
+ typedef typename result_of::child_c<Expr, 0>::type e0; \
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0; \
+ public: \
+ BOOST_PROTO_DECLTYPE_(OP proto::detail::MAKE<r0>(), result_type) \
+ result_type operator ()( \
+ typename impl::expr_param e \
+ , typename impl::state_param s \
+ , typename impl::data_param d \
+ ) const \
+ { \
+ typename Grammar::template impl<e0, State, Data> t0; \
+ return OP t0(proto::child_c<0>(e), s, d); \
+ } \
+ }; \
+ }; \
+ \
+ template<typename Grammar> \
+ struct default_case<Grammar, tag::TAG> \
+ : when<unary_expr<tag::TAG, Grammar>, BOOST_PP_CAT(default_, TAG)<Grammar> > \
+ {}; \
+ /**/
+
+ #define BOOST_PROTO_BINARY_DEFAULT_EVAL(OP, TAG, LMAKE, RMAKE) \
+ template<typename Grammar> \
+ struct BOOST_PP_CAT(default_, TAG) \
+ : transform<BOOST_PP_CAT(default_, TAG)<Grammar> > \
+ { \
+ template<typename Expr, typename State, typename Data> \
+ struct impl \
+ : transform_impl<Expr, State, Data> \
+ { \
+ private: \
+ typedef typename result_of::child_c<Expr, 0>::type e0; \
+ typedef typename result_of::child_c<Expr, 1>::type e1; \
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0; \
+ typedef typename Grammar::template impl<e1, State, Data>::result_type r1; \
+ public: \
+ BOOST_PROTO_DECLTYPE_( \
+ proto::detail::LMAKE<r0>() OP proto::detail::RMAKE<r1>() \
+ , result_type \
+ ) \
+ result_type operator ()( \
+ typename impl::expr_param e \
+ , typename impl::state_param s \
+ , typename impl::data_param d \
+ ) const \
+ { \
+ typename Grammar::template impl<e0, State, Data> t0; \
+ typename Grammar::template impl<e1, State, Data> t1; \
+ return t0(proto::child_c<0>(e), s, d) \
+ OP t1(proto::child_c<1>(e), s, d); \
+ } \
+ }; \
+ }; \
+ \
+ template<typename Grammar> \
+ struct default_case<Grammar, tag::TAG> \
+ : when<binary_expr<tag::TAG, Grammar, Grammar>, BOOST_PP_CAT(default_, TAG)<Grammar> > \
+ {}; \
+ /**/
+
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(+, unary_plus, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(-, negate, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(*, dereference, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(~, complement, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(&, address_of, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(!, logical_not, make)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(++, pre_inc, make_mutable)
+ BOOST_PROTO_UNARY_DEFAULT_EVAL(--, pre_dec, make_mutable)
+
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<<, shift_left, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>>, shift_right, make_mutable, make_mutable)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(*, multiplies, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(/, divides, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(%, modulus, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(+, plus, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(-, minus, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<, less, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>, greater, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<=, less_equal, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>=, greater_equal, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(==, equal_to, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(!=, not_equal_to, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(||, logical_or, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(&&, logical_and, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(&, bitwise_and, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(|, bitwise_or, make, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(^, bitwise_xor, make, make)
+
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(=, assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(<<=, shift_left_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(>>=, shift_right_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(*=, multiplies_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(/=, divides_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(%=, modulus_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(+=, plus_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(-=, minus_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(&=, bitwise_and_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(|=, bitwise_or_assign, make_mutable, make)
+ BOOST_PROTO_BINARY_DEFAULT_EVAL(^=, bitwise_xor_assign, make_mutable, make)
 
- template<typename Grammar>
- struct default_cases
- {
- template<typename Tag>
- struct case_
- : default_case<Grammar, Tag>
- {};
- };
+ #undef BOOST_PROTO_UNARY_DEFAULT_EVAL
+ #undef BOOST_PROTO_BINARY_DEFAULT_EVAL
 
- #define BOOST_PROTO_UNARY_DEFAULT_EVAL(OP, TAG, MAKE) \
- template<typename Grammar> \
- struct BOOST_PP_CAT(default_, TAG) \
- : transform<BOOST_PP_CAT(default_, TAG)<Grammar> > \
- { \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : transform_impl<Expr, State, Data> \
- { \
- private: \
- typedef typename result_of::child_c<Expr, 0>::type e0; \
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0; \
- public: \
- BOOST_PROTO_DECLTYPE_(OP proto::detail::MAKE<r0>(), result_type) \
- result_type operator ()( \
- typename impl::expr_param e \
- , typename impl::state_param s \
- , typename impl::data_param d \
- ) const \
- { \
- typename Grammar::template impl<e0, State, Data> t0; \
- return OP t0(proto::child_c<0>(e), s, d); \
- } \
- }; \
- }; \
- \
- template<typename Grammar> \
- struct default_case<Grammar, tag::TAG> \
- : when<unary_expr<tag::TAG, Grammar>, BOOST_PP_CAT(default_, TAG)<Grammar> > \
- {}; \
- /**/
+ /// INTERNAL ONLY
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct is_member_function_invocation
+ : is_member_function_pointer<
+ typename uncvref<
+ typename Grammar::template impl<
+ typename result_of::child_c<Expr, 1>::type
+ , State
+ , Data
+ >::result_type
+ >::type
+ >
+ {};
 
- #define BOOST_PROTO_BINARY_DEFAULT_EVAL(OP, TAG, LMAKE, RMAKE) \
- template<typename Grammar> \
- struct BOOST_PP_CAT(default_, TAG) \
- : transform<BOOST_PP_CAT(default_, TAG)<Grammar> > \
- { \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : transform_impl<Expr, State, Data> \
- { \
- private: \
- typedef typename result_of::child_c<Expr, 0>::type e0; \
- typedef typename result_of::child_c<Expr, 1>::type e1; \
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0; \
- typedef typename Grammar::template impl<e1, State, Data>::result_type r1; \
- public: \
- BOOST_PROTO_DECLTYPE_( \
- proto::detail::LMAKE<r0>() OP proto::detail::RMAKE<r1>() \
- , result_type \
- ) \
- result_type operator ()( \
- typename impl::expr_param e \
- , typename impl::state_param s \
- , typename impl::data_param d \
- ) const \
- { \
- typename Grammar::template impl<e0, State, Data> t0; \
- typename Grammar::template impl<e1, State, Data> t1; \
- return t0(proto::child_c<0>(e), s, d) \
- OP t1(proto::child_c<1>(e), s, d); \
- } \
- }; \
- }; \
- \
- template<typename Grammar> \
- struct default_case<Grammar, tag::TAG> \
- : when<binary_expr<tag::TAG, Grammar, Grammar>, BOOST_PP_CAT(default_, TAG)<Grammar> > \
- {}; \
- /**/
+ /// INTERNAL ONLY
+ template<typename Grammar, typename Expr, typename State, typename Data, bool IsMemFunCall>
+ struct default_mem_ptr_impl
+ : transform_impl<Expr, State, Data>
+ {
+ private:
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
+ typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
+ public:
+ typedef typename detail::mem_ptr_fun<r0, r1>::result_type result_type;
+ result_type operator ()(
+ typename default_mem_ptr_impl::expr_param e
+ , typename default_mem_ptr_impl::state_param s
+ , typename default_mem_ptr_impl::data_param d
+ ) const
+ {
+ typename Grammar::template impl<e0, State, Data> t0;
+ typename Grammar::template impl<e1, State, Data> t1;
+ return detail::mem_ptr_fun<r0, r1>()(
+ t0(proto::child_c<0>(e), s, d)
+ , t1(proto::child_c<1>(e), s, d)
+ );
+ }
+ };
 
- BOOST_PROTO_UNARY_DEFAULT_EVAL(+, unary_plus, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(-, negate, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(*, dereference, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(~, complement, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(&, address_of, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(!, logical_not, make)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(++, pre_inc, make_mutable)
- BOOST_PROTO_UNARY_DEFAULT_EVAL(--, pre_dec, make_mutable)
-
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<<, shift_left, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>>, shift_right, make_mutable, make_mutable)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(*, multiplies, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(/, divides, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(%, modulus, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(+, plus, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(-, minus, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<, less, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>, greater, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<=, less_equal, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>=, greater_equal, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(==, equal_to, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(!=, not_equal_to, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(||, logical_or, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(&&, logical_and, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(&, bitwise_and, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(|, bitwise_or, make, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(^, bitwise_xor, make, make)
-
- BOOST_PROTO_BINARY_DEFAULT_EVAL(=, assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(<<=, shift_left_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(>>=, shift_right_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(*=, multiplies_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(/=, divides_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(%=, modulus_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(+=, plus_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(-=, minus_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(&=, bitwise_and_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(|=, bitwise_or_assign, make_mutable, make)
- BOOST_PROTO_BINARY_DEFAULT_EVAL(^=, bitwise_xor_assign, make_mutable, make)
-
- #undef BOOST_PROTO_UNARY_DEFAULT_EVAL
- #undef BOOST_PROTO_BINARY_DEFAULT_EVAL
-
- /// INTERNAL ONLY
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct is_member_function_invocation
- : is_member_function_pointer<
- typename uncvref<
- typename Grammar::template impl<
- typename result_of::child_c<Expr, 1>::type
- , State
- , Data
- >::result_type
- >::type
+ /// INTERNAL ONLY
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_mem_ptr_impl<Grammar, Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
+ {
+ private:
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
+ typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
+ public:
+ typedef detail::memfun<r0, r1> result_type;
+ result_type const operator ()(
+ typename default_mem_ptr_impl::expr_param e
+ , typename default_mem_ptr_impl::state_param s
+ , typename default_mem_ptr_impl::data_param d
+ ) const
+ {
+ typename Grammar::template impl<e0, State, Data> t0;
+ typename Grammar::template impl<e1, State, Data> t1;
+ return detail::memfun<r0, r1>(
+ t0(proto::child_c<0>(e), s, d)
+ , t1(proto::child_c<1>(e), s, d)
+ );
+ }
+ };
+
+ template<typename Grammar>
+ struct default_mem_ptr
+ : transform<default_mem_ptr<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : default_mem_ptr_impl<
+ Grammar
+ , Expr
+ , State
+ , Data
+ , is_member_function_invocation<Grammar, Expr, State, Data>::value
>
             {};
+ };
+
+ template<typename Grammar>
+ struct default_case<Grammar, tag::mem_ptr>
+ : when<mem_ptr<Grammar, Grammar>, default_mem_ptr<Grammar> >
+ {};
 
- /// INTERNAL ONLY
- template<typename Grammar, typename Expr, typename State, typename Data, bool IsMemFunCall>
- struct default_mem_ptr_impl
+ template<typename Grammar>
+ struct default_post_inc
+ : transform<default_post_inc<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
               : transform_impl<Expr, State, Data>
             {
             private:
                 typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
                 typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
             public:
- typedef typename detail::mem_ptr_fun<r0, r1>::result_type result_type;
+ BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() ++, result_type)
                 result_type operator ()(
- typename default_mem_ptr_impl::expr_param e
- , typename default_mem_ptr_impl::state_param s
- , typename default_mem_ptr_impl::data_param d
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
                 ) const
                 {
                     typename Grammar::template impl<e0, State, Data> t0;
- typename Grammar::template impl<e1, State, Data> t1;
- return detail::mem_ptr_fun<r0, r1>()(
- t0(proto::child_c<0>(e), s, d)
- , t1(proto::child_c<1>(e), s, d)
- );
+ return t0(proto::child_c<0>(e), s, d) ++;
                 }
             };
+ };
+
+ template<typename Grammar>
+ struct default_case<Grammar, tag::post_inc>
+ : when<post_inc<Grammar>, default_post_inc<Grammar> >
+ {};
 
- /// INTERNAL ONLY
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct default_mem_ptr_impl<Grammar, Expr, State, Data, true>
+ template<typename Grammar>
+ struct default_post_dec
+ : transform<default_post_dec<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
               : transform_impl<Expr, State, Data>
             {
             private:
                 typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
                 typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
             public:
- typedef detail::memfun<r0, r1> result_type;
- result_type const operator ()(
- typename default_mem_ptr_impl::expr_param e
- , typename default_mem_ptr_impl::state_param s
- , typename default_mem_ptr_impl::data_param d
+ BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() --, result_type)
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
                 ) const
                 {
                     typename Grammar::template impl<e0, State, Data> t0;
- typename Grammar::template impl<e1, State, Data> t1;
- return detail::memfun<r0, r1>(
- t0(proto::child_c<0>(e), s, d)
- , t1(proto::child_c<1>(e), s, d)
- );
+ return t0(proto::child_c<0>(e), s, d) --;
                 }
             };
+ };
 
- template<typename Grammar>
- struct default_mem_ptr
- : transform<default_mem_ptr<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : default_mem_ptr_impl<
- Grammar
- , Expr
- , State
- , Data
- , is_member_function_invocation<Grammar, Expr, State, Data>::value
- >
- {};
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::mem_ptr>
- : when<mem_ptr<Grammar, Grammar>, default_mem_ptr<Grammar> >
- {};
-
- template<typename Grammar>
- struct default_post_inc
- : transform<default_post_inc<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : transform_impl<Expr, State, Data>
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- public:
- BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() ++, result_type)
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- typename Grammar::template impl<e0, State, Data> t0;
- return t0(proto::child_c<0>(e), s, d) ++;
- }
- };
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::post_inc>
- : when<post_inc<Grammar>, default_post_inc<Grammar> >
- {};
-
- template<typename Grammar>
- struct default_post_dec
- : transform<default_post_dec<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : transform_impl<Expr, State, Data>
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- public:
- BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() --, result_type)
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- typename Grammar::template impl<e0, State, Data> t0;
- return t0(proto::child_c<0>(e), s, d) --;
- }
- };
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::post_dec>
- : when<post_dec<Grammar>, default_post_dec<Grammar> >
- {};
-
- template<typename Grammar>
- struct default_subscript
- : transform<default_subscript<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : transform_impl<Expr, State, Data>
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
- public:
- BOOST_PROTO_DECLTYPE_(
- proto::detail::make_subscriptable<r0>() [ proto::detail::make<r1>() ]
- , result_type
- )
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- typename Grammar::template impl<e0, State, Data> t0;
- typename Grammar::template impl<e1, State, Data> t1;
- return t0(proto::child_c<0>(e), s, d) [
- t1(proto::child_c<1>(e), s, d) ];
- }
- };
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::subscript>
- : when<subscript<Grammar, Grammar>, default_subscript<Grammar> >
- {};
-
- template<typename Grammar>
- struct default_if_else_
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : transform_impl<Expr, State, Data>
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
- typedef typename result_of::child_c<Expr, 2>::type e2;
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
- typedef typename Grammar::template impl<e2, State, Data>::result_type r2;
- public:
- BOOST_PROTO_DECLTYPE_(
- proto::detail::make<r0>()
- ? proto::detail::make<r1>()
- : proto::detail::make<r2>()
- , result_type
- )
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- typename Grammar::template impl<e0, State, Data> t0;
- typename Grammar::template impl<e1, State, Data> t1;
- typename Grammar::template impl<e2, State, Data> t2;
- return t0(proto::child_c<0>(e), s, d)
- ? t1(proto::child_c<1>(e), s, d)
- : t2(proto::child_c<2>(e), s, d);
- }
- };
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::if_else_>
- : when<if_else_<Grammar, Grammar, Grammar>, default_if_else_<Grammar> >
- {};
-
- template<typename Grammar>
- struct default_comma
- : transform<default_comma<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : transform_impl<Expr, State, Data>
- {
- private:
- typedef typename result_of::child_c<Expr, 0>::type e0;
- typedef typename result_of::child_c<Expr, 1>::type e1;
- typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
- typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
- public:
- typedef typename proto::detail::comma_result<r0, r1>::type result_type;
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- typename Grammar::template impl<e0, State, Data> t0;
- typename Grammar::template impl<e1, State, Data> t1;
- return t0(proto::child_c<0>(e), s, d)
- , t1(proto::child_c<1>(e), s, d);
- }
- };
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::comma>
- : when<comma<Grammar, Grammar>, default_comma<Grammar> >
- {};
-
- template<typename Grammar, typename Expr, typename State, typename Data, long Arity>
- struct default_function_impl;
-
- template<typename Grammar>
- struct default_function
- : transform<default_function<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : default_function_impl<
- Grammar
- , Expr
- , State
- , Data
- , transform_impl<Expr, State, Data>::expr::proto_arity_c
- >
- {};
- };
-
- template<typename Grammar>
- struct default_case<Grammar, tag::function>
- : when<function<Grammar, vararg<Grammar> >, default_function<Grammar> >
- {};
-
- #define BOOST_PROTO_DEFAULT_EVAL_TYPE(Z, N, DATA) \
- typedef \
- typename result_of::child_c<DATA, N>::type \
- BOOST_PP_CAT(e, N); \
- \
- typedef \
- typename Grammar::template impl<BOOST_PP_CAT(e, N), State, Data>::result_type \
- BOOST_PP_CAT(r, N); \
- /**/
-
- #define BOOST_PROTO_DEFAULT_EVAL(Z, N, DATA) \
- typename Grammar::template impl<BOOST_PP_CAT(e, N), State, Data>()( \
- proto::child_c<N>(DATA), s, d \
- ) \
- /**/
+ template<typename Grammar>
+ struct default_case<Grammar, tag::post_dec>
+ : when<post_dec<Grammar>, default_post_dec<Grammar> >
+ {};
 
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct default_function_impl<Grammar, Expr, State, Data, 1>
+ template<typename Grammar>
+ struct default_subscript
+ : transform<default_subscript<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
               : transform_impl<Expr, State, Data>
             {
- BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
-
- typedef
- typename proto::detail::result_of_fixup<r0>::type
- function_type;
-
- typedef
- typename BOOST_PROTO_RESULT_OF<function_type()>::type
- result_type;
-
+ private:
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
+ typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
+ public:
+ BOOST_PROTO_DECLTYPE_(
+ proto::detail::make_subscriptable<r0>() [ proto::detail::make<r1>() ]
+ , result_type
+ )
                 result_type operator ()(
- typename default_function_impl::expr_param e
- , typename default_function_impl::state_param s
- , typename default_function_impl::data_param d
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
                 ) const
                 {
- return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)();
+ typename Grammar::template impl<e0, State, Data> t0;
+ typename Grammar::template impl<e1, State, Data> t1;
+ return t0(proto::child_c<0>(e), s, d) [
+ t1(proto::child_c<1>(e), s, d) ];
                 }
             };
+ };
 
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct default_function_impl<Grammar, Expr, State, Data, 2>
+ template<typename Grammar>
+ struct default_case<Grammar, tag::subscript>
+ : when<subscript<Grammar, Grammar>, default_subscript<Grammar> >
+ {};
+
+ template<typename Grammar>
+ struct default_if_else_
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
               : transform_impl<Expr, State, Data>
             {
- BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
- BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 1, Expr)
-
- typedef
- typename proto::detail::result_of_fixup<r0>::type
- function_type;
-
- typedef
- typename detail::result_of_<function_type(r1)>::type
- result_type;
-
- result_type operator ()(
- typename default_function_impl::expr_param e
- , typename default_function_impl::state_param s
- , typename default_function_impl::data_param d
- ) const
- {
- return this->invoke(
- e
- , s
- , d
- , is_member_function_pointer<function_type>()
- , is_member_object_pointer<function_type>()
- );
- }
-
             private:
- result_type invoke(
- typename default_function_impl::expr_param e
- , typename default_function_impl::state_param s
- , typename default_function_impl::data_param d
- , mpl::false_
- , mpl::false_
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename result_of::child_c<Expr, 2>::type e2;
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
+ typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
+ typedef typename Grammar::template impl<e2, State, Data>::result_type r2;
+ public:
+ BOOST_PROTO_DECLTYPE_(
+ proto::detail::make<r0>()
+ ? proto::detail::make<r1>()
+ : proto::detail::make<r2>()
+ , result_type
+ )
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
                 ) const
                 {
- return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)(BOOST_PROTO_DEFAULT_EVAL(~, 1, e));
+ typename Grammar::template impl<e0, State, Data> t0;
+ typename Grammar::template impl<e1, State, Data> t1;
+ typename Grammar::template impl<e2, State, Data> t2;
+ return t0(proto::child_c<0>(e), s, d)
+ ? t1(proto::child_c<1>(e), s, d)
+ : t2(proto::child_c<2>(e), s, d);
                 }
+ };
+ };
 
- result_type invoke(
- typename default_function_impl::expr_param e
- , typename default_function_impl::state_param s
- , typename default_function_impl::data_param d
- , mpl::true_
- , mpl::false_
- ) const
- {
- BOOST_PROTO_USE_GET_POINTER();
- typedef typename detail::classtypeof<function_type>::type class_type;
- return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
- BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
- )();
- }
+ template<typename Grammar>
+ struct default_case<Grammar, tag::if_else_>
+ : when<if_else_<Grammar, Grammar, Grammar>, default_if_else_<Grammar> >
+ {};
 
- result_type invoke(
- typename default_function_impl::expr_param e
- , typename default_function_impl::state_param s
- , typename default_function_impl::data_param d
- , mpl::false_
- , mpl::true_
+ template<typename Grammar>
+ struct default_comma
+ : transform<default_comma<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : transform_impl<Expr, State, Data>
+ {
+ private:
+ typedef typename result_of::child_c<Expr, 0>::type e0;
+ typedef typename result_of::child_c<Expr, 1>::type e1;
+ typedef typename Grammar::template impl<e0, State, Data>::result_type r0;
+ typedef typename Grammar::template impl<e1, State, Data>::result_type r1;
+ public:
+ typedef typename proto::detail::comma_result<r0, r1>::type result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
                 ) const
                 {
- BOOST_PROTO_USE_GET_POINTER();
- typedef typename detail::classtypeof<function_type>::type class_type;
- return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
- BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
- );
+ typename Grammar::template impl<e0, State, Data> t0;
+ typename Grammar::template impl<e1, State, Data> t1;
+ return t0(proto::child_c<0>(e), s, d)
+ , t1(proto::child_c<1>(e), s, d);
                 }
             };
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/default.hpp>))
- #include BOOST_PP_ITERATE()
+ template<typename Grammar>
+ struct default_case<Grammar, tag::comma>
+ : when<comma<Grammar, Grammar>, default_comma<Grammar> >
+ {};
 
- #undef BOOST_PROTO_DEFAULT_EVAL_TYPE
- #undef BOOST_PROTO_DEFAULT_EVAL
- }
+ template<typename Grammar, typename Expr, typename State, typename Data, long Arity>
+ struct default_function_impl;
 
- template<typename Grammar /*= detail::_default*/>
- struct _default
- : switch_<detail::default_cases<Grammar> >
- {};
+ template<typename Grammar>
+ struct default_function
+ : transform<default_function<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : default_function_impl<
+ Grammar
+ , Expr
+ , State
+ , Data
+ , transform_impl<Expr, State, Data>::expr::proto_arity_c
+ >
+ {};
+ };
 
         template<typename Grammar>
- struct is_callable<_default<Grammar> >
- : mpl::true_
+ struct default_case<Grammar, tag::function>
+ : when<function<Grammar, vararg<Grammar> >, default_function<Grammar> >
         {};
 
- namespace detail
- {
- // Loopy indirection that allows proto::_default<> to be
- // used without specifying a Grammar argument.
- struct _default
- : proto::_default<>
- {};
- }
+ #define BOOST_PROTO_DEFAULT_EVAL_TYPE(Z, N, DATA) \
+ typedef \
+ typename result_of::child_c<DATA, N>::type \
+ BOOST_PP_CAT(e, N); \
+ \
+ typedef \
+ typename Grammar::template impl<BOOST_PP_CAT(e, N), State, Data>::result_type \
+ BOOST_PP_CAT(r, N); \
+ /**/
 
- }}
+ #define BOOST_PROTO_DEFAULT_EVAL(Z, N, DATA) \
+ typename Grammar::template impl<BOOST_PP_CAT(e, N), State, Data>()( \
+ proto::child_c<N>(DATA), s, d \
+ ) \
+ /**/
+
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 1>
+ : transform_impl<Expr, State, Data>
+ {
+ BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
 
- #endif
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
 
-#else
+ typedef
+ typename BOOST_PROTO_RESULT_OF<function_type()>::type
+ result_type;
 
- #define N BOOST_PP_ITERATION()
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)();
+ }
+ };
 
         template<typename Grammar, typename Expr, typename State, typename Data>
- struct default_function_impl<Grammar, Expr, State, Data, N>
+ struct default_function_impl<Grammar, Expr, State, Data, 2>
           : transform_impl<Expr, State, Data>
         {
- BOOST_PP_REPEAT(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr)
+ BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
+ BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 1, Expr)
 
             typedef
                 typename proto::detail::result_of_fixup<r0>::type
             function_type;
 
             typedef
- typename BOOST_PROTO_RESULT_OF<
- function_type(BOOST_PP_ENUM_SHIFTED_PARAMS(N, r))
- >::type
+ typename detail::result_of_<function_type(r1)>::type
             result_type;
 
             result_type operator ()(
@@ -624,7 +513,13 @@
               , typename default_function_impl::data_param d
             ) const
             {
- return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ return this->invoke(
+ e
+ , s
+ , d
+ , is_member_function_pointer<function_type>()
+ , is_member_object_pointer<function_type>()
+ );
             }
 
         private:
@@ -633,11 +528,10 @@
               , typename default_function_impl::state_param s
               , typename default_function_impl::data_param d
               , mpl::false_
+ , mpl::false_
             ) const
             {
- return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)(
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, e)
- );
+ return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)(BOOST_PROTO_DEFAULT_EVAL(~, 1, e));
             }
 
             result_type invoke(
@@ -645,19 +539,60 @@
               , typename default_function_impl::state_param s
               , typename default_function_impl::data_param d
               , mpl::true_
+ , mpl::false_
             ) const
             {
- #define M0(Z, M, DATA) BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA)
                 BOOST_PROTO_USE_GET_POINTER();
                 typedef typename detail::classtypeof<function_type>::type class_type;
                 return (
                     BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                     BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
- )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), M0, e));
- #undef M0
+ )();
+ }
+
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
+ );
             }
         };
 
- #undef N
+ #include <boost/proto/transform/detail/default_function_impl.hpp>
+
+ #undef BOOST_PROTO_DEFAULT_EVAL_TYPE
+ #undef BOOST_PROTO_DEFAULT_EVAL
+ }
+
+ template<typename Grammar /*= detail::_default*/>
+ struct _default
+ : switch_<detail::default_cases<Grammar> >
+ {};
+
+ template<typename Grammar>
+ struct is_callable<_default<Grammar> >
+ : mpl::true_
+ {};
+
+ namespace detail
+ {
+ // Loopy indirection that allows proto::_default<> to be
+ // used without specifying a Grammar argument.
+ struct _default
+ : proto::_default<>
+ {};
+ }
+
+}}
 
 #endif
+

Added: branches/release/boost/proto/transform/detail/call.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/call.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,86 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/call.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_NTH_RESULT_TYPE(Z, M, DATA) \
+ typedef \
+ typename when<_, BOOST_PP_CAT(A, M)>::template impl<Expr, State, Data> \
+ BOOST_PP_CAT(a, M); \
+ typedef typename BOOST_PP_CAT(a, M)::result_type BOOST_PP_CAT(b, M); \
+ /**/
+
+ #define BOOST_PROTO_NTH_RESULT(Z, M, DATA) \
+ detail::as_lvalue(BOOST_PP_CAT(a, M)()(e, s, d)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/call.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file call.hpp
+ /// Contains definition of the call<> transform.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #if BOOST_PROTO_MAX_ARITY > 3
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (4, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/call.hpp>))
+ #include BOOST_PP_ITERATE()
+ #endif
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_NTH_RESULT
+ #undef BOOST_PROTO_NTH_RESULT_TYPE
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \brief Call the PolymorphicFunctionObject \c Fun with the
+ /// current expression, state and data, transformed according
+ /// to \c A0 through \c AN.
+ template<typename Fun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> : transform<call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ BOOST_PP_REPEAT(N, BOOST_PROTO_NTH_RESULT_TYPE, ~)
+
+ typedef detail::poly_function_traits<Fun, Fun(BOOST_PP_ENUM_PARAMS(N, b))> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+ /// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
+ /// for each \c x in <tt>[0,N]</tt>.
+ /// Return <tt>Fun()(a0, a1,... aN)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(BOOST_PP_ENUM(N, BOOST_PROTO_NTH_RESULT, ~));
+ }
+ };
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/construct_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/construct_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,43 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/construct_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/construct_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file construct_funop.hpp
+ /// Overloads of construct_\<\>::operator().
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/construct_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ Type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a)) const
+ {
+ return Type(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/construct_pod_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/construct_pod_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,44 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/construct_pod_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/construct_pod_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file construct_pod_funop.hpp
+ /// Overloads of construct_\<\>::operator().
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/construct_pod_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ Type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a)) const
+ {
+ Type that = {BOOST_PP_ENUM_PARAMS(N, a)};
+ return that;
+ }
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/default_function_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/default_function_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,97 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/default_function_impl.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_DEF_FUN_INVOKE_ARG(Z, M, DATA) \
+ BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/default_function_impl.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file default_function_impl.hpp
+ /// Contains definition of the default_function_impl, the implementation of the
+ /// _default transform for function-like nodes.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/default_function_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEF_FUN_INVOKE_ARG
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, N>
+ : transform_impl<Expr, State, Data>
+ {
+ BOOST_PP_REPEAT(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr)
+
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(BOOST_PP_ENUM_SHIFTED_PARAMS(N, r))
+ >::type
+ result_type;
+
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)(
+ BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, e)
+ );
+ }
+
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
+ )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEF_FUN_INVOKE_ARG, e));
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/fold_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/fold_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,143 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/fold_impl.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_CHILD_N_TYPE(N) \
+ BOOST_PP_CAT(proto_child, N) \
+ /**/
+
+ #define BOOST_PROTO_FOLD_STATE_TYPE(Z, N, DATA) \
+ typedef \
+ typename when<_, Fun>::template impl< \
+ typename result_of::child_c<Expr, N>::type \
+ , BOOST_PP_CAT(state, N) \
+ , Data \
+ >::result_type \
+ BOOST_PP_CAT(state, BOOST_PP_INC(N)); \
+ /**/
+
+ #define BOOST_PROTO_FOLD_STATE(Z, N, DATA) \
+ BOOST_PP_CAT(state, BOOST_PP_INC(N)) \
+ BOOST_PP_CAT(s, BOOST_PP_INC(N)) \
+ = typename when<_, Fun>::template impl< \
+ typename result_of::child_c<Expr, N>::type \
+ , BOOST_PP_CAT(state, N) \
+ , Data \
+ >()( \
+ proto::child_c<N>(e) \
+ , BOOST_PP_CAT(s, N) \
+ , d \
+ ); \
+ /**/
+
+ #define BOOST_PROTO_REVERSE_FOLD_STATE_TYPE(Z, N, DATA) \
+ typedef \
+ typename when<_, Fun>::template impl< \
+ typename result_of::child_c< \
+ Expr \
+ , BOOST_PP_SUB(DATA, BOOST_PP_INC(N)) \
+ >::type \
+ , BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, N)) \
+ , Data \
+ >::result_type \
+ BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, BOOST_PP_INC(N))); \
+ /**/
+
+ #define BOOST_PROTO_REVERSE_FOLD_STATE(Z, N, DATA) \
+ BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, BOOST_PP_INC(N))) \
+ BOOST_PP_CAT(s, BOOST_PP_SUB(DATA, BOOST_PP_INC(N))) \
+ = typename when<_, Fun>::template impl< \
+ typename result_of::child_c< \
+ Expr \
+ , BOOST_PP_SUB(DATA, BOOST_PP_INC(N)) \
+ >::type \
+ , BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, N)) \
+ , Data \
+ >()( \
+ proto::child_c<BOOST_PP_SUB(DATA, BOOST_PP_INC(N))>(e) \
+ , BOOST_PP_CAT(s, BOOST_PP_SUB(DATA, N)) \
+ , d \
+ ); \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/fold_impl.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file fold_impl.hpp
+ /// Contains definition of fold_impl<> and reverse_fold_impl<> templates.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/fold_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_REVERSE_FOLD_STATE
+ #undef BOOST_PROTO_REVERSE_FOLD_STATE_TYPE
+ #undef BOOST_PROTO_FOLD_STATE
+ #undef BOOST_PROTO_FOLD_STATE_TYPE
+ #undef BOOST_PROTO_CHILD_N_TYPE
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, N>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ BOOST_PP_REPEAT(N, BOOST_PROTO_FOLD_STATE_TYPE, N)
+ typedef BOOST_PP_CAT(state, N) result_type;
+
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ BOOST_PP_REPEAT(N, BOOST_PROTO_FOLD_STATE, N)
+ return BOOST_PP_CAT(s, N);
+ }
+ };
+
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, N>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type BOOST_PP_CAT(state, N);
+ BOOST_PP_REPEAT(N, BOOST_PROTO_REVERSE_FOLD_STATE_TYPE, N)
+ typedef state0 result_type;
+
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ BOOST_PP_CAT(state, N) BOOST_PP_CAT(s, N) =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ BOOST_PP_REPEAT(N, BOOST_PROTO_REVERSE_FOLD_STATE, N)
+ return s0;
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/lazy.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/lazy.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,58 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/lazy.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/lazy.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file lazy.hpp
+ /// Contains definition of the lazy<> transform.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/lazy.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
+ /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
+ ///
+ /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
+ /// transform to be applied depends on the current state of the
+ /// transformation. The invocation of the <tt>make\<\></tt> transform
+ /// evaluates any nested transforms, and the resulting type is treated
+ /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
+ template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))>
+ : transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (BOOST_PP_ENUM_PARAMS(N, A))
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/make.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/make.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,174 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/make.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_MAKE_IF(Z, M, DATA) \
+ make_if_<BOOST_PP_CAT(A, M), Expr, State, Data> \
+ /**/
+
+ #define BOOST_PROTO_MAKE_IF_TYPE(Z, M, DATA) \
+ typename BOOST_PROTO_MAKE_IF(Z, M, DATA) ::type \
+ /**/
+
+ #define BOOST_PROTO_MAKE_IF_APPLIED(Z, M, DATA) \
+ BOOST_PROTO_MAKE_IF(Z, M, DATA) ::applied || \
+ /**/
+
+ #define BOOST_PROTO_CONSTRUCT_ARG(Z, M, DATA) \
+ detail::as_lvalue( \
+ typename when<_, BOOST_PP_CAT(A, M)>::template impl<Expr, State, Data>()(e, s, d) \
+ ) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make.hpp
+ /// Contains definition of the make<> transform.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/make.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_CONSTRUCT_ARG
+ #undef BOOST_PROTO_MAKE_IF_APPLIED
+ #undef BOOST_PROTO_MAKE_IF_TYPE
+ #undef BOOST_PROTO_MAKE_IF
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ namespace detail
+ {
+ #if N > 0
+
+ template<
+ template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class R
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<BOOST_PP_ENUM_PARAMS(N, A)>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(N)
+ >
+ : nested_type_if<
+ R<BOOST_PP_ENUM(N, BOOST_PROTO_MAKE_IF_TYPE, ~)>
+ , (BOOST_PP_REPEAT(N, BOOST_PROTO_MAKE_IF_APPLIED, ~) false)
+ >
+ {};
+
+ template<
+ template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class R
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<BOOST_PP_ENUM_PARAMS(N, A)> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<BOOST_PP_ENUM(N, BOOST_PROTO_MAKE_IF_TYPE, ~)> type;
+ static bool const applied = true;
+ };
+
+ #endif
+
+ template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct is_applyable<R(BOOST_PP_ENUM_PARAMS(N, A))>
+ : mpl::true_
+ {};
+
+ template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct is_applyable<R(*)(BOOST_PP_ENUM_PARAMS(N, A))>
+ : mpl::true_
+ {};
+
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, N>, true>
+ {
+ typedef proto::expr<T, A, N> result_type;
+
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), typename A)>
+ result_type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_MAX(N, 1), A, &a)) const
+ {
+ return result_type::make(BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), a));
+ }
+ };
+
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, N>, true>
+ {
+ typedef proto::basic_expr<T, A, N> result_type;
+
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), typename A)>
+ result_type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_MAX(N, 1), A, &a)) const
+ {
+ return result_type::make(BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), a));
+ }
+ };
+
+ template<typename Type BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ Type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a))
+ {
+ return construct_<Type>()(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ } // namespace detail
+
+ /// \brief A PrimitiveTransform which computes a type by evaluating any
+ /// nested transforms and then constructs an object of that type with the
+ /// current expression, state and data, transformed according
+ /// to \c A0 through \c AN.
+ template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make<Object(BOOST_PP_ENUM_PARAMS(N, A))>
+ : transform<make<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ /// \brief <tt>boost::result_of\<make\<Object\>(Expr, State, Data)\>::type</tt>
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+ /// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
+ /// for each \c x in <tt>[0,N]</tt>.
+ /// Return <tt>result_type(a0, a1,... aN)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(BOOST_PP_ENUM(N, BOOST_PROTO_CONSTRUCT_ARG, DATA));
+ }
+ };
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/make_gcc_workaround.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/make_gcc_workaround.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,98 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+ #include <boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp>
+ #endif
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_EXPR_MAKE_ARG(Z, M, DATA) \
+ detail::as_lvalue( \
+ typename when<_, BOOST_PP_CAT(A, M)>::template impl<Expr, State, Data>()(e, s, d) \
+ ) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_gcc_workaround.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_gcc_workaround.hpp
+ /// Special workaround code to make the make\<\> transform work on certain
+ /// versions of gcc.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0) || \
+ (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES))
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/make_gcc_workaround.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #endif
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_EXPR_MAKE_ARG
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ // work around GCC bug
+ template<typename Tag, typename Args, long Arity BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make<proto::expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))>
+ : transform<make<proto::expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ BOOST_PP_ENUM(N, BOOST_PROTO_EXPR_MAKE_ARG, DATA)
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make<proto::basic_expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ BOOST_PP_ENUM(N, BOOST_PROTO_EXPR_MAKE_ARG, DATA)
+ );
+ }
+ };
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/pass_through_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/pass_through_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,95 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/pass_through_impl.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_DEFINE_TRANSFORM_TYPE(Z, N, DATA) \
+ typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
+ typename result_of::child_c<Expr, N>::type \
+ , State \
+ , Data \
+ >::result_type \
+ /**/
+
+ #define BOOST_PROTO_DEFINE_TRANSFORM(Z, N, DATA) \
+ typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
+ typename result_of::child_c<Expr, N>::type \
+ , State \
+ , Data \
+ >()( \
+ e.proto_base().BOOST_PP_CAT(child, N), s, d \
+ ) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/pass_through_impl.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file pass_through_impl.hpp
+ ///
+ /// Specializations of pass_through_impl, used in the implementation of the
+ /// pass_through transform.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/pass_through_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFINE_TRANSFORM
+ #undef BOOST_PROTO_DEFINE_TRANSFORM_TYPE
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, N>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
+ >
+ >::type
+ expr_type;
+
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM, ~)
+ };
+ // Without this, MSVC complains that "that" is uninitialized,
+ // and it actually triggers a runtime check in debug mode when
+ // built with VC8.
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+
+ #undef N
+
+#endif

Added: branches/release/boost/proto/transform/detail/preprocessed/call.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/call.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,217 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file call.hpp
+ /// Contains definition of the call<> transform.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct call<Fun(A0 , A1 , A2 , A3)> : transform<call<Fun(A0 , A1 , A2 , A3)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6; typedef typename when<_, A7>::template impl<Expr, State, Data> a7; typedef typename a7::result_type b7;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)) , detail::as_lvalue(a7()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6; typedef typename when<_, A7>::template impl<Expr, State, Data> a7; typedef typename a7::result_type b7; typedef typename when<_, A8>::template impl<Expr, State, Data> a8; typedef typename a8::result_type b8;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7 , b8)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)) , detail::as_lvalue(a7()(e, s, d)) , detail::as_lvalue(a8()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6; typedef typename when<_, A7>::template impl<Expr, State, Data> a7; typedef typename a7::result_type b7; typedef typename when<_, A8>::template impl<Expr, State, Data> a8; typedef typename a8::result_type b8; typedef typename when<_, A9>::template impl<Expr, State, Data> a9; typedef
 typename a9::result_type b9;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7 , b8 , b9)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)) , detail::as_lvalue(a7()(e, s, d)) , detail::as_lvalue(a8()(e, s, d)) , detail::as_lvalue(a9()(e, s, d)));
+ }
+ };
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/construct_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/construct_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,57 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file construct_funop.hpp
+ /// Overloads of construct_\<\>::operator().
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename A0>
+ Type operator ()(A0 &a0) const
+ {
+ return Type(a0);
+ }
+ template<typename A0 , typename A1>
+ Type operator ()(A0 &a0 , A1 &a1) const
+ {
+ return Type(a0 , a1);
+ }
+ template<typename A0 , typename A1 , typename A2>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2) const
+ {
+ return Type(a0 , a1 , a2);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3) const
+ {
+ return Type(a0 , a1 , a2 , a3);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4) const
+ {
+ return Type(a0 , a1 , a2 , a3 , a4);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5) const
+ {
+ return Type(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6) const
+ {
+ return Type(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7) const
+ {
+ return Type(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8) const
+ {
+ return Type(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8 , A9 &a9) const
+ {
+ return Type(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }

Added: branches/release/boost/proto/transform/detail/preprocessed/construct_pod_funop.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/construct_pod_funop.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,67 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file construct_pod_funop.hpp
+ /// Overloads of construct_\<\>::operator().
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename A0>
+ Type operator ()(A0 &a0) const
+ {
+ Type that = {a0};
+ return that;
+ }
+ template<typename A0 , typename A1>
+ Type operator ()(A0 &a0 , A1 &a1) const
+ {
+ Type that = {a0 , a1};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2) const
+ {
+ Type that = {a0 , a1 , a2};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3) const
+ {
+ Type that = {a0 , a1 , a2 , a3};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4) const
+ {
+ Type that = {a0 , a1 , a2 , a3 , a4};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5) const
+ {
+ Type that = {a0 , a1 , a2 , a3 , a4 , a5};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6) const
+ {
+ Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7) const
+ {
+ Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8) const
+ {
+ Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8};
+ return that;
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8 , A9 &a9) const
+ {
+ Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9};
+ return that;
+ }

Added: branches/release/boost/proto/transform/detail/preprocessed/default_function_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/default_function_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,392 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file default_function_impl.hpp
+ /// Contains definition of the default_function_impl, the implementation of the
+ /// _default transform for function-like nodes.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 3>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 4>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 5>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3; typedef typename result_of::child_c< Expr, 4>::type e4; typedef typename Grammar::template impl<e4, State, Data>::result_type r4;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3 , r4)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 6>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3; typedef typename result_of::child_c< Expr, 4>::type e4; typedef typename Grammar::template impl<e4, State, Data>::result_type r4; typedef typename result_of::child_c< Expr, 5>::type e5; typedef typename Grammar::template impl<e5, State, Data>::result_type r5;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3 , r4 , r5)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 7>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3; typedef typename result_of::child_c< Expr, 4>::type e4; typedef typename Grammar::template impl<e4, State, Data>::result_type r4; typedef typename result_of::child_c< Expr, 5>::type e5; typedef typename Grammar::template impl<e5, State, Data>::result_type r5; typedef typename result_of::child_c< Expr, 6>::type e6; typedef typename Grammar::template impl<e6, State, Data>::result_type r6;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3 , r4 , r5 , r6)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 8>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3; typedef typename result_of::child_c< Expr, 4>::type e4; typedef typename Grammar::template impl<e4, State, Data>::result_type r4; typedef typename result_of::child_c< Expr, 5>::type e5; typedef typename Grammar::template impl<e5, State, Data>::result_type r5; typedef typename result_of::child_c< Expr, 6>::type e6; typedef typename Grammar::template impl<e6, State, Data>::result_type r6; typedef typename result_of::child_c< Expr, 7>::type e7; typedef typename Grammar::template impl<e7, Stat
e, Data>::result_type r7;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3 , r4 , r5 , r6 , r7)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 9>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3; typedef typename result_of::child_c< Expr, 4>::type e4; typedef typename Grammar::template impl<e4, State, Data>::result_type r4; typedef typename result_of::child_c< Expr, 5>::type e5; typedef typename Grammar::template impl<e5, State, Data>::result_type r5; typedef typename result_of::child_c< Expr, 6>::type e6; typedef typename Grammar::template impl<e6, State, Data>::result_type r6; typedef typename result_of::child_c< Expr, 7>::type e7; typedef typename Grammar::template impl<e7, Stat
e, Data>::result_type r7; typedef typename result_of::child_c< Expr, 8>::type e8; typedef typename Grammar::template impl<e8, State, Data>::result_type r8;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3 , r4 , r5 , r6 , r7 , r8)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ));
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct default_function_impl<Grammar, Expr, State, Data, 10>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename result_of::child_c< Expr, 0>::type e0; typedef typename Grammar::template impl<e0, State, Data>::result_type r0; typedef typename result_of::child_c< Expr, 1>::type e1; typedef typename Grammar::template impl<e1, State, Data>::result_type r1; typedef typename result_of::child_c< Expr, 2>::type e2; typedef typename Grammar::template impl<e2, State, Data>::result_type r2; typedef typename result_of::child_c< Expr, 3>::type e3; typedef typename Grammar::template impl<e3, State, Data>::result_type r3; typedef typename result_of::child_c< Expr, 4>::type e4; typedef typename Grammar::template impl<e4, State, Data>::result_type r4; typedef typename result_of::child_c< Expr, 5>::type e5; typedef typename Grammar::template impl<e5, State, Data>::result_type r5; typedef typename result_of::child_c< Expr, 6>::type e6; typedef typename Grammar::template impl<e6, State, Data>::result_type r6; typedef typename result_of::child_c< Expr, 7>::type e7; typedef typename Grammar::template impl<e7, Stat
e, Data>::result_type r7; typedef typename result_of::child_c< Expr, 8>::type e8; typedef typename Grammar::template impl<e8, State, Data>::result_type r8; typedef typename result_of::child_c< Expr, 9>::type e9; typedef typename Grammar::template impl<e9, State, Data>::result_type r9;
+ typedef
+ typename proto::detail::result_of_fixup<r0>::type
+ function_type;
+ typedef
+ typename BOOST_PROTO_RESULT_OF<
+ function_type(r1 , r2 , r3 , r4 , r5 , r6 , r7 , r8 , r9)
+ >::type
+ result_type;
+ result_type operator ()(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ ) const
+ {
+ return this->invoke(e, s, d, is_member_function_pointer<function_type>());
+ }
+ private:
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::false_
+ ) const
+ {
+ return typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )(
+ typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ) , typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ) , typename Grammar::template impl<e9, State, Data>()( proto::child_c< 9>( e), s, d )
+ );
+ }
+ result_type invoke(
+ typename default_function_impl::expr_param e
+ , typename default_function_impl::state_param s
+ , typename default_function_impl::data_param d
+ , mpl::true_
+ ) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ typedef typename detail::classtypeof<function_type>::type class_type;
+ return (
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
+ )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ) , typename Grammar::template impl<e9, State, Data>()( proto::child_c< 9>( e), s, d ));
+ }
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/fold_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/fold_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,387 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file fold_impl.hpp
+ /// Contains definition of fold_impl<> and reverse_fold_impl<> templates.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 1>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1;
+ typedef state1 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d );
+ return s1;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 1>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state1;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state1 s1 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 2>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2;
+ typedef state2 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d );
+ return s2;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 2>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state2;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state2 s2 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 3>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3;
+ typedef state3 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d );
+ return s3;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 3>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state3;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state3 s3 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 4>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4;
+ typedef state4 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d );
+ return s4;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 4>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state4;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state4 s4 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 5>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >::result_type state5;
+ typedef state5 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >()( proto::child_c< 4>(e) , s4 , d );
+ return s5;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 5>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state5;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state5 s5 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >()( proto::child_c<4>(e) , s5 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 6>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >::result_type state6;
+ typedef state6 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >()( proto::child_c< 4>(e) , s4 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >()( proto::child_c< 5>(e) , s5 , d );
+ return s6;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 6>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state6;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state6 s6 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >()( proto::child_c<5>(e) , s6 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >()( proto::child_c<4>(e) , s5 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 7>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >::result_type state7;
+ typedef state7 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >()( proto::child_c< 4>(e) , s4 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >()( proto::child_c< 5>(e) , s5 , d ); state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >()( proto::c
hild_c< 6>(e) , s6 , d );
+ return s7;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 7>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state7;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state7 s7 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >()( proto::child_c<6>(e) , s7 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >()( proto::child_c<5>(e) , s6 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >()( proto::child_c<4>(e) , s5 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Dat
a >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 8>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >::result_type state7; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 7>::type , state7 , Data >::result_typ
e state8;
+ typedef state8 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >()( proto::child_c< 4>(e) , s4 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >()( proto::child_c< 5>(e) , s5 , d ); state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >()( proto::c
hild_c< 6>(e) , s6 , d ); state8 s8 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 7>::type , state7 , Data >()( proto::child_c< 7>(e) , s7 , d );
+ return s8;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 8>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state8;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 7 >::type , state8 , Data >::result_type state7; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , sta
te1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state8 s8 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 7 >::type , state8 , Data >()( proto::child_c<7>(e) , s8 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >()( proto::child_c<6>(e) , s7 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >()( proto::child_c<5>(e) , s6 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >()( proto::child_c<4>(e) , s5 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Dat
a >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 9>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >::result_type state7; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 7>::type , state7 , Data >::result_typ
e state8; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 8>::type , state8 , Data >::result_type state9;
+ typedef state9 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >()( proto::child_c< 4>(e) , s4 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >()( proto::child_c< 5>(e) , s5 , d ); state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >()( proto::c
hild_c< 6>(e) , s6 , d ); state8 s8 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 7>::type , state7 , Data >()( proto::child_c< 7>(e) , s7 , d ); state9 s9 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 8>::type , state8 , Data >()( proto::child_c< 8>(e) , s8 , d );
+ return s9;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 9>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state9;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 8 >::type , state9 , Data >::result_type state8; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 7 >::type , state8 , Data >::result_type state7; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , sta
te2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state9 s9 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state8 s8 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 8 >::type , state9 , Data >()( proto::child_c<8>(e) , s9 , d ); state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 7 >::type , state8 , Data >()( proto::child_c<7>(e) , s8 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >()( proto::child_c<6>(e) , s7 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >()( proto::child_c<5>(e) , s6 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >()( proto::child_c<4>(e) , s5 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Dat
a >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct fold_impl<State0, Fun, Expr, State, Data, 10>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >::result_type state7; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 7>::type , state7 , Data >::result_typ
e state8; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 8>::type , state8 , Data >::result_type state9; typedef typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 9>::type , state9 , Data >::result_type state10;
+ typedef state10 result_type;
+ result_type operator ()(
+ typename fold_impl::expr_param e
+ , typename fold_impl::state_param s
+ , typename fold_impl::data_param d
+ ) const
+ {
+ state0 s0 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 0>::type , state0 , Data >()( proto::child_c< 0>(e) , s0 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 1>::type , state1 , Data >()( proto::child_c< 1>(e) , s1 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 2>::type , state2 , Data >()( proto::child_c< 2>(e) , s2 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 3>::type , state3 , Data >()( proto::child_c< 3>(e) , s3 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 4>::type , state4 , Data >()( proto::child_c< 4>(e) , s4 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 5>::type , state5 , Data >()( proto::child_c< 5>(e) , s5 , d ); state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 6>::type , state6 , Data >()( proto::c
hild_c< 6>(e) , s6 , d ); state8 s8 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 7>::type , state7 , Data >()( proto::child_c< 7>(e) , s7 , d ); state9 s9 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 8>::type , state8 , Data >()( proto::child_c< 8>(e) , s8 , d ); state10 s10 = typename when<_, Fun>::template impl< typename result_of::child_c<Expr, 9>::type , state9 , Data >()( proto::child_c< 9>(e) , s9 , d );
+ return s10;
+ }
+ };
+ template<typename State0, typename Fun, typename Expr, typename State, typename Data>
+ struct reverse_fold_impl<State0, Fun, Expr, State, Data, 10>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state10;
+ typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 9 >::type , state10 , Data >::result_type state9; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 8 >::type , state9 , Data >::result_type state8; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 7 >::type , state8 , Data >::result_type state7; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >::result_type state6; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >::result_type state5; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >::result_type state4; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , Data >::result_type state3; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , st
ate3 , Data >::result_type state2; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >::result_type state1; typedef typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >::result_type state0;
+ typedef state0 result_type;
+ result_type operator ()(
+ typename reverse_fold_impl::expr_param e
+ , typename reverse_fold_impl::state_param s
+ , typename reverse_fold_impl::data_param d
+ ) const
+ {
+ state10 s10 =
+ typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
+ state9 s9 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 9 >::type , state10 , Data >()( proto::child_c<9>(e) , s10 , d ); state8 s8 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 8 >::type , state9 , Data >()( proto::child_c<8>(e) , s9 , d ); state7 s7 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 7 >::type , state8 , Data >()( proto::child_c<7>(e) , s8 , d ); state6 s6 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 6 >::type , state7 , Data >()( proto::child_c<6>(e) , s7 , d ); state5 s5 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 5 >::type , state6 , Data >()( proto::child_c<5>(e) , s6 , d ); state4 s4 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 4 >::type , state5 , Data >()( proto::child_c<4>(e) , s5 , d ); state3 s3 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 3 >::type , state4 , D
ata >()( proto::child_c<3>(e) , s4 , d ); state2 s2 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 2 >::type , state3 , Data >()( proto::child_c<2>(e) , s3 , d ); state1 s1 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 1 >::type , state2 , Data >()( proto::child_c<1>(e) , s2 , d ); state0 s0 = typename when<_, Fun>::template impl< typename result_of::child_c< Expr , 0 >::type , state1 , Data >()( proto::child_c<0>(e) , s1 , d );
+ return s0;
+ }
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/lazy.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/lazy.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,227 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file lazy.hpp
+ /// Contains definition of the lazy<> transform.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+
+
+
+
+
+ template<typename Object >
+ struct lazy<Object()>
+ : transform<lazy<Object()> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ ()
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0>
+ struct lazy<Object(A0)>
+ : transform<lazy<Object(A0)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1>
+ struct lazy<Object(A0 , A1)>
+ : transform<lazy<Object(A0 , A1)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2>
+ struct lazy<Object(A0 , A1 , A2)>
+ : transform<lazy<Object(A0 , A1 , A2)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3>
+ struct lazy<Object(A0 , A1 , A2 , A3)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3 , A4)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3 , A4 , A5)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3 , A4 , A5 , A6)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ (A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)
+ >::template impl<Expr, State, Data>
+ {};
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/make.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/make.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,1056 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make.hpp
+ /// Contains definition of the make<> transform.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ namespace detail
+ {
+ template<typename R >
+ struct is_applyable<R()>
+ : mpl::true_
+ {};
+ template<typename R >
+ struct is_applyable<R(*)()>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 0>, true>
+ {
+ typedef proto::expr<T, A, 0> result_type;
+ template<typename A0>
+ result_type operator ()(A0 &a0) const
+ {
+ return result_type::make(a0);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 0>, true>
+ {
+ typedef proto::basic_expr<T, A, 0> result_type;
+ template<typename A0>
+ result_type operator ()(A0 &a0) const
+ {
+ return result_type::make(a0);
+ }
+ };
+ template<typename Type >
+ Type construct()
+ {
+ return construct_<Type>()();
+ }
+ }
+
+
+
+
+ template<typename Object >
+ struct make<Object()>
+ : transform<make<Object()> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>();
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename> class R
+ , typename A0
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename> class R
+ , typename A0
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0>
+ struct is_applyable<R(A0)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0>
+ struct is_applyable<R(*)(A0)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 1>, true>
+ {
+ typedef proto::expr<T, A, 1> result_type;
+ template<typename A0>
+ result_type operator ()(A0 &a0) const
+ {
+ return result_type::make(a0);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 1>, true>
+ {
+ typedef proto::basic_expr<T, A, 1> result_type;
+ template<typename A0>
+ result_type operator ()(A0 &a0) const
+ {
+ return result_type::make(a0);
+ }
+ };
+ template<typename Type , typename A0>
+ Type construct(A0 &a0)
+ {
+ return construct_<Type>()(a0);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0>
+ struct make<Object(A0)>
+ : transform<make<Object(A0)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename> class R
+ , typename A0 , typename A1
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(2)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename> class R
+ , typename A0 , typename A1
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1>
+ struct is_applyable<R(A0 , A1)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1>
+ struct is_applyable<R(*)(A0 , A1)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 2>, true>
+ {
+ typedef proto::expr<T, A, 2> result_type;
+ template<typename A0 , typename A1>
+ result_type operator ()(A0 &a0 , A1 &a1) const
+ {
+ return result_type::make(a0 , a1);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 2>, true>
+ {
+ typedef proto::basic_expr<T, A, 2> result_type;
+ template<typename A0 , typename A1>
+ result_type operator ()(A0 &a0 , A1 &a1) const
+ {
+ return result_type::make(a0 , a1);
+ }
+ };
+ template<typename Type , typename A0 , typename A1>
+ Type construct(A0 &a0 , A1 &a1)
+ {
+ return construct_<Type>()(a0 , a1);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1>
+ struct make<Object(A0 , A1)>
+ : transform<make<Object(A0 , A1)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(3)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2>
+ struct is_applyable<R(A0 , A1 , A2)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2>
+ struct is_applyable<R(*)(A0 , A1 , A2)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 3>, true>
+ {
+ typedef proto::expr<T, A, 3> result_type;
+ template<typename A0 , typename A1 , typename A2>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2) const
+ {
+ return result_type::make(a0 , a1 , a2);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 3>, true>
+ {
+ typedef proto::basic_expr<T, A, 3> result_type;
+ template<typename A0 , typename A1 , typename A2>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2) const
+ {
+ return result_type::make(a0 , a1 , a2);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2)
+ {
+ return construct_<Type>()(a0 , a1 , a2);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2>
+ struct make<Object(A0 , A1 , A2)>
+ : transform<make<Object(A0 , A1 , A2)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(4)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3>
+ struct is_applyable<R(A0 , A1 , A2 , A3)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 4>, true>
+ {
+ typedef proto::expr<T, A, 4> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 4>, true>
+ {
+ typedef proto::basic_expr<T, A, 4> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make<Object(A0 , A1 , A2 , A3)>
+ : transform<make<Object(A0 , A1 , A2 , A3)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3 , A4>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(5)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || make_if_<A4, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3 , A4> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct is_applyable<R(A0 , A1 , A2 , A3 , A4)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3 , A4)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 5>, true>
+ {
+ typedef proto::expr<T, A, 5> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 5>, true>
+ {
+ typedef proto::basic_expr<T, A, 5> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3 , a4);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make<Object(A0 , A1 , A2 , A3 , A4)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3 , A4 , A5>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(6)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || make_if_<A4, Expr, State, Data> ::applied || make_if_<A5, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3 , A4 , A5> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct is_applyable<R(A0 , A1 , A2 , A3 , A4 , A5)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3 , A4 , A5)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 6>, true>
+ {
+ typedef proto::expr<T, A, 6> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 6>, true>
+ {
+ typedef proto::basic_expr<T, A, 6> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3 , A4 , A5 , A6>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(7)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || make_if_<A4, Expr, State, Data> ::applied || make_if_<A5, Expr, State, Data> ::applied || make_if_<A6, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3 , A4 , A5 , A6> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct is_applyable<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 7>, true>
+ {
+ typedef proto::expr<T, A, 7> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 7>, true>
+ {
+ typedef proto::basic_expr<T, A, 7> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(8)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type , typename make_if_<A7, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || make_if_<A4, Expr, State, Data> ::applied || make_if_<A5, Expr, State, Data> ::applied || make_if_<A6, Expr, State, Data> ::applied || make_if_<A7, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type , typename make_if_<A7, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct is_applyable<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 8>, true>
+ {
+ typedef proto::expr<T, A, 8> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 8>, true>
+ {
+ typedef proto::basic_expr<T, A, 8> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(9)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type , typename make_if_<A7, Expr, State, Data> ::type , typename make_if_<A8, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || make_if_<A4, Expr, State, Data> ::applied || make_if_<A5, Expr, State, Data> ::applied || make_if_<A6, Expr, State, Data> ::applied || make_if_<A7, Expr, State, Data> ::applied || make_if_<A8, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type , typename make_if_<A7, Expr, State, Data> ::type , typename make_if_<A8, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct is_applyable<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 9>, true>
+ {
+ typedef proto::expr<T, A, 9> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 9>, true>
+ {
+ typedef proto::basic_expr<T, A, 9> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A8>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };
+ namespace detail
+ {
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ R<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(10)
+ >
+ : nested_type_if<
+ R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type , typename make_if_<A7, Expr, State, Data> ::type , typename make_if_<A8, Expr, State, Data> ::type , typename make_if_<A9, Expr, State, Data> ::type>
+ , (make_if_<A0, Expr, State, Data> ::applied || make_if_<A1, Expr, State, Data> ::applied || make_if_<A2, Expr, State, Data> ::applied || make_if_<A3, Expr, State, Data> ::applied || make_if_<A4, Expr, State, Data> ::applied || make_if_<A5, Expr, State, Data> ::applied || make_if_<A6, Expr, State, Data> ::applied || make_if_<A7, Expr, State, Data> ::applied || make_if_<A8, Expr, State, Data> ::applied || make_if_<A9, Expr, State, Data> ::applied || false)
+ >
+ {};
+ template<
+ template<typename , typename , typename , typename , typename , typename , typename , typename , typename , typename> class R
+ , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9
+ , typename Expr, typename State, typename Data
+ >
+ struct make_<
+ noinvoke<R<A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9> >
+ , Expr, State, Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
+ >
+ {
+ typedef R<typename make_if_<A0, Expr, State, Data> ::type , typename make_if_<A1, Expr, State, Data> ::type , typename make_if_<A2, Expr, State, Data> ::type , typename make_if_<A3, Expr, State, Data> ::type , typename make_if_<A4, Expr, State, Data> ::type , typename make_if_<A5, Expr, State, Data> ::type , typename make_if_<A6, Expr, State, Data> ::type , typename make_if_<A7, Expr, State, Data> ::type , typename make_if_<A8, Expr, State, Data> ::type , typename make_if_<A9, Expr, State, Data> ::type> type;
+ static bool const applied = true;
+ };
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct is_applyable<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : mpl::true_
+ {};
+ template<typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct is_applyable<R(*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : mpl::true_
+ {};
+ template<typename T, typename A>
+ struct construct_<proto::expr<T, A, 10>, true>
+ {
+ typedef proto::expr<T, A, 10> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8 , A9 &a9) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }
+ };
+ template<typename T, typename A>
+ struct construct_<proto::basic_expr<T, A, 10>, true>
+ {
+ typedef proto::basic_expr<T, A, 10> result_type;
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ result_type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8 , A9 &a9) const
+ {
+ return result_type::make(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }
+ };
+ template<typename Type , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ Type construct(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8 , A9 &a9)
+ {
+ return construct_<Type>()(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }
+ }
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ proto::detail::ignore_unused(e);
+ proto::detail::ignore_unused(s);
+ proto::detail::ignore_unused(d);
+ return detail::construct<result_type>(detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A8>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A9>::template impl<Expr, State, Data>()(e, s, d) ));
+ }
+ };
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,459 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_gcc_workaround.hpp
+ /// Special workaround code to make the make\<\> transform work on certain
+ /// versions of gcc.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+ template<typename Tag, typename Args, long Arity >
+ struct make<proto::expr<Tag, Args, Arity>()>
+ : transform<make<proto::expr<Tag, Args, Arity>()> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity >
+ struct make<proto::basic_expr<Tag, Args, Arity>()>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>()> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0>
+ struct make<proto::expr<Tag, Args, Arity>(A0)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A8>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A8>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : transform<make<proto::expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A8>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A9>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };
+ template<typename Tag, typename Args, long Arity , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : transform<make<proto::basic_expr<Tag, Args, Arity>(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return proto::basic_expr<Tag, Args, Arity>::make(
+ detail::as_lvalue( typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A3>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A4>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A5>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A6>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A7>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A8>::template impl<Expr, State, Data>()(e, s, d) ) , detail::as_lvalue( typename when<_, A9>::template impl<Expr, State, Data>()(e, s, d) )
+ );
+ }
+ };
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,329 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file pass_through_impl.hpp
+ ///
+ /// Specializations of pass_through_impl, used in the implementation of the
+ /// pass_through transform.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 1>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list1<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 2>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list2<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 3>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list3<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 4>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list4<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 5>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list5<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 6>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list6<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 7>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list7<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 8>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list8<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type , typename Grammar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d ) , typename Gra
mmar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >()( e.proto_base().child7, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 9>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list9<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type , typename Grammar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >::result_type , typename Grammar::proto_ch
ild8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d ) , typename Gra
mmar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >()( e.proto_base().child7, s, d ) , typename Grammar::proto_child8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >()( e.proto_base().child8, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 10>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list10<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type , typename Grammar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >::result_type , typename Grammar::proto_ch
ild8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >::result_type , typename Grammar::proto_child9::template impl< typename result_of::child_c<Expr, 9>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d ) , typename Gra
mmar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >()( e.proto_base().child7, s, d ) , typename Grammar::proto_child8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >()( e.proto_base().child8, s, d ) , typename Grammar::proto_child9::template impl< typename result_of::child_c<Expr, 9>::type , State , Data >()( e.proto_base().child9, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };

Added: branches/release/boost/proto/transform/detail/preprocessed/when.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/preprocessed/when.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,744 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file when.hpp
+ /// Definition of when transform.
+ //
+ // Copyright 2008 Eric Niebler. 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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R >
+ struct when<Grammar, R()>
+ : transform<when<Grammar, R()> >
+ {
+ typedef Grammar first;
+ typedef R second();
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R()>
+ , make<R()>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0>
+ struct when<Grammar, R(A0)>
+ : transform<when<Grammar, R(A0)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0)>
+ , make<R(A0)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1>
+ struct when<Grammar, R(A0 , A1)>
+ : transform<when<Grammar, R(A0 , A1)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1)>
+ , make<R(A0 , A1)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2>
+ struct when<Grammar, R(A0 , A1 , A2)>
+ : transform<when<Grammar, R(A0 , A1 , A2)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2)>
+ , make<R(A0 , A1 , A2)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3>
+ struct when<Grammar, R(A0 , A1 , A2 , A3)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3)>
+ , make<R(A0 , A1 , A2 , A3)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4)>
+ , make<R(A0 , A1 , A2 , A3 , A4)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };

Added: branches/release/boost/proto/transform/detail/when.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/proto/transform/detail/when.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,109 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/when.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/when.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file when.hpp
+ /// Definition of when transform.
+ //
+ // Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/when.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \brief A grammar element and a PrimitiveTransform that associates
+ /// a transform with the grammar.
+ ///
+ /// Use <tt>when\<\></tt> to override a grammar's default transform
+ /// with a custom transform. It is for used when composing larger
+ /// transforms by associating smaller transforms with individual
+ /// rules in your grammar, as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
+ /// CallableTransform or an ObjectTransform as its second parameter.
+ /// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
+ /// distinguish between the two, and uses <tt>call\<\></tt> to
+ /// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
+ /// ObjectTransforms.
+ template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
+ : transform<when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ typedef Grammar first;
+ typedef R second(BOOST_PP_ENUM_PARAMS(N, A));
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+ // Note: do not evaluate is_callable<R> in this scope.
+ // R may be an incomplete type at this point.
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ // OK to evaluate is_callable<R> here. R should be compete by now.
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is a function to call
+ , make<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is an object to construct
+ >::type
+ which;
+
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+ /// Evaluate <tt>R(A0,A1,...)</tt> as a transform either with
+ /// <tt>call\<\></tt> or with <tt>make\<\></tt> depending on
+ /// whether <tt>is_callable\<R\>::value</tt> is \c true or
+ /// \c false.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ /// \pre <tt>matches\<Expr, Grammar\>::value</tt> is \c true
+ /// \return <tt>which()(e, s, d)</tt>
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+ #undef N
+
+#endif

Modified: branches/release/boost/proto/transform/fold.hpp
==============================================================================
--- branches/release/boost/proto/transform/fold.hpp (original)
+++ branches/release/boost/proto/transform/fold.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,338 +1,250 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file fold.hpp
- /// Contains definition of the fold<> and reverse_fold<> transforms.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_FOLD_HPP_EAN_11_04_2007
- #define BOOST_PROTO_TRANSFORM_FOLD_HPP_EAN_11_04_2007
-
- #include <boost/version.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/fusion/include/fold.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/fusion.hpp>
- #include <boost/proto/functional/fusion/reverse.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/call.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file fold.hpp
+/// Contains definition of the fold<> and reverse_fold<> transforms.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_FOLD_HPP_EAN_11_04_2007
+#define BOOST_PROTO_TRANSFORM_FOLD_HPP_EAN_11_04_2007
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/fusion/include/fold.hpp>
+#include <boost/fusion/include/reverse_fold.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/transform/when.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
+ template<typename Transform, typename Data>
+ struct as_callable
         {
- template<typename Transform, typename Data>
- struct as_callable
- {
- as_callable(Data d)
- : d_(d)
- {}
-
- template<typename Sig>
- struct result;
-
- #if BOOST_VERSION >= 104200
-
- template<typename This, typename State, typename Expr>
- struct result<This(State, Expr)>
- {
- typedef
- typename when<_, Transform>::template impl<Expr, State, Data>::result_type
- type;
- };
-
- template<typename State, typename Expr>
- typename when<_, Transform>::template impl<Expr &, State const &, Data>::result_type
- operator ()(State const &s, Expr &e) const
- {
- return typename when<_, Transform>::template impl<Expr &, State const &, Data>()(e, s, this->d_);
- }
-
- #else
-
- template<typename This, typename Expr, typename State>
- struct result<This(Expr, State)>
- {
- typedef
- typename when<_, Transform>::template impl<Expr, State, Data>::result_type
- type;
- };
-
- template<typename Expr, typename State>
- typename when<_, Transform>::template impl<Expr &, State const &, Data>::result_type
- operator ()(Expr &e, State const &s) const
- {
- return typename when<_, Transform>::template impl<Expr &, State const &, Data>()(e, s, this->d_);
- }
+ as_callable(Data d)
+ : d_(d)
+ {}
 
- #endif
-
- private:
- Data d_;
- };
+ template<typename Sig>
+ struct result;
 
- template<
- typename State0
- , typename Fun
- , typename Expr
- , typename State
- , typename Data
- , long Arity = arity_of<Expr>::value
- >
- struct fold_impl
- {};
-
- template<
- typename State0
- , typename Fun
- , typename Expr
- , typename State
- , typename Data
- , long Arity = arity_of<Expr>::value
- >
- struct reverse_fold_impl
- {};
-
- #define BOOST_PROTO_CHILD_N_TYPE(N)\
- BOOST_PP_CAT(proto_child, N)\
- /**/
-
- #define BOOST_PROTO_FOLD_STATE_TYPE(Z, N, DATA) \
- typedef \
- typename when<_, Fun>::template impl< \
- typename result_of::child_c<Expr, N>::type \
- , BOOST_PP_CAT(state, N) \
- , Data \
- >::result_type \
- BOOST_PP_CAT(state, BOOST_PP_INC(N)); \
- /**/
-
- #define BOOST_PROTO_FOLD_STATE(Z, N, DATA) \
- BOOST_PP_CAT(state, BOOST_PP_INC(N)) \
- BOOST_PP_CAT(s, BOOST_PP_INC(N)) \
- = typename when<_, Fun>::template impl< \
- typename result_of::child_c<Expr, N>::type \
- , BOOST_PP_CAT(state, N) \
- , Data \
- >()( \
- proto::child_c<N>(e) \
- , BOOST_PP_CAT(s, N) \
- , d \
- ); \
- /**/
-
- #define BOOST_PROTO_REVERSE_FOLD_STATE_TYPE(Z, N, DATA) \
- typedef \
- typename when<_, Fun>::template impl< \
- typename result_of::child_c< \
- Expr \
- , BOOST_PP_SUB(DATA, BOOST_PP_INC(N)) \
- >::type \
- , BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, N)) \
- , Data \
- >::result_type \
- BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, BOOST_PP_INC(N))); \
- /**/
-
- #define BOOST_PROTO_REVERSE_FOLD_STATE(Z, N, DATA) \
- BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, BOOST_PP_INC(N))) \
- BOOST_PP_CAT(s, BOOST_PP_SUB(DATA, BOOST_PP_INC(N))) \
- = typename when<_, Fun>::template impl< \
- typename result_of::child_c< \
- Expr \
- , BOOST_PP_SUB(DATA, BOOST_PP_INC(N)) \
- >::type \
- , BOOST_PP_CAT(state, BOOST_PP_SUB(DATA, N)) \
- , Data \
- >()( \
- proto::child_c<BOOST_PP_SUB(DATA, BOOST_PP_INC(N))>(e) \
- , BOOST_PP_CAT(s, BOOST_PP_SUB(DATA, N)) \
- , d \
- ); \
- /**/
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/fold.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_REVERSE_FOLD_STATE
- #undef BOOST_PROTO_REVERSE_FOLD_STATE_TYPE
- #undef BOOST_PROTO_FOLD_STATE
- #undef BOOST_PROTO_FOLD_STATE_TYPE
- #undef BOOST_PROTO_CHILD_N_TYPE
-
- } // namespace detail
-
- /// \brief A PrimitiveTransform that invokes the <tt>fusion::fold\<\></tt>
- /// algorithm to accumulate
- template<typename Sequence, typename State0, typename Fun>
- struct fold : transform<fold<Sequence, State0, Fun> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ template<typename This, typename State, typename Expr>
+ struct result<This(State, Expr)>
             {
- /// \brief A Fusion sequence.
- typedef
- typename remove_reference<
- typename when<_, Sequence>::template impl<Expr, State, Data>::result_type
- >::type
- sequence;
-
- /// \brief An initial state for the fold.
                 typedef
- typename remove_reference<
- typename when<_, State0>::template impl<Expr, State, Data>::result_type
- >::type
- state0;
+ typename when<_, Transform>::template impl<Expr, State, Data>::result_type
+ type;
+ };
 
- /// \brief <tt>fun(d)(e,s) == when\<_,Fun\>()(e,s,d)</tt>
- typedef
- detail::as_callable<Fun, Data>
- fun;
+ template<typename State, typename Expr>
+ typename when<_, Transform>::template impl<Expr &, State const &, Data>::result_type
+ operator ()(State const &s, Expr &e) const
+ {
+ return typename when<_, Transform>::template impl<Expr &, State const &, Data>()(e, s, this->d_);
+ }
 
- typedef
- typename fusion::result_of::fold<
- sequence
- , state0
- , fun
- >::type
- result_type;
-
- /// Let \c seq be <tt>when\<_, Sequence\>()(e, s, d)</tt>, let
- /// \c state0 be <tt>when\<_, State0\>()(e, s, d)</tt>, and
- /// let \c fun(d) be an object such that <tt>fun(d)(e, s)</tt>
- /// is equivalent to <tt>when\<_, Fun\>()(e, s, d)</tt>. Then, this
- /// function returns <tt>fusion::fold(seq, state0, fun(d))</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- typename when<_, Sequence>::template impl<Expr, State, Data> seq;
- detail::as_callable<Fun, Data> f(d);
- return fusion::fold(
- seq(e, s, d)
- , typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d)
- , f
- );
- }
- };
+ private:
+ Data d_;
         };
 
- /// \brief A PrimitiveTransform that is the same as the
- /// <tt>fold\<\></tt> transform, except that it folds
- /// back-to-front instead of front-to-back. It uses
- /// the \c _reverse callable PolymorphicFunctionObject
- /// to create a <tt>fusion::reverse_view\<\></tt> of the
- /// sequence before invoking <tt>fusion::fold\<\></tt>.
- template<typename Sequence, typename State0, typename Fun>
- struct reverse_fold
- : fold<call<_reverse(Sequence)>, State0, Fun>
+ template<
+ typename State0
+ , typename Fun
+ , typename Expr
+ , typename State
+ , typename Data
+ , long Arity = arity_of<Expr>::value
+ >
+ struct fold_impl
         {};
 
- // This specialization is only for improved compile-time performance
- // in the commom case when the Sequence transform is \c proto::_.
- //
- /// INTERNAL ONLY
- ///
- template<typename State0, typename Fun>
- struct fold<_, State0, Fun> : transform<fold<_, State0, Fun> >
+ template<
+ typename State0
+ , typename Fun
+ , typename Expr
+ , typename State
+ , typename Data
+ , long Arity = arity_of<Expr>::value
+ >
+ struct reverse_fold_impl
+ {};
+
+ #include <boost/proto/transform/detail/fold_impl.hpp>
+
+ } // namespace detail
+
+ /// \brief A PrimitiveTransform that invokes the <tt>fusion::fold\<\></tt>
+ /// algorithm to accumulate
+ template<typename Sequence, typename State0, typename Fun>
+ struct fold : transform<fold<Sequence, State0, Fun> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::fold_impl<State0, Fun, Expr, State, Data>
- {};
+ /// \brief A Fusion sequence.
+ typedef
+ typename remove_reference<
+ typename when<_, Sequence>::template impl<Expr, State, Data>::result_type
+ >::type
+ sequence;
+
+ /// \brief An initial state for the fold.
+ typedef
+ typename remove_reference<
+ typename when<_, State0>::template impl<Expr, State, Data>::result_type
+ >::type
+ state0;
+
+ /// \brief <tt>fun(d)(e,s) == when\<_,Fun\>()(e,s,d)</tt>
+ typedef
+ detail::as_callable<Fun, Data>
+ fun;
+
+ typedef
+ typename fusion::result_of::fold<
+ sequence
+ , state0
+ , fun
+ >::type
+ result_type;
+
+ /// Let \c seq be <tt>when\<_, Sequence\>()(e, s, d)</tt>, let
+ /// \c state0 be <tt>when\<_, State0\>()(e, s, d)</tt>, and
+ /// let \c fun(d) be an object such that <tt>fun(d)(e, s)</tt>
+ /// is equivalent to <tt>when\<_, Fun\>()(e, s, d)</tt>. Then, this
+ /// function returns <tt>fusion::fold(seq, state0, fun(d))</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typename when<_, Sequence>::template impl<Expr, State, Data> seq;
+ detail::as_callable<Fun, Data> f(d);
+ return fusion::fold(
+ seq(e, s, d)
+ , typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d)
+ , f
+ );
+ }
         };
+ };
 
- // This specialization is only for improved compile-time performance
- // in the commom case when the Sequence transform is \c proto::_.
- //
- /// INTERNAL ONLY
- ///
- template<typename State0, typename Fun>
- struct reverse_fold<_, State0, Fun> : transform<reverse_fold<_, State0, Fun> >
+ /// \brief A PrimitiveTransform that is the same as the
+ /// <tt>fold\<\></tt> transform, except that it folds
+ /// back-to-front instead of front-to-back.
+ template<typename Sequence, typename State0, typename Fun>
+ struct reverse_fold : transform<reverse_fold<Sequence, State0, Fun> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::reverse_fold_impl<State0, Fun, Expr, State, Data>
- {};
+ /// \brief A Fusion sequence.
+ typedef
+ typename remove_reference<
+ typename when<_, Sequence>::template impl<Expr, State, Data>::result_type
+ >::type
+ sequence;
+
+ /// \brief An initial state for the fold.
+ typedef
+ typename remove_reference<
+ typename when<_, State0>::template impl<Expr, State, Data>::result_type
+ >::type
+ state0;
+
+ /// \brief <tt>fun(d)(e,s) == when\<_,Fun\>()(e,s,d)</tt>
+ typedef
+ detail::as_callable<Fun, Data>
+ fun;
+
+ typedef
+ typename fusion::result_of::reverse_fold<
+ sequence
+ , state0
+ , fun
+ >::type
+ result_type;
+
+ /// Let \c seq be <tt>when\<_, Sequence\>()(e, s, d)</tt>, let
+ /// \c state0 be <tt>when\<_, State0\>()(e, s, d)</tt>, and
+ /// let \c fun(d) be an object such that <tt>fun(d)(e, s)</tt>
+ /// is equivalent to <tt>when\<_, Fun\>()(e, s, d)</tt>. Then, this
+ /// function returns <tt>fusion::fold(seq, state0, fun(d))</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typename when<_, Sequence>::template impl<Expr, State, Data> seq;
+ detail::as_callable<Fun, Data> f(d);
+ return fusion::reverse_fold(
+ seq(e, s, d)
+ , typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d)
+ , f
+ );
+ }
         };
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename Sequence, typename State, typename Fun>
- struct is_callable<fold<Sequence, State, Fun> >
- : mpl::true_
+ // This specialization is only for improved compile-time performance
+ // in the commom case when the Sequence transform is \c proto::_.
+ //
+ /// INTERNAL ONLY
+ ///
+ template<typename State0, typename Fun>
+ struct fold<_, State0, Fun> : transform<fold<_, State0, Fun> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::fold_impl<State0, Fun, Expr, State, Data>
         {};
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename Sequence, typename State, typename Fun>
- struct is_callable<reverse_fold<Sequence, State, Fun> >
- : mpl::true_
+ // This specialization is only for improved compile-time performance
+ // in the commom case when the Sequence transform is \c proto::_.
+ //
+ /// INTERNAL ONLY
+ ///
+ template<typename State0, typename Fun>
+ struct reverse_fold<_, State0, Fun> : transform<reverse_fold<_, State0, Fun> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::reverse_fold_impl<State0, Fun, Expr, State, Data>
         {};
+ };
 
- }}
-
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
-
- template<typename State0, typename Fun, typename Expr, typename State, typename Data>
- struct fold_impl<State0, Fun, Expr, State, Data, N>
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type state0;
- BOOST_PP_REPEAT(N, BOOST_PROTO_FOLD_STATE_TYPE, N)
- typedef BOOST_PP_CAT(state, N) result_type;
-
- result_type operator ()(
- typename fold_impl::expr_param e
- , typename fold_impl::state_param s
- , typename fold_impl::data_param d
- ) const
- {
- state0 s0 =
- typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
- BOOST_PP_REPEAT(N, BOOST_PROTO_FOLD_STATE, N)
- return BOOST_PP_CAT(s, N);
- }
- };
-
- template<typename State0, typename Fun, typename Expr, typename State, typename Data>
- struct reverse_fold_impl<State0, Fun, Expr, State, Data, N>
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, State0>::template impl<Expr, State, Data>::result_type BOOST_PP_CAT(state, N);
- BOOST_PP_REPEAT(N, BOOST_PROTO_REVERSE_FOLD_STATE_TYPE, N)
- typedef state0 result_type;
-
- result_type operator ()(
- typename reverse_fold_impl::expr_param e
- , typename reverse_fold_impl::state_param s
- , typename reverse_fold_impl::data_param d
- ) const
- {
- BOOST_PP_CAT(state, N) BOOST_PP_CAT(s, N) =
- typename when<_, State0>::template impl<Expr, State, Data>()(e, s, d);
- BOOST_PP_REPEAT(N, BOOST_PROTO_REVERSE_FOLD_STATE, N)
- return s0;
- }
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename Sequence, typename State, typename Fun>
+ struct is_callable<fold<Sequence, State, Fun> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Sequence, typename State, typename Fun>
+ struct is_callable<reverse_fold<Sequence, State, Fun> >
+ : mpl::true_
+ {};
 
- #undef N
+}}
 
 #endif

Modified: branches/release/boost/proto/transform/lazy.hpp
==============================================================================
--- branches/release/boost/proto/transform/lazy.hpp (original)
+++ branches/release/boost/proto/transform/lazy.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,83 +1,52 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file lazy.hpp
- /// Contains definition of the lazy<> transform.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
- #define BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
-
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/transform/make.hpp>
- #include <boost/proto/transform/call.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file lazy.hpp
+/// Contains definition of the lazy<> transform.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
+#define BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
+
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/transform/make.hpp>
+#include <boost/proto/transform/call.hpp>
+#include <boost/proto/transform/impl.hpp>
+
+namespace boost { namespace proto
+{
+ /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
+ /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
+ ///
+ /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
+ /// transform to be applied depends on the current state of the
+ /// transformation. The invocation of the <tt>make\<\></tt> transform
+ /// evaluates any nested transforms, and the resulting type is treated
+ /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
+ template<typename Object>
+ struct lazy : transform<lazy<Object> >
     {
- /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
- /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
- ///
- /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
- /// transform to be applied depends on the current state of the
- /// transformation. The invocation of the <tt>make\<\></tt> transform
- /// evaluates any nested transforms, and the resulting type is treated
- /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
- template<typename Object>
- struct lazy : transform<lazy<Object> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : call<
- typename make<Object>::template impl<Expr, State, Data>::result_type
- >::template impl<Expr, State, Data>
- {};
- };
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/lazy.hpp>))
- #include BOOST_PP_ITERATE()
-
- /// INTERNAL ONLY
- ///
- template<typename Object>
- struct is_callable<lazy<Object> >
- : mpl::true_
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename make<Object>::template impl<Expr, State, Data>::result_type
+ >::template impl<Expr, State, Data>
         {};
+ };
 
- }}
-
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
+ #include <boost/proto/transform/detail/lazy.hpp>
 
- /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
- /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
- ///
- /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
- /// transform to be applied depends on the current state of the
- /// transformation. The invocation of the <tt>make\<\></tt> transform
- /// evaluates any nested transforms, and the resulting type is treated
- /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
- template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : call<
- typename make<Object>::template impl<Expr, State, Data>::result_type
- (BOOST_PP_ENUM_PARAMS(N, A))
- >::template impl<Expr, State, Data>
- {};
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename Object>
+ struct is_callable<lazy<Object> >
+ : mpl::true_
+ {};
 
- #undef N
+}}
 
 #endif

Modified: branches/release/boost/proto/transform/make.hpp
==============================================================================
--- branches/release/boost/proto/transform/make.hpp (original)
+++ branches/release/boost/proto/transform/make.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,472 +1,265 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file make.hpp
- /// Contains definition of the make<> transform.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_MAKE_HPP_EAN_12_02_2007
- #define BOOST_PROTO_TRANSFORM_MAKE_HPP_EAN_12_02_2007
-
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
- #include <boost/preprocessor/repetition/repeat_from_to.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/selection/max.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/mpl/and.hpp>
- #include <boost/mpl/aux_/has_type.hpp>
- #include <boost/mpl/aux_/template_arity.hpp>
- #include <boost/mpl/aux_/lambda_arity_param.hpp>
- #include <boost/utility/result_of.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/args.hpp>
- #include <boost/proto/transform/impl.hpp>
- #include <boost/proto/detail/as_lvalue.hpp>
- #include <boost/proto/detail/ignore_unused.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file make.hpp
+/// Contains definition of the make<> transform.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_MAKE_HPP_EAN_12_02_2007
+#define BOOST_PROTO_TRANSFORM_MAKE_HPP_EAN_12_02_2007
+
+#include <boost/detail/workaround.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/selection/max.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/aux_/has_type.hpp>
+#include <boost/proto/detail/template_arity.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/args.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/detail/as_lvalue.hpp>
+#include <boost/proto/detail/ignore_unused.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
- {
- template<typename T>
- struct is_applyable
- : mpl::and_<is_callable<T>, is_transform<T> >
- {};
-
- template<typename T, bool HasType = mpl::aux::has_type<T>::value>
- struct nested_type
- {
- typedef typename T::type type;
- };
-
- template<typename T>
- struct nested_type<T, false>
- {
- typedef T type;
- };
-
- template<typename T, bool Applied>
- struct nested_type_if
- {
- typedef T type;
- static bool const applied = false;
- };
-
- template<typename T>
- struct nested_type_if<T, true>
- : nested_type<T>
- {
- static bool const applied = true;
- };
-
- template<
- typename R
- , typename Expr, typename State, typename Data
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(long Arity = mpl::aux::template_arity<R>::value)
- >
- struct make_
- {
- typedef R type;
- static bool const applied = false;
- };
-
- template<
- typename R
- , typename Expr, typename State, typename Data
- , bool IsApplyable = is_applyable<R>::value
- >
- struct make_if_
- : make_<R, Expr, State, Data>
- {};
-
- template<typename R, typename Expr, typename State, typename Data>
- struct make_if_<R, Expr, State, Data, true>
- : uncvref<typename when<_, R>::template impl<Expr, State, Data>::result_type>
- {
- static bool const applied = true;
- };
-
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
- // work around GCC bug
- template<typename Tag, typename Args, long N, typename Expr, typename State, typename Data>
- struct make_if_<proto::expr<Tag, Args, N>, Expr, State, Data, false>
- {
- typedef proto::expr<Tag, Args, N> type;
- static bool const applied = false;
- };
-
- // work around GCC bug
- template<typename Tag, typename Args, long N, typename Expr, typename State, typename Data>
- struct make_if_<proto::basic_expr<Tag, Args, N>, Expr, State, Data, false>
- {
- typedef proto::basic_expr<Tag, Args, N> type;
- static bool const applied = false;
- };
- #endif
-
- template<typename Type, bool IsAggregate = is_aggregate<Type>::value>
- struct construct_
- {
- typedef Type result_type;
+ template<typename T>
+ struct is_applyable
+ : mpl::and_<is_callable<T>, is_transform<T> >
+ {};
 
- Type operator ()() const
- {
- return Type();
- }
-
- #define TMP(Z, N, DATA) \
- template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename A)> \
- Type operator ()(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, A, &a)) const \
- { \
- return Type(BOOST_PP_ENUM_PARAMS_Z(Z, N, a)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), TMP, ~)
- #undef TMP
- };
+ template<typename T, bool HasType = mpl::aux::has_type<T>::value>
+ struct nested_type
+ {
+ typedef typename T::type type;
+ };
 
- template<typename Type>
- struct construct_<Type, true>
- {
- typedef Type result_type;
+ template<typename T>
+ struct nested_type<T, false>
+ {
+ typedef T type;
+ };
 
- Type operator ()() const
- {
- return Type();
- }
-
- #define TMP(Z, N, DATA) \
- template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename A)> \
- Type operator ()(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, A, &a)) const \
- { \
- Type that = {BOOST_PP_ENUM_PARAMS_Z(Z, N, a)}; \
- return that; \
- }
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), TMP, ~)
- #undef TMP
- };
-
- #define TMP(Z, N, DATA) \
- template<typename Type BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, typename A)> \
- Type construct(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, A, &a)) \
- { \
- return construct_<Type>()(BOOST_PP_ENUM_PARAMS_Z(Z, N, a)); \
- }
- BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, TMP, ~)
- #undef TMP
- }
-
- /// \brief A PrimitiveTransform which prevents another PrimitiveTransform
- /// from being applied in an \c ObjectTransform.
- ///
- /// When building higher order transforms with <tt>make\<\></tt> or
- /// <tt>lazy\<\></tt>, you sometimes would like to build types that
- /// are parameterized with Proto transforms. In such lambda-style
- /// transforms, Proto will unhelpfully find all nested transforms
- /// and apply them, even if you don't want them to be applied. Consider
- /// the following transform, which will replace the \c _ in
- /// <tt>Bar<_>()</tt> with <tt>proto::terminal\<int\>::type</tt>:
- ///
- /// \code
- /// template<typename T>
- /// struct Bar
- /// {};
- ///
- /// struct Foo
- /// : proto::when<_, Bar<_>() >
- /// {};
- ///
- /// proto::terminal<int>::type i = {0};
- ///
- /// int main()
- /// {
- /// Foo()(i);
- /// std::cout << typeid(Foo()(i)).name() << std::endl;
- /// }
- /// \endcode
- ///
- /// If you actually wanted to default-construct an object of type
- /// <tt>Bar\<_\></tt>, you would have to protect the \c _ to prevent
- /// it from being applied. You can use <tt>proto::protect\<\></tt>
- /// as follows:
- ///
- /// \code
- /// // OK: replace anything with Bar<_>()
- /// struct Foo
- /// : proto::when<_, Bar<protect<_> >() >
- /// {};
- /// \endcode
- template<typename PrimitiveTransform>
- struct protect : transform<protect<PrimitiveTransform> >
+ template<typename T, bool Applied>
+ struct nested_type_if
         {
- template<typename, typename, typename>
- struct impl
- {
- typedef PrimitiveTransform result_type;
- };
+ typedef T type;
+ static bool const applied = false;
         };
 
- /// \brief A PrimitiveTransform which computes a type by evaluating any
- /// nested transforms and then constructs an object of that type.
- ///
- /// The <tt>make\<\></tt> transform checks to see if \c Object is a template.
- /// If it is, the template type is disassembled to find nested transforms.
- /// Proto considers the following types to represent transforms:
- ///
- /// \li Function types
- /// \li Function pointer types
- /// \li Types for which <tt>proto::is_callable\< type \>::value</tt> is \c true
- ///
- /// <tt>boost::result_of\<make\<T\<X0,X1,...\> \>(Expr, State, Data)\>::type</tt>
- /// is evaluated as follows. For each \c X in <tt>X0,X1,...</tt>, do:
- ///
- /// \li If \c X is a template like <tt>U\<Y0,Y1,...\></tt>, then let <tt>X'</tt>
- /// be <tt>boost::result_of\<make\<U\<Y0,Y1,...\> \>(Expr, State, Data)\>::type</tt>
- /// (which evaluates this procedure recursively). Note whether any
- /// substitutions took place during this operation.
- /// \li Otherwise, if \c X is a transform, then let <tt>X'</tt> be
- /// <tt>boost::result_of\<when\<_, X\>(Expr, State, Data)\>::type</tt>.
- /// Note that a substitution took place.
- /// \li Otherwise, let <tt>X'</tt> be \c X, and note that no substitution
- /// took place.
- /// \li If any substitutions took place in any of the above steps and
- /// <tt>T\<X0',X1',...\></tt> has a nested <tt>::type</tt> typedef,
- /// the result type is <tt>T\<X0',X1',...\>::type</tt>.
- /// \li Otherwise, the result type is <tt>T\<X0',X1',...\></tt>.
- ///
- /// Note that <tt>when\<\></tt> is implemented in terms of <tt>call\<\></tt>
- /// and <tt>make\<\></tt>, so the above procedure is evaluated recursively.
- template<typename Object>
- struct make : transform<make<Object> >
+ template<typename T>
+ struct nested_type_if<T, true>
+ : nested_type<T>
         {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+ static bool const applied = true;
+ };
 
- /// \return <tt>result_type()</tt>
- result_type operator ()(
- typename impl::expr_param
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return result_type();
- }
- };
- };
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/make.hpp>))
- #include BOOST_PP_ITERATE()
-
- /// INTERNAL ONLY
- ///
- template<typename Object>
- struct is_callable<make<Object> >
- : mpl::true_
- {};
+ template<
+ typename R
+ , typename Expr, typename State, typename Data
+ BOOST_PROTO_TEMPLATE_ARITY_PARAM(long Arity = detail::template_arity<R>::value)
+ >
+ struct make_
+ {
+ typedef R type;
+ static bool const applied = false;
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename PrimitiveTransform>
- struct is_callable<protect<PrimitiveTransform> >
- : mpl::true_
+ template<
+ typename R
+ , typename Expr, typename State, typename Data
+ , bool IsApplyable = is_applyable<R>::value
+ >
+ struct make_if_
+ : make_<R, Expr, State, Data>
         {};
 
- }}
-
- #endif
+ template<typename R, typename Expr, typename State, typename Data>
+ struct make_if_<R, Expr, State, Data, true>
+ : uncvref<typename when<_, R>::template impl<Expr, State, Data>::result_type>
+ {
+ static bool const applied = true;
+ };
 
-#else
+ #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+ // work around GCC bug
+ template<typename Tag, typename Args, long N, typename Expr, typename State, typename Data>
+ struct make_if_<proto::expr<Tag, Args, N>, Expr, State, Data, false>
+ {
+ typedef proto::expr<Tag, Args, N> type;
+ static bool const applied = false;
+ };
 
- #define N BOOST_PP_ITERATION()
+ // work around GCC bug
+ template<typename Tag, typename Args, long N, typename Expr, typename State, typename Data>
+ struct make_if_<proto::basic_expr<Tag, Args, N>, Expr, State, Data, false>
+ {
+ typedef proto::basic_expr<Tag, Args, N> type;
+ static bool const applied = false;
+ };
+ #endif
 
- namespace detail
- {
- #if N > 0
- #define TMP0(Z, M, DATA) make_if_<BOOST_PP_CAT(A, M), Expr, State, Data>
- #define TMP1(Z, M, DATA) typename TMP0(Z, M, DATA) ::type
- #define TMP2(Z, M, DATA) TMP0(Z, M, DATA) ::applied ||
-
- template<
- template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class R
- BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)
- , typename Expr, typename State, typename Data
- >
- struct make_<
- R<BOOST_PP_ENUM_PARAMS(N, A)>
- , Expr, State, Data
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(N)
- >
- : nested_type_if<R<BOOST_PP_ENUM(N, TMP1, ~)>, (BOOST_PP_REPEAT(N, TMP2, ~) false)>
- {};
-
- template<
- template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class R
- BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)
- , typename Expr, typename State, typename Data
- >
- struct make_<
- noinvoke<R<BOOST_PP_ENUM_PARAMS(N, A)> >
- , Expr, State, Data
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(1)
- >
- {
- typedef R<BOOST_PP_ENUM(N, TMP1, ~)> type;
- static bool const applied = true;
- };
-
- #undef TMP0
- #undef TMP1
- #undef TMP2
- #endif
-
- template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct is_applyable<R(BOOST_PP_ENUM_PARAMS(N, A))>
- : mpl::true_
- {};
-
- template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct is_applyable<R(*)(BOOST_PP_ENUM_PARAMS(N, A))>
- : mpl::true_
- {};
+ template<typename Type, bool IsAggregate = is_aggregate<Type>::value>
+ struct construct_
+ {
+ typedef Type result_type;
 
- template<typename T, typename A>
- struct construct_<proto::expr<T, A, N>, true>
+ Type operator ()() const
             {
- typedef proto::expr<T, A, N> result_type;
-
- template<BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), typename A)>
- result_type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_MAX(N, 1), A, &a)) const
- {
- return result_type::make(BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), a));
- }
- };
+ return Type();
+ }
 
- template<typename T, typename A>
- struct construct_<proto::basic_expr<T, A, N>, true>
- {
- typedef proto::basic_expr<T, A, N> result_type;
+ // Other overloads generated by the preprocessor
+ #include <boost/proto/transform/detail/construct_funop.hpp>
+ };
 
- template<BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), typename A)>
- result_type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_MAX(N, 1), A, &a)) const
- {
- return result_type::make(BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), a));
- }
- };
- }
-
- /// \brief A PrimitiveTransform which computes a type by evaluating any
- /// nested transforms and then constructs an object of that type with the
- /// current expression, state and data, transformed according
- /// to \c A0 through \c AN.
- template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make<Object(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<make<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
+ template<typename Type>
+ struct construct_<Type, true>
         {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ typedef Type result_type;
+
+ Type operator ()() const
             {
- /// \brief <tt>boost::result_of\<make\<Object\>(Expr, State, Data)\>::type</tt>
- typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
+ return Type();
+ }
 
- /// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
- /// for each \c x in <tt>[0,N]</tt>.
- /// Return <tt>result_type(a0, a1,... aN)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- proto::detail::ignore_unused(e);
- proto::detail::ignore_unused(s);
- proto::detail::ignore_unused(d);
- return detail::construct<result_type>(
- #define TMP(Z, M, DATA) \
- detail::as_lvalue( \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data>()(e, s, d) \
- )
- BOOST_PP_ENUM(N, TMP, DATA)
- #undef TMP
- );
- }
- };
+ // Other overloads generated by the preprocessor
+ #include <boost/proto/transform/detail/construct_pod_funop.hpp>
         };
 
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
- // work around GCC bug
- template<typename Tag, typename Args, long Arity BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make<proto::expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<make<proto::expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))> >
+ }
+
+ /// \brief A PrimitiveTransform which prevents another PrimitiveTransform
+ /// from being applied in an \c ObjectTransform.
+ ///
+ /// When building higher order transforms with <tt>make\<\></tt> or
+ /// <tt>lazy\<\></tt>, you sometimes would like to build types that
+ /// are parameterized with Proto transforms. In such lambda-style
+ /// transforms, Proto will unhelpfully find all nested transforms
+ /// and apply them, even if you don't want them to be applied. Consider
+ /// the following transform, which will replace the \c _ in
+ /// <tt>Bar<_>()</tt> with <tt>proto::terminal\<int\>::type</tt>:
+ ///
+ /// \code
+ /// template<typename T>
+ /// struct Bar
+ /// {};
+ ///
+ /// struct Foo
+ /// : proto::when<_, Bar<_>() >
+ /// {};
+ ///
+ /// proto::terminal<int>::type i = {0};
+ ///
+ /// int main()
+ /// {
+ /// Foo()(i);
+ /// std::cout << typeid(Foo()(i)).name() << std::endl;
+ /// }
+ /// \endcode
+ ///
+ /// If you actually wanted to default-construct an object of type
+ /// <tt>Bar\<_\></tt>, you would have to protect the \c _ to prevent
+ /// it from being applied. You can use <tt>proto::protect\<\></tt>
+ /// as follows:
+ ///
+ /// \code
+ /// // OK: replace anything with Bar<_>()
+ /// struct Foo
+ /// : proto::when<_, Bar<protect<_> >() >
+ /// {};
+ /// \endcode
+ template<typename PrimitiveTransform>
+ struct protect : transform<protect<PrimitiveTransform> >
+ {
+ template<typename, typename, typename>
+ struct impl
         {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef proto::expr<Tag, Args, Arity> result_type;
+ typedef PrimitiveTransform result_type;
+ };
+ };
 
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return proto::expr<Tag, Args, Arity>::make(
- #define TMP(Z, M, DATA) \
- detail::as_lvalue( \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data>()(e, s, d) \
- )
- BOOST_PP_ENUM(N, TMP, DATA)
- #undef TMP
- );
- }
- };
- };
-
- template<typename Tag, typename Args, long Arity BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make<proto::basic_expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<make<proto::basic_expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))> >
+ /// \brief A PrimitiveTransform which computes a type by evaluating any
+ /// nested transforms and then constructs an object of that type.
+ ///
+ /// The <tt>make\<\></tt> transform checks to see if \c Object is a template.
+ /// If it is, the template type is disassembled to find nested transforms.
+ /// Proto considers the following types to represent transforms:
+ ///
+ /// \li Function types
+ /// \li Function pointer types
+ /// \li Types for which <tt>proto::is_callable\< type \>::value</tt> is \c true
+ ///
+ /// <tt>boost::result_of\<make\<T\<X0,X1,...\> \>(Expr, State, Data)\>::type</tt>
+ /// is evaluated as follows. For each \c X in <tt>X0,X1,...</tt>, do:
+ ///
+ /// \li If \c X is a template like <tt>U\<Y0,Y1,...\></tt>, then let <tt>X'</tt>
+ /// be <tt>boost::result_of\<make\<U\<Y0,Y1,...\> \>(Expr, State, Data)\>::type</tt>
+ /// (which evaluates this procedure recursively). Note whether any
+ /// substitutions took place during this operation.
+ /// \li Otherwise, if \c X is a transform, then let <tt>X'</tt> be
+ /// <tt>boost::result_of\<when\<_, X\>(Expr, State, Data)\>::type</tt>.
+ /// Note that a substitution took place.
+ /// \li Otherwise, let <tt>X'</tt> be \c X, and note that no substitution
+ /// took place.
+ /// \li If any substitutions took place in any of the above steps and
+ /// <tt>T\<X0',X1',...\></tt> has a nested <tt>::type</tt> typedef,
+ /// the result type is <tt>T\<X0',X1',...\>::type</tt>.
+ /// \li Otherwise, the result type is <tt>T\<X0',X1',...\></tt>.
+ ///
+ /// Note that <tt>when\<\></tt> is implemented in terms of <tt>call\<\></tt>
+ /// and <tt>make\<\></tt>, so the above procedure is evaluated recursively.
+ template<typename Object>
+ struct make : transform<make<Object> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef proto::basic_expr<Tag, Args, Arity> result_type;
+ typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
 
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return proto::basic_expr<Tag, Args, Arity>::make(
- #define TMP(Z, M, DATA) \
- detail::as_lvalue( \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data>()(e, s, d) \
- )
- BOOST_PP_ENUM(N, TMP, DATA)
- #undef TMP
- );
- }
- };
+ /// \return <tt>result_type()</tt>
+ result_type operator ()(
+ typename impl::expr_param
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ return result_type();
+ }
         };
- #endif
+ };
+
+ // Other specializations generated by the preprocessor.
+ #include <boost/proto/transform/detail/make.hpp>
+ #include <boost/proto/transform/detail/make_gcc_workaround.hpp>
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Object>
+ struct is_callable<make<Object> >
+ : mpl::true_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename PrimitiveTransform>
+ struct is_callable<protect<PrimitiveTransform> >
+ : mpl::true_
+ {};
 
- #undef N
+}}
 
 #endif

Modified: branches/release/boost/proto/transform/pass_through.hpp
==============================================================================
--- branches/release/boost/proto/transform/pass_through.hpp (original)
+++ branches/release/boost/proto/transform/pass_through.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,204 +1,136 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file pass_through.hpp
- ///
- /// Definition of the pass_through transform, which is the default transform
- /// of all of the expression generator metafunctions such as unary_plus<>, plus<>
- /// and nary_expr<>.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_PASS_THROUGH_HPP_EAN_12_26_2006
- #define BOOST_PROTO_TRANSFORM_PASS_THROUGH_HPP_EAN_12_26_2006
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/args.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file pass_through.hpp
+///
+/// Definition of the pass_through transform, which is the default transform
+/// of all of the expression generator metafunctions such as unary_plus<>, plus<>
+/// and nary_expr<>.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_PASS_THROUGH_HPP_EAN_12_26_2006
+#define BOOST_PROTO_TRANSFORM_PASS_THROUGH_HPP_EAN_12_26_2006
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/args.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/detail/ignore_unused.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
- {
- template<
- typename Grammar
- , typename Expr
- , typename State
- , typename Data
- , long Arity = arity_of<Expr>::value
- >
- struct pass_through_impl
- {};
-
- #define BOOST_PROTO_DEFINE_TRANSFORM_TYPE(Z, N, DATA) \
- typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
- typename result_of::child_c<Expr, N>::type \
- , State \
- , Data \
- >::result_type \
- /**/
-
- #define BOOST_PROTO_DEFINE_TRANSFORM(Z, N, DATA) \
- typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
- typename result_of::child_c<Expr, N>::type \
- , State \
- , Data \
- >()( \
- e.proto_base().BOOST_PP_CAT(child, N), s, d \
- ) \
- /**/
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/pass_through.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_DEFINE_TRANSFORM
- #undef BOOST_PROTO_DEFINE_TRANSFORM_TYPE
-
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct pass_through_impl<Grammar, Expr, State, Data, 0>
- : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
- /// \param e An expression
- /// \return \c e
- /// \throw nothrow
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename pass_through_impl::expr_param
- #endif
- operator()(
- typename pass_through_impl::expr_param e
- , typename pass_through_impl::state_param
- , typename pass_through_impl::data_param
- ) const
- {
- return e;
- }
- };
-
- } // namespace detail
-
- /// \brief A PrimitiveTransform that transforms the child expressions
- /// of an expression node according to the corresponding children of
- /// a Grammar.
- ///
- /// Given a Grammar such as <tt>plus\<T0, T1\></tt>, an expression type
- /// that matches the grammar such as <tt>plus\<E0, E1\>::type</tt>, a
- /// state \c S and a data \c V, the result of applying the
- /// <tt>pass_through\<plus\<T0, T1\> \></tt> transform is:
- ///
- /// \code
- /// plus<
- /// T0::result<T0(E0, S, V)>::type
- /// , T1::result<T1(E1, S, V)>::type
- /// >::type
- /// \endcode
- ///
- /// The above demonstrates how child transforms and child expressions
- /// are applied pairwise, and how the results are reassembled into a new
- /// expression node with the same tag type as the original.
- ///
- /// The explicit use of <tt>pass_through\<\></tt> is not usually needed,
- /// since the expression generator metafunctions such as
- /// <tt>plus\<\></tt> have <tt>pass_through\<\></tt> as their default
- /// transform. So, for instance, these are equivalent:
- ///
- /// \code
- /// // Within a grammar definition, these are equivalent:
- /// when< plus<X, Y>, pass_through< plus<X, Y> > >
- /// when< plus<X, Y>, plus<X, Y> >
- /// when< plus<X, Y> > // because of when<class X, class Y=X>
- /// plus<X, Y> // because plus<> is both a
- /// // grammar and a transform
- /// \endcode
- ///
- /// For example, consider the following transform that promotes all
- /// \c float terminals in an expression to \c double.
- ///
- /// \code
- /// // This transform finds all float terminals in an expression and promotes
- /// // them to doubles.
- /// struct Promote
- /// : or_<
- /// when<terminal<float>, terminal<double>::type(_value) >
- /// // terminal<>'s default transform is a no-op:
- /// , terminal<_>
- /// // nary_expr<> has a pass_through<> transform:
- /// , nary_expr<_, vararg<Promote> >
- /// >
- /// {};
- /// \endcode
- template<typename Grammar>
- struct pass_through
- : transform<pass_through<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<Grammar, Expr, State, Data>
- {};
- };
-
- /// INTERNAL ONLY
- ///
- template<typename Grammar>
- struct is_callable<pass_through<Grammar> >
- : mpl::true_
+ template<
+ typename Grammar
+ , typename Expr
+ , typename State
+ , typename Data
+ , long Arity = arity_of<Expr>::value
+ >
+ struct pass_through_impl
         {};
 
- }} // namespace boost::proto
+ #include <boost/proto/transform/detail/pass_through_impl.hpp>
 
- #endif
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 0>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
 
-#else
+ /// \param e An expression
+ /// \return \c e
+ /// \throw nothrow
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename pass_through_impl::expr_param
+ #endif
+ operator()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param
+ , typename pass_through_impl::data_param
+ ) const
+ {
+ return e;
+ }
+ };
 
- #define N BOOST_PP_ITERATION()
+ } // namespace detail
 
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct pass_through_impl<Grammar, Expr, State, Data, N>
- : transform_impl<Expr, State, Data>
- {
- typedef typename pass_through_impl::expr unref_expr;
+ /// \brief A PrimitiveTransform that transforms the child expressions
+ /// of an expression node according to the corresponding children of
+ /// a Grammar.
+ ///
+ /// Given a Grammar such as <tt>plus\<T0, T1\></tt>, an expression type
+ /// that matches the grammar such as <tt>plus\<E0, E1\>::type</tt>, a
+ /// state \c S and a data \c V, the result of applying the
+ /// <tt>pass_through\<plus\<T0, T1\> \></tt> transform is:
+ ///
+ /// \code
+ /// plus<
+ /// T0::result<T0(E0, S, V)>::type
+ /// , T1::result<T1(E1, S, V)>::type
+ /// >::type
+ /// \endcode
+ ///
+ /// The above demonstrates how child transforms and child expressions
+ /// are applied pairwise, and how the results are reassembled into a new
+ /// expression node with the same tag type as the original.
+ ///
+ /// The explicit use of <tt>pass_through\<\></tt> is not usually needed,
+ /// since the expression generator metafunctions such as
+ /// <tt>plus\<\></tt> have <tt>pass_through\<\></tt> as their default
+ /// transform. So, for instance, these are equivalent:
+ ///
+ /// \code
+ /// // Within a grammar definition, these are equivalent:
+ /// when< plus<X, Y>, pass_through< plus<X, Y> > >
+ /// when< plus<X, Y>, plus<X, Y> >
+ /// when< plus<X, Y> > // because of when<class X, class Y=X>
+ /// plus<X, Y> // because plus<> is both a
+ /// // grammar and a transform
+ /// \endcode
+ ///
+ /// For example, consider the following transform that promotes all
+ /// \c float terminals in an expression to \c double.
+ ///
+ /// \code
+ /// // This transform finds all float terminals in an expression and promotes
+ /// // them to doubles.
+ /// struct Promote
+ /// : or_<
+ /// when<terminal<float>, terminal<double>::type(_value) >
+ /// // terminal<>'s default transform is a no-op:
+ /// , terminal<_>
+ /// // nary_expr<> has a pass_through<> transform:
+ /// , nary_expr<_, vararg<Promote> >
+ /// >
+ /// {};
+ /// \endcode
+ template<typename Grammar>
+ struct pass_through
+ : transform<pass_through<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<Grammar, Expr, State, Data>
+ {};
+ };
 
- typedef
- typename base_expr<
- typename unref_expr::proto_domain
- , typename unref_expr::proto_tag
- , BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
- >
- >::type
- expr_type;
-
- typedef typename unref_expr::proto_generator proto_generator;
- typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
-
- result_type const operator ()(
- typename pass_through_impl::expr_param e
- , typename pass_through_impl::state_param s
- , typename pass_through_impl::data_param d
- ) const
- {
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM, ~)
- };
- #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))
- // Without this, MSVC complains that "that" is uninitialized,
- // and it actually triggers a runtime check in debug mode when
- // built with VC8.
- &that;
- #endif
- return proto_generator()(that);
- }
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename Grammar>
+ struct is_callable<pass_through<Grammar> >
+ : mpl::true_
+ {};
 
- #undef N
+}} // namespace boost::proto
 
 #endif

Modified: branches/release/boost/proto/transform/when.hpp
==============================================================================
--- branches/release/boost/proto/transform/when.hpp (original)
+++ branches/release/boost/proto/transform/when.hpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -1,278 +1,197 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file when.hpp
- /// Definition of when transform.
- //
- // Copyright 2008 Eric Niebler. 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)
-
- #ifndef BOOST_PROTO_TRANSFORM_WHEN_HPP_EAN_10_29_2007
- #define BOOST_PROTO_TRANSFORM_WHEN_HPP_EAN_10_29_2007
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/mpl/at.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/map.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/call.hpp>
- #include <boost/proto/transform/make.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file when.hpp
+/// Definition of when transform.
+//
+// Copyright 2008 Eric Niebler. 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)
+
+#ifndef BOOST_PROTO_TRANSFORM_WHEN_HPP_EAN_10_29_2007
+#define BOOST_PROTO_TRANSFORM_WHEN_HPP_EAN_10_29_2007
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/map.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/call.hpp>
+#include <boost/proto/transform/make.hpp>
+#include <boost/proto/transform/impl.hpp>
+
+namespace boost { namespace proto
+{
+ /// \brief A grammar element and a PrimitiveTransform that associates
+ /// a transform with the grammar.
+ ///
+ /// Use <tt>when\<\></tt> to override a grammar's default transform
+ /// with a custom transform. It is for used when composing larger
+ /// transforms by associating smaller transforms with individual
+ /// rules in your grammar, as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// In <tt>when\<G, T\></tt>, when \c T is a class type it is a
+ /// PrimitiveTransform and the following equivalencies hold:
+ ///
+ /// <tt>boost::result_of\<when\<G,T\>(E,S,V)\>::type</tt> is the same as
+ /// <tt>boost::result_of\<T(E,S,V)\>::type</tt>.
+ ///
+ /// <tt>when\<G,T\>()(e,s,d)</tt> is the same as
+ /// <tt>T()(e,s,d)</tt>.
+ template<typename Grammar, typename PrimitiveTransform /*= Grammar*/>
+ struct when
+ : PrimitiveTransform
     {
- /// \brief A grammar element and a PrimitiveTransform that associates
- /// a transform with the grammar.
- ///
- /// Use <tt>when\<\></tt> to override a grammar's default transform
- /// with a custom transform. It is for used when composing larger
- /// transforms by associating smaller transforms with individual
- /// rules in your grammar, as in the following transform which
- /// counts the number of terminals in an expression.
- ///
- /// \code
- /// // Count the terminals in an expression tree.
- /// // Must be invoked with initial state == mpl::int_<0>().
- /// struct CountLeaves
- /// : or_<
- /// when<terminal<_>, mpl::next<_state>()>
- /// , otherwise<fold<_, _state, CountLeaves> >
- /// >
- /// {};
- /// \endcode
- ///
- /// In <tt>when\<G, T\></tt>, when \c T is a class type it is a
- /// PrimitiveTransform and the following equivalencies hold:
- ///
- /// <tt>boost::result_of\<when\<G,T\>(E,S,V)\>::type</tt> is the same as
- /// <tt>boost::result_of\<T(E,S,V)\>::type</tt>.
- ///
- /// <tt>when\<G,T\>()(e,s,d)</tt> is the same as
- /// <tt>T()(e,s,d)</tt>.
- template<typename Grammar, typename PrimitiveTransform /*= Grammar*/>
- struct when
- : PrimitiveTransform
- {
- typedef Grammar first;
- typedef PrimitiveTransform second;
- typedef typename Grammar::proto_grammar proto_grammar;
- };
-
- /// \brief A specialization that treats function pointer Transforms as
- /// if they were function type Transforms.
- ///
- /// This specialization requires that \c Fun is actually a function type.
- ///
- /// This specialization is required for nested transforms such as
- /// <tt>when\<G, T0(T1(_))\></tt>. In C++, functions that are used as
- /// parameters to other functions automatically decay to funtion
- /// pointer types. In other words, the type <tt>T0(T1(_))</tt> is
- /// indistinguishable from <tt>T0(T1(*)(_))</tt>. This specialization
- /// is required to handle these nested function pointer type transforms
- /// properly.
- template<typename Grammar, typename Fun>
- struct when<Grammar, Fun *>
- : when<Grammar, Fun>
- {};
-
- /// \brief Syntactic sugar for <tt>when\<_, Fun\></tt>, for use
- /// in grammars to handle all the cases not yet handled.
- ///
- /// Use <tt>otherwise\<T\></tt> in your grammars as a synonym for
- /// <tt>when\<_, T\></tt> as in the following transform which
- /// counts the number of terminals in an expression.
- ///
- /// \code
- /// // Count the terminals in an expression tree.
- /// // Must be invoked with initial state == mpl::int_<0>().
- /// struct CountLeaves
- /// : or_<
- /// when<terminal<_>, mpl::next<_state>()>
- /// , otherwise<fold<_, _state, CountLeaves> >
- /// >
- /// {};
- /// \endcode
- template<typename Fun>
- struct otherwise
- : when<_, Fun>
+ typedef Grammar first;
+ typedef PrimitiveTransform second;
+ typedef typename Grammar::proto_grammar proto_grammar;
+ };
+
+ /// \brief A specialization that treats function pointer Transforms as
+ /// if they were function type Transforms.
+ ///
+ /// This specialization requires that \c Fun is actually a function type.
+ ///
+ /// This specialization is required for nested transforms such as
+ /// <tt>when\<G, T0(T1(_))\></tt>. In C++, functions that are used as
+ /// parameters to other functions automatically decay to funtion
+ /// pointer types. In other words, the type <tt>T0(T1(_))</tt> is
+ /// indistinguishable from <tt>T0(T1(*)(_))</tt>. This specialization
+ /// is required to handle these nested function pointer type transforms
+ /// properly.
+ template<typename Grammar, typename Fun>
+ struct when<Grammar, Fun *>
+ : when<Grammar, Fun>
+ {};
+
+ /// \brief Syntactic sugar for <tt>when\<_, Fun\></tt>, for use
+ /// in grammars to handle all the cases not yet handled.
+ ///
+ /// Use <tt>otherwise\<T\></tt> in your grammars as a synonym for
+ /// <tt>when\<_, T\></tt> as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ template<typename Fun>
+ struct otherwise
+ : when<_, Fun>
+ {};
+
+ /// \brief This specialization uses the Data parameter as a collection
+ /// of transforms that can be indexed by the specified rule.
+ ///
+ /// Use <tt>when\<T, external_transform\></tt> in your code when you would like
+ /// to define a grammar once and use it to evaluate expressions with
+ /// many different sets of transforms. The transforms are found by
+ /// using the Data parameter as a map from rules to transforms.
+ ///
+ /// See \c action_map for an example.
+ template<typename Grammar>
+ struct when<Grammar, external_transform>
+ : proto::transform<when<Grammar, external_transform> >
+ {
+ typedef Grammar first;
+ typedef external_transform second;
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : Data::template when<Grammar>::template impl<Expr, State, Data>
         {};
 
- /// \brief This specialization uses the Data parameter as a collection
- /// of transforms that can be indexed by the specified rule.
- ///
- /// Use <tt>when\<T, external_transform\></tt> in your code when you would like
- /// to define a grammar once and use it to evaluate expressions with
- /// many different sets of transforms. The transforms are found by
- /// using the Data parameter as a map from rules to transforms.
- ///
- /// See \c action_map for an example.
- template<typename Grammar>
- struct when<Grammar, external_transform>
- : proto::transform<when<Grammar, external_transform> >
- {
- typedef Grammar first;
- typedef external_transform second;
- typedef typename Grammar::proto_grammar proto_grammar;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : Data::template when<Grammar>::template impl<Expr, State, Data>
- {};
-
- template<typename Expr, typename State, typename Data>
- struct impl<Expr, State, Data &>
- : Data::template when<Grammar>::template impl<Expr, State, Data &>
- {};
- };
-
- /// \brief For defining a map of Rule/Transform pairs for use with
- /// <tt>when\<T, external_transform\></tt> to make transforms external to the grammar
- ///
- /// The following code defines a grammar with a couple of external transforms.
- /// It also defines an action_map that maps from rules to transforms. It then
- /// passes that transforms map at the Data parameter to the grammar. In this way,
- /// the behavior of the grammar can be modified post-hoc by passing a different
- /// action_map.
- ///
- /// \code
- /// struct int_terminal
- /// : proto::terminal<int>
- /// {};
- ///
- /// struct char_terminal
- /// : proto::terminal<char>
- /// {};
- ///
- /// struct my_grammar
- /// : proto::or_<
- /// proto::when< int_terminal, proto::external_transform >
- /// , proto::when< char_terminal, proto::external_transform >
- /// , proto::when<
- /// proto::plus< my_grammar, my_grammar >
- /// , proto::fold< _, int(), my_grammar >
- /// >
- /// >
- /// {};
- ///
- /// struct my_transforms
- /// : proto::external_transforms<
- /// proto::when<int_terminal, print(proto::_value)>
- /// , proto::when<char_terminal, print(proto::_value)>
- /// >
- /// {};
- ///
- /// proto::literal<int> i(1);
- /// proto::literal<char> c('a');
- /// my_transforms trx;
- ///
- /// // Evaluate "i+c" using my_grammar with the specified transforms:
- /// my_grammar()(i + c, 0, trx);
- /// \endcode
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_MPL_LIMIT_MAP_SIZE, typename T, mpl::na)>
- struct external_transforms
- {
- typedef mpl::map<BOOST_PP_ENUM_PARAMS(BOOST_MPL_LIMIT_MAP_SIZE, T)> map_type;
-
- template<typename Rule>
- struct when
- : proto::when<_, typename mpl::at<map_type, Rule>::type>
- {};
- };
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/when.hpp>))
- #include BOOST_PP_ITERATE()
-
- /// INTERNAL ONLY
- ///
- template<typename Grammar, typename Transform>
- struct is_callable<when<Grammar, Transform> >
- : mpl::true_
+ template<typename Expr, typename State, typename Data>
+ struct impl<Expr, State, Data &>
+ : Data::template when<Grammar>::template impl<Expr, State, Data &>
         {};
+ };
 
- }} // namespace boost::proto
-
- #endif
+ /// \brief For defining a map of Rule/Transform pairs for use with
+ /// <tt>when\<T, external_transform\></tt> to make transforms external to the grammar
+ ///
+ /// The following code defines a grammar with a couple of external transforms.
+ /// It also defines an action_map that maps from rules to transforms. It then
+ /// passes that transforms map at the Data parameter to the grammar. In this way,
+ /// the behavior of the grammar can be modified post-hoc by passing a different
+ /// action_map.
+ ///
+ /// \code
+ /// struct int_terminal
+ /// : proto::terminal<int>
+ /// {};
+ ///
+ /// struct char_terminal
+ /// : proto::terminal<char>
+ /// {};
+ ///
+ /// struct my_grammar
+ /// : proto::or_<
+ /// proto::when< int_terminal, proto::external_transform >
+ /// , proto::when< char_terminal, proto::external_transform >
+ /// , proto::when<
+ /// proto::plus< my_grammar, my_grammar >
+ /// , proto::fold< _, int(), my_grammar >
+ /// >
+ /// >
+ /// {};
+ ///
+ /// struct my_transforms
+ /// : proto::external_transforms<
+ /// proto::when<int_terminal, print(proto::_value)>
+ /// , proto::when<char_terminal, print(proto::_value)>
+ /// >
+ /// {};
+ ///
+ /// proto::literal<int> i(1);
+ /// proto::literal<char> c('a');
+ /// my_transforms trx;
+ ///
+ /// // Evaluate "i+c" using my_grammar with the specified transforms:
+ /// my_grammar()(i + c, 0, trx);
+ /// \endcode
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_MPL_LIMIT_MAP_SIZE, typename T, mpl::na)>
+ struct external_transforms
+ {
+ typedef mpl::map<BOOST_PP_ENUM_PARAMS(BOOST_MPL_LIMIT_MAP_SIZE, T)> map_type;
 
-#else
+ template<typename Rule>
+ struct when
+ : proto::when<_, typename mpl::at<map_type, Rule>::type>
+ {};
+ };
 
- #define N BOOST_PP_ITERATION()
+ // Other specializations of proto::when are generated by the preprocessor...
+ #include <boost/proto/transform/detail/when.hpp>
 
- /// \brief A grammar element and a PrimitiveTransform that associates
- /// a transform with the grammar.
- ///
- /// Use <tt>when\<\></tt> to override a grammar's default transform
- /// with a custom transform. It is for used when composing larger
- /// transforms by associating smaller transforms with individual
- /// rules in your grammar, as in the following transform which
- /// counts the number of terminals in an expression.
- ///
- /// \code
- /// // Count the terminals in an expression tree.
- /// // Must be invoked with initial state == mpl::int_<0>().
- /// struct CountLeaves
- /// : or_<
- /// when<terminal<_>, mpl::next<_state>()>
- /// , otherwise<fold<_, _state, CountLeaves> >
- /// >
- /// {};
- /// \endcode
- ///
- /// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
- /// CallableTransform or an ObjectTransform as its second parameter.
- /// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
- /// distinguish between the two, and uses <tt>call\<\></tt> to
- /// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
- /// ObjectTransforms.
- template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))> >
- {
- typedef Grammar first;
- typedef R second(BOOST_PP_ENUM_PARAMS(N, A));
- typedef typename Grammar::proto_grammar proto_grammar;
-
- // Note: do not evaluate is_callable<R> in this scope.
- // R may be an incomplete type at this point.
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- // OK to evaluate is_callable<R> here. R should be compete by now.
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is a function to call
- , make<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is an object to construct
- >::type
- which;
-
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
- /// Evaluate <tt>R(A0,A1,...)</tt> as a transform either with
- /// <tt>call\<\></tt> or with <tt>make\<\></tt> depending on
- /// whether <tt>is_callable\<R\>::value</tt> is \c true or
- /// \c false.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- /// \pre <tt>matches\<Expr, Grammar\>::value</tt> is \c true
- /// \return <tt>which()(e, s, d)</tt>
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename Grammar, typename Transform>
+ struct is_callable<when<Grammar, Transform> >
+ : mpl::true_
+ {};
 
- #undef N
+}} // namespace boost::proto
 
 #endif

Added: branches/release/libs/proto/preprocess/preprocess_proto.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/proto/preprocess/preprocess_proto.cpp 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright 2011 Eric Niebler. 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)
+
+//#include <boost/proto/core.hpp>
+//#include <boost/proto/debug.hpp>
+//#include <boost/proto/context.hpp>
+//#include <boost/proto/transform.hpp>
+//#include <boost/proto/functional.hpp>
+
+#include <boost/proto/args.hpp>
+#include <boost/proto/expr.hpp>
+#include <boost/proto/extends.hpp>
+#include <boost/proto/deep_copy.hpp>
+#include <boost/proto/generate.hpp>
+#include <boost/proto/make_expr.hpp>
+#include <boost/proto/matches.hpp>
+#include <boost/proto/transform/call.hpp>
+#include <boost/proto/transform/default.hpp>
+#include <boost/proto/transform/fold.hpp>
+#include <boost/proto/transform/lazy.hpp>
+#include <boost/proto/transform/make.hpp>

Added: branches/release/libs/proto/preprocess/wave.cfg
==============================================================================
--- (empty file)
+++ branches/release/libs/proto/preprocess/wave.cfg 2011-05-09 12:43:36 EDT (Mon, 09 May 2011)
@@ -0,0 +1,7 @@
+-DBOOST_PROTO_DONT_USE_PREPROCESSED_FILES
+-DBOOST_PROTO_CREATE_PREPROCESSED_FILES
+-D_WIN32
+-SC:\boost\org\trunk
+-S"C:\Program Files\Microsoft Visual Studio 10.0\VC\include"
+-S.
+--variadics


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