|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63005 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/detail boost/filesystem boost/functional/hash boost/fusion boost/gil boost/graph boost/integer boost/interprocess boost/intrusive boost/iostreams boost/math boost/numeric/ublas boost/program_options boost/property_tree boost/proto boost/proto/detail 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/unordered boost/utility boost/uuid boost/variant boost/wave doc libs libs/array/doc libs/array/test libs/bimap libs/config libs/filesystem libs/functional/hash libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/iostreams libs/math libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/numeric/ublas/doc libs/program_options libs/property_tree libs/proto/doc libs/proto/doc/reference libs/python libs/range libs/range/doc libs/regex libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave more more/getting_started people status tools tools/bcp tools/boostbook tools/build/v2 tools/build/v2/tools tools/inspect tools/jam tools/quickbook tools/regression tools/release tools/wave wiki
From: eric_at_[hidden]
Date: 2010-06-15 18:08:35
Author: eric_niebler
Date: 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
New Revision: 63005
URL: http://svn.boost.org/trac/boost/changeset/63005
Log:
Merged revisions 62926-62927,62951,62964,63004 via svnmerge from
https://svn.boost.org/svn/boost/trunk
........
r62926 | eric_niebler | 2010-06-13 22:47:07 -0400 (Sun, 13 Jun 2010) | 1 line
sigh, add back some ADL-blocker namespaces
........
r62927 | eric_niebler | 2010-06-14 01:22:36 -0400 (Mon, 14 Jun 2010) | 1 line
fix return type calculation of already_expr and already_child
........
r62951 | eric_niebler | 2010-06-14 17:26:12 -0400 (Mon, 14 Jun 2010) | 1 line
as_expr and as_child no longer run objects that are already proto expressions through the domain's generator
........
r62964 | eric_niebler | 2010-06-14 22:07:23 -0400 (Mon, 14 Jun 2010) | 1 line
make the reference agree with the implementation about the behavior of deduce_domain, as_child, as_expr, make_expr and unpack_expr
........
r63004 | eric_niebler | 2010-06-15 17:49:24 -0400 (Tue, 15 Jun 2010) | 1 line
fix description of how domains are deduced
........
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/config/ (props changed)
branches/release/boost/config.hpp (props changed)
branches/release/boost/detail/ (props changed)
branches/release/boost/detail/endian.hpp (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/gil/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/program_options/ (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/serialization/ (props changed)
branches/release/boost/serialization/factory.hpp (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (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/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/array/doc/array.xml (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/iostreams/ (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/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/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/python/ (props changed)
branches/release/libs/range/ (props changed)
branches/release/libs/range/doc/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/statechart/ (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/ (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/more/getting_started/ (props changed)
branches/release/people/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/status/Jamfile.v2 (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/build/v2/tools/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/jam/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
branches/release/wiki/ (props changed)
Text files modified:
branches/release/boost/proto/args.hpp | 42 ++--
branches/release/boost/proto/detail/as_expr.hpp | 99 ----------
branches/release/boost/proto/domain.hpp | 366 ++++++++++++++++++++--------------------
branches/release/boost/proto/proto_fwd.hpp | 46 +++-
branches/release/boost/proto/traits.hpp | 29 +-
branches/release/libs/proto/doc/propdocs.sh | 2
branches/release/libs/proto/doc/reference/domain.xml | 70 ++++++-
branches/release/libs/proto/doc/reference/make_expr.xml | 138 +++++++++-----
8 files changed, 395 insertions(+), 397 deletions(-)
Modified: branches/release/boost/proto/args.hpp
==============================================================================
--- branches/release/boost/proto/args.hpp (original)
+++ branches/release/boost/proto/args.hpp 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -142,30 +142,32 @@
typedef mpl::void_ BOOST_PP_CAT(child, n); \
/**< INTERNAL ONLY */
- /// \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
+ namespace argsns_
{
- 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
+ /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
///
- typedef Arg0 back_;
- };
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/args.hpp>))
- #include BOOST_PP_ITERATE()
+ /// 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_;
+ };
- #undef BOOST_PROTO_DEFINE_CHILD_N
+ #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
Modified: branches/release/boost/proto/detail/as_expr.hpp
==============================================================================
--- branches/release/boost/proto/detail/as_expr.hpp (original)
+++ branches/release/boost/proto/detail/as_expr.hpp 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -11,6 +11,7 @@
#ifndef BOOST_PROTO_DETAIL_AS_EXPR_HPP_EAN_06_09_2010
#define BOOST_PROTO_DETAIL_AS_EXPR_HPP_EAN_06_09_2010
+#include <boost/type_traits/remove_const.hpp>
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/args.hpp>
@@ -89,55 +90,6 @@
};
////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr, typename Generator, bool SameGenerator>
- struct already_expr
- {
- typedef typename Expr::proto_derived_expr uncv_expr_type;
- typedef typename Generator::template result<Generator(uncv_expr_type)>::type result_type;
-
- result_type operator()(Expr &e) const
- {
- return Generator()(e);
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr, typename Generator>
- struct already_expr<Expr, Generator, true>
- {
- typedef typename Expr::proto_derived_expr result_type; // remove cv
-
- result_type operator()(Expr &e) const
- {
- return e;
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr>
- struct already_expr<Expr, default_generator, false>
- {
- typedef typename Expr::proto_derived_expr result_type; // remove cv
-
- result_type operator()(Expr &e) const
- {
- return e;
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr>
- struct already_expr<Expr, default_generator, true>
- {
- typedef typename Expr::proto_derived_expr result_type; // remove cv
-
- result_type operator()(Expr &e) const
- {
- return e;
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
template<typename T, typename Generator, bool WantsBasicExpr>
struct as_child;
@@ -191,55 +143,6 @@
}
};
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr, typename Generator, bool SameGenerator>
- struct already_child
- {
- typedef typename Expr::proto_derived_expr uncv_expr_type;
- typedef typename Generator::template result<Generator(uncv_expr_type)>::type result_type;
-
- result_type operator()(Expr &e) const
- {
- return Generator()(e);
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr, typename Generator>
- struct already_child<Expr, Generator, true>
- {
- typedef Expr &result_type;
-
- result_type operator()(Expr &e) const
- {
- return e;
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr>
- struct already_child<Expr, default_generator, false>
- {
- typedef Expr &result_type;
-
- result_type operator()(Expr &e) const
- {
- return e;
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Expr>
- struct already_child<Expr, default_generator, true>
- {
- typedef Expr &result_type;
-
- result_type operator()(Expr &e) const
- {
- return e;
- }
- };
-
}}}
#endif
Modified: branches/release/boost/proto/domain.hpp
==============================================================================
--- branches/release/boost/proto/domain.hpp (original)
+++ branches/release/boost/proto/domain.hpp 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -33,185 +33,204 @@
{};
}
- /// \brief For use in defining domain tags to be used
- /// with \c proto::extends\<\>. A \e Domain associates
- /// an expression type with a \e Generator, and optionally
- /// a \e Grammar.
- ///
- /// The Generator determines how new expressions in the
- /// domain are constructed. Typically, a generator wraps
- /// all new expressions in a wrapper that imparts
- /// domain-specific behaviors to expressions within its
- /// domain. (See \c proto::extends\<\>.)
- ///
- /// The Grammar determines whether a given expression is
- /// valid within the domain, and automatically disables
- /// any operator overloads which would cause an invalid
- /// expression to be created. By default, the Grammar
- /// parameter defaults to the wildcard, \c proto::_, which
- /// makes all expressions valid within the domain.
- ///
- /// The Super declares the domain currently being defined
- /// to be a sub-domain of Super. Expressions in sub-domains
- /// can be freely combined with expressions in its super-
- /// domain (and <I>its</I> super-domain, etc.).
- ///
- /// Example:
- /// \code
- /// template<typename Expr>
- /// struct MyExpr;
- ///
- /// struct MyGrammar
- /// : or_< terminal<_>, plus<MyGrammar, MyGrammar> >
- /// {};
- ///
- /// // Define MyDomain, in which all expressions are
- /// // wrapped in MyExpr<> and only expressions that
- /// // conform to MyGrammar are allowed.
- /// struct MyDomain
- /// : domain<generator<MyExpr>, MyGrammar>
- /// {};
- ///
- /// // Use MyDomain to define MyExpr
- /// template<typename Expr>
- /// struct MyExpr
- /// : extends<Expr, MyExpr<Expr>, MyDomain>
- /// {
- /// // ...
- /// };
- /// \endcode
- ///
- template<
- typename Generator // = default_generator
- , typename Grammar // = proto::_
- , typename Super // = no_super_domain
- >
- struct domain
- : Generator
+ namespace domainns_
{
- typedef Generator proto_generator;
- typedef Grammar proto_grammar;
- typedef Super proto_super_domain;
- typedef domain proto_base_domain;
-
- /// INTERNAL ONLY
- typedef void proto_is_domain_;
-
- /// \brief A unary MonomorphicFunctionObject that turns objects into Proto
- /// expression objects in this domain.
- ///
- /// The <tt>as_expr\<\></tt> function object turns objects into Proto expressions, if
- /// they are not already, by making them Proto terminals held by value if
- /// possible. Objects that are already Proto expressions are left alone.
- ///
- /// If <tt>wants_basic_expr\<Generator\>::value</tt> is true, then let \c E be \c basic_expr;
- /// otherwise, let \t E be \c expr. Given an lvalue \c t of type \c T:
- ///
- /// If \c T is not a Proto expression type the resulting terminal is
- /// calculated as follows:
- ///
- /// If \c T is a function type, an abstract type, or a type derived from
- /// \c std::ios_base, let \c A be <tt>T &</tt>.
- /// Otherwise, let \c A be the type \c T stripped of cv-qualifiers.
- /// Then, the result of applying <tt>as_expr\<T\>()(t)</tt> is
- /// <tt>Generator()(E\<tag::terminal, term\<A\> \>::make(t))</tt>.
- ///
- /// If \c T is a Proto expression type and its generator type is different from
- /// \c Generator, the result is <tt>Generator()(t)</tt>.
- ///
- /// Otherwise, the result is \c t converted to an (un-const) rvalue.
- ///
- template<typename T, typename IsExpr = void, typename Callable = proto::callable>
- struct as_expr
- : detail::as_expr<
- T
- , typename detail::base_generator<Generator>::type
- , wants_basic_expr<Generator>::value
- >
+ /// \brief For use in defining domain tags to be used
+ /// with \c proto::extends\<\>. A \e Domain associates
+ /// an expression type with a \e Generator, and optionally
+ /// a \e Grammar.
+ ///
+ /// The Generator determines how new expressions in the
+ /// domain are constructed. Typically, a generator wraps
+ /// all new expressions in a wrapper that imparts
+ /// domain-specific behaviors to expressions within its
+ /// domain. (See \c proto::extends\<\>.)
+ ///
+ /// The Grammar determines whether a given expression is
+ /// valid within the domain, and automatically disables
+ /// any operator overloads which would cause an invalid
+ /// expression to be created. By default, the Grammar
+ /// parameter defaults to the wildcard, \c proto::_, which
+ /// makes all expressions valid within the domain.
+ ///
+ /// The Super declares the domain currently being defined
+ /// to be a sub-domain of Super. Expressions in sub-domains
+ /// can be freely combined with expressions in its super-
+ /// domain (and <I>its</I> super-domain, etc.).
+ ///
+ /// Example:
+ /// \code
+ /// template<typename Expr>
+ /// struct MyExpr;
+ ///
+ /// struct MyGrammar
+ /// : or_< terminal<_>, plus<MyGrammar, MyGrammar> >
+ /// {};
+ ///
+ /// // Define MyDomain, in which all expressions are
+ /// // wrapped in MyExpr<> and only expressions that
+ /// // conform to MyGrammar are allowed.
+ /// struct MyDomain
+ /// : domain<generator<MyExpr>, MyGrammar>
+ /// {};
+ ///
+ /// // Use MyDomain to define MyExpr
+ /// template<typename Expr>
+ /// struct MyExpr
+ /// : extends<Expr, MyExpr<Expr>, MyDomain>
+ /// {
+ /// // ...
+ /// };
+ /// \endcode
+ ///
+ template<
+ typename Generator // = default_generator
+ , typename Grammar // = proto::_
+ , typename Super // = no_super_domain
+ >
+ struct domain
+ : Generator
{
- BOOST_PROTO_CALLABLE()
+ typedef Generator proto_generator;
+ typedef Grammar proto_grammar;
+ typedef Super proto_super_domain;
+ typedef domain proto_base_domain;
+
+ /// INTERNAL ONLY
+ typedef void proto_is_domain_;
+
+ /// \brief A unary MonomorphicFunctionObject that turns objects into Proto
+ /// expression objects in this domain.
+ ///
+ /// The <tt>as_expr\<\></tt> function object turns objects into Proto expressions, if
+ /// they are not already, by making them Proto terminals held by value if
+ /// possible. Objects that are already Proto expressions are left alone.
+ ///
+ /// If <tt>wants_basic_expr\<Generator\>::value</tt> is true, then let \c E be \c basic_expr;
+ /// otherwise, let \t E be \c expr. Given an lvalue \c t of type \c T:
+ ///
+ /// If \c T is not a Proto expression type the resulting terminal is
+ /// calculated as follows:
+ ///
+ /// If \c T is a function type, an abstract type, or a type derived from
+ /// \c std::ios_base, let \c A be <tt>T &</tt>.
+ /// Otherwise, let \c A be the type \c T stripped of cv-qualifiers.
+ /// Then, the result of applying <tt>as_expr\<T\>()(t)</tt> is
+ /// <tt>Generator()(E\<tag::terminal, term\<A\> \>::make(t))</tt>.
+ ///
+ /// If \c T is a Proto expression type and its generator type is different from
+ /// \c Generator, the result is <tt>Generator()(t)</tt>.
+ ///
+ /// Otherwise, the result is \c t converted to an (un-const) rvalue.
+ ///
+ template<typename T, typename IsExpr = void, typename Callable = proto::callable>
+ struct as_expr
+ : detail::as_expr<
+ T
+ , typename detail::base_generator<Generator>::type
+ , wants_basic_expr<Generator>::value
+ >
+ {
+ BOOST_PROTO_CALLABLE()
+ };
+
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct as_expr<T, typename T::proto_is_expr_, proto::callable>
+ {
+ BOOST_PROTO_CALLABLE()
+ typedef typename remove_const<T>::type result_type;
+
+ result_type operator()(T &e) const
+ {
+ return e;
+ }
+ };
+
+ /// \brief A unary MonomorphicFunctionObject that turns objects into Proto
+ /// expression objects in this domain.
+ ///
+ /// The <tt>as_child\<\></tt> function object turns objects into Proto expressions, if
+ /// they are not already, by making them Proto terminals held by reference.
+ /// Objects that are already Proto expressions are simply returned by reference.
+ ///
+ /// If <tt>wants_basic_expr\<Generator\>::value</tt> is true, then let \c E be \c basic_expr;
+ /// otherwise, let \t E be \c expr. Given an lvalue \c t of type \c T:
+ ///
+ /// If \c T is not a Proto expression type the resulting terminal is
+ /// <tt>Generator()(E\<tag::terminal, term\<T &\> \>::make(t))</tt>.
+ ///
+ /// If \c T is a Proto expression type and its generator type is different from
+ /// \c Generator, the result is <tt>Generator()(t)</tt>.
+ ///
+ /// Otherwise, the result is the lvalue \c t.
+ ///
+ template<typename T, typename IsExpr = void, typename Callable = proto::callable>
+ struct as_child
+ : detail::as_child<
+ T
+ , typename detail::base_generator<Generator>::type
+ , wants_basic_expr<Generator>::value
+ >
+ {
+ BOOST_PROTO_CALLABLE()
+ };
+
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct as_child<T, typename T::proto_is_expr_, proto::callable>
+ {
+ BOOST_PROTO_CALLABLE()
+ typedef T &result_type;
+
+ result_type operator()(T &e) const
+ {
+ return e;
+ }
+ };
};
- /// INTERNAL ONLY
+ /// \brief The domain expressions have by default, if
+ /// \c proto::extends\<\> has not been used to associate
+ /// a domain with an expression.
///
- template<typename T>
- struct as_expr<T, typename T::proto_is_expr_, proto::callable>
- : detail::already_expr<
- T
- , typename detail::base_generator<Generator>::type
- , is_same<
- typename detail::base_generator<Generator>::type
- , typename detail::base_generator<typename T::proto_generator>::type
- >::value
- >
- {
- BOOST_PROTO_CALLABLE()
- };
+ struct default_domain
+ : domain<>
+ {};
- /// \brief A unary MonomorphicFunctionObject that turns objects into Proto
- /// expression objects in this domain.
+ /// \brief A pseudo-domain for use in functions and
+ /// metafunctions that require a domain parameter. It
+ /// indicates that the domain of the parent node should
+ /// be inferred from the domains of the child nodes.
+ ///
+ /// \attention \c deduce_domain is not itself a valid domain.
///
- /// The <tt>as_child\<\></tt> function object turns objects into Proto expressions, if
- /// they are not already, by making them Proto terminals held by reference.
- /// Objects that are already Proto expressions are simply returned by reference.
- ///
- /// If <tt>wants_basic_expr\<Generator\>::value</tt> is true, then let \c E be \c basic_expr;
- /// otherwise, let \t E be \c expr. Given an lvalue \c t of type \c T:
- ///
- /// If \c T is not a Proto expression type the resulting terminal is
- /// <tt>Generator()(E\<tag::terminal, term\<T &\> \>::make(t))</tt>.
- ///
- /// If \c T is a Proto expression type and its generator type is different from
- /// \c Generator, the result is <tt>Generator()(t)</tt>.
- ///
- /// Otherwise, the result is the lvalue \c t.
- ///
- template<typename T, typename IsExpr = void, typename Callable = proto::callable>
- struct as_child
- : detail::as_child<
- T
- , typename detail::base_generator<Generator>::type
- , wants_basic_expr<Generator>::value
- >
+ struct deduce_domain
+ : domain<detail::not_a_generator, detail::not_a_grammar, detail::not_a_domain>
+ {};
+
+ /// \brief Given a domain, a tag type and an argument list,
+ /// compute the type of the expression to generate. This is
+ /// either an instance of \c proto::expr\<\> or
+ /// \c proto::basic_expr\<\>.
+ ///
+ template<typename Domain, typename Tag, typename Args, typename Void /*= void*/>
+ struct base_expr
{
- BOOST_PROTO_CALLABLE()
+ typedef proto::expr<Tag, Args, Args::arity> type;
};
/// INTERNAL ONLY
///
- template<typename T>
- struct as_child<T, typename T::proto_is_expr_, proto::callable>
- : detail::already_child<
- T
- , typename detail::base_generator<Generator>::type
- , is_same<
- typename detail::base_generator<Generator>::type
- , typename detail::base_generator<typename T::proto_generator>::type
- >::value
- >
+ template<typename Domain, typename Tag, typename Args>
+ struct base_expr<Domain, Tag, Args, typename Domain::proto_generator::proto_use_basic_expr_>
{
- BOOST_PROTO_CALLABLE()
+ typedef proto::basic_expr<Tag, Args, Args::arity> type;
};
- };
-
- /// \brief The domain expressions have by default, if
- /// \c proto::extends\<\> has not been used to associate
- /// a domain with an expression.
- ///
- struct default_domain
- : domain<>
- {};
- /// \brief A pseudo-domain for use in functions and
- /// metafunctions that require a domain parameter. It
- /// indicates that the domain of the parent node should
- /// be inferred from the domains of the child nodes.
- ///
- /// \attention \c deduce_domain is not itself a valid domain.
- ///
- struct deduce_domain
- : domain<detail::not_a_generator, detail::not_a_grammar, detail::not_a_domain>
- {};
+ }
/// A metafunction that returns \c mpl::true_
/// if the type \c T is the type of a Proto domain;
@@ -273,25 +292,6 @@
typedef typename domain_of<T>::type type;
};
- /// \brief Given a domain, a tag type and an argument list,
- /// compute the type of the expression to generate. This is
- /// either an instance of \c proto::expr\<\> or
- /// \c proto::basic_expr\<\>.
- ///
- template<typename Domain, typename Tag, typename Args, typename Void /*= void*/>
- struct base_expr
- {
- typedef proto::expr<Tag, Args, Args::arity> type;
- };
-
- /// INTERNAL ONLY
- ///
- template<typename Domain, typename Tag, typename Args>
- struct base_expr<Domain, Tag, Args, typename Domain::proto_generator::proto_use_basic_expr_>
- {
- typedef proto::basic_expr<Tag, Args, Args::arity> type;
- };
-
}}
#endif
Modified: branches/release/boost/proto/proto_fwd.hpp
==============================================================================
--- branches/release/boost/proto/proto_fwd.hpp (original)
+++ branches/release/boost/proto/proto_fwd.hpp 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -166,14 +166,19 @@
typedef detail::ignore const ignore;
- template<typename Arg0>
- struct term;
+ namespace argsns_
+ {
+ template<typename Arg0>
+ struct term;
- #define M0(Z, N, DATA) \
- template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename Arg)> struct BOOST_PP_CAT(list, N); \
- /**/
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), M0, ~)
- #undef M0
+ #define M0(Z, N, DATA) \
+ template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename Arg)> struct BOOST_PP_CAT(list, N); \
+ /**/
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), M0, ~)
+ #undef M0
+ }
+
+ using namespace argsns_;
///////////////////////////////////////////////////////////////////////////////
// Operator tags
@@ -258,21 +263,26 @@
struct use_basic_expr;
////////////////////////////////////////////////////////////////////////////////////////////////
- typedef detail::not_a_domain no_super_domain;
+ namespace domainns_
+ {
+ typedef detail::not_a_domain no_super_domain;
- template<
- typename Generator = default_generator
- , typename Grammar = proto::_
- , typename Super = no_super_domain
- >
- struct domain;
+ template<
+ typename Generator = default_generator
+ , typename Grammar = proto::_
+ , typename Super = no_super_domain
+ >
+ struct domain;
- struct default_domain;
+ struct default_domain;
- struct deduce_domain;
+ struct deduce_domain;
+
+ template<typename Domain, typename Tag, typename Args, typename Void = void>
+ struct base_expr;
+ }
- template<typename Domain, typename Tag, typename Args, typename Void = void>
- struct base_expr;
+ using namespace domainns_;
////////////////////////////////////////////////////////////////////////////////////////////////
namespace exprns_
Modified: branches/release/boost/proto/traits.hpp
==============================================================================
--- branches/release/boost/proto/traits.hpp (original)
+++ branches/release/boost/proto/traits.hpp 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -28,6 +28,7 @@
#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>
@@ -630,7 +631,7 @@
/// \param t The object to wrap.
/// \return <tt>proto::as_expr\<Domain\>(t)</tt>
template<typename T>
- typename result<as_expr(T &)>::type
+ typename add_const<typename result<as_expr(T &)>::type>::type
operator ()(T &t) const
{
return typename Domain::template as_expr<T>()(t);
@@ -639,7 +640,7 @@
/// \overload
///
template<typename T>
- typename result<as_expr(T const &)>::type
+ 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);
@@ -647,14 +648,14 @@
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
template<typename T, std::size_t N_>
- typename result<as_expr(T (&)[N_])>::type
+ 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 result<as_expr(T const (&)[N_])>::type
+ 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);
@@ -689,7 +690,7 @@
/// \param t The object to wrap.
/// \return <tt>proto::as_child\<Domain\>(t)</tt>
template<typename T>
- typename result<as_child(T &)>::type
+ typename add_const<typename result<as_child(T &)>::type>::type
operator ()(T &t) const
{
return typename Domain::template as_child<T>()(t);
@@ -698,7 +699,7 @@
/// \overload
///
template<typename T>
- typename result<as_child(T const &)>::type
+ 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);
@@ -923,7 +924,7 @@
///
/// \param t The object to wrap.
template<typename T>
- typename result_of::as_expr<T, default_domain>::type
+ 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);
@@ -932,7 +933,7 @@
/// \overload
///
template<typename T>
- typename result_of::as_expr<T const, default_domain>::type
+ 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);
@@ -941,7 +942,7 @@
/// \overload
///
template<typename Domain, typename T>
- typename result_of::as_expr<T, Domain>::type
+ 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);
@@ -950,7 +951,7 @@
/// \overload
///
template<typename Domain, typename T>
- typename result_of::as_expr<T const, Domain>::type
+ 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);
@@ -976,7 +977,7 @@
///
/// \param t The object to wrap.
template<typename T>
- typename result_of::as_child<T, default_domain>::type
+ 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);
@@ -985,7 +986,7 @@
/// \overload
///
template<typename T>
- typename result_of::as_child<T const, default_domain>::type
+ 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);
@@ -994,7 +995,7 @@
/// \overload
///
template<typename Domain, typename T>
- typename result_of::as_child<T, Domain>::type
+ 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);
@@ -1003,7 +1004,7 @@
/// \overload
///
template<typename Domain, typename T>
- typename result_of::as_child<T const, Domain>::type
+ 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);
Modified: branches/release/libs/proto/doc/propdocs.sh
==============================================================================
--- branches/release/libs/proto/doc/propdocs.sh (original)
+++ branches/release/libs/proto/doc/propdocs.sh 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -1,3 +1,5 @@
#!/bin/sh
rsync --delete --rsh=ssh --recursive -p html/* eric_niebler,boost-sandbox_at_[hidden]:/home/groups/b/bo/boost-sandbox/htdocs/libs/proto/doc/html
+
+rsync --delete --rsh=ssh --recursive -p src/* eric_niebler,boost-sandbox_at_[hidden]:/home/groups/b/bo/boost-sandbox/htdocs/libs/proto/doc/src
Modified: branches/release/libs/proto/doc/reference/domain.xml
==============================================================================
--- branches/release/libs/proto/doc/reference/domain.xml (original)
+++ branches/release/libs/proto/doc/reference/domain.xml 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -108,7 +108,7 @@
expressions in this domain. The resulting expression object is suitable for storage
in a local variable. In that scenario, it is usually preferable to return
expressions by value; and, in the case of objects that are not yet Proto expressions,
- to wrap they by value (if possible) in a new Proto terminal expression. (Contrast
+ to wrap them by value (if possible) in a new Proto terminal expression. (Contrast
this description with the description for
<computeroutput><classname>proto::domain::as_child</classname></computeroutput>.)
</para>
@@ -126,7 +126,7 @@
<computeroutput>T</computeroutput>:
<itemizedlist>
<listitem>
- If <computeroutput>T</computeroutput> is not a Proto expression type the resulting
+ If <computeroutput>T</computeroutput> is not a Proto expression type, the resulting
terminal is calculated as follows:
<itemizedlist>
<listitem>
@@ -144,11 +144,6 @@
term< <replaceable>A</replaceable> > >::make(t))</computeroutput>.
</listitem>
<listitem>
- If <computeroutput>T</computeroutput> is a Proto expression type and its generator
- type is different from <computeroutput>Generator</computeroutput>, the result is
- <computeroutput>Generator()(t)</computeroutput>.
- </listitem>
- <listitem>
Otherwise, the result is <computeroutput>t</computeroutput> converted to an
(un-const) rvalue.
</listitem>
@@ -205,17 +200,12 @@
<computeroutput>T</computeroutput>:
<itemizedlist>
<listitem>
- If <computeroutput>T</computeroutput> is not a Proto expression type the resulting
+ If <computeroutput>T</computeroutput> is not a Proto expression type, the resulting
terminal is
<computeroutput>Generator()(<replaceable>E</replaceable><tag::terminal,
term< <computeroutput>T &</computeroutput> > >::make(t))</computeroutput>.
</listitem>
<listitem>
- If <computeroutput>T</computeroutput> is a Proto expression type and its generator
- type is different from <computeroutput>Generator</computeroutput>, the result is
- <computeroutput>Generator()(t)</computeroutput>.
- </listitem>
- <listitem>
Otherwise, the result is the lvalue <computeroutput>t</computeroutput>.
</listitem>
</itemizedlist>
@@ -250,6 +240,60 @@
<struct name="deduce_domain">
<purpose>A pseudo-domain for use in functions and metafunctions that require a domain parameter.
It indicates that the domain of the parent node should be inferred from the domains of the child nodes.</purpose>
+ <description>
+ <para>
+ When <computeroutput>proto::deduce_domain</computeroutput> is used as a domain — either
+ explicitly or implicitly by
+ <computeroutput><functionname>proto::make_expr</functionname>()</computeroutput>,
+ <computeroutput><functionname>proto::unpack_expr</functionname>()</computeroutput>,
+ or Proto's operator overloads — Proto will use the domains of the child expressions to
+ compute the domain of the parent. It is done in such a way that (A) expressions in domains
+ that share a common super-domain are interoperable, and (B) expressions that are in
+ the default domain (or a sub-domain thereof) are interoperable with <emphasis>all</emphasis>
+ expressions. The rules are as follows:
+ <itemizedlist>
+ <listitem>
+ A sub-domain is <emphasis>stronger</emphasis> than its super-domain.
+ </listitem>
+ <listitem>
+ <computeroutput><classname>proto::default_domain</classname></computeroutput>
+ and all its sub-domains are <emphasis>weaker</emphasis> than all other domains.
+ </listitem>
+ <listitem>
+ For each child, define a set of domains <emphasis>S<subscript>N</subscript></emphasis>
+ that includes the child's domain and all its super-domains.
+ </listitem>
+ <listitem>
+ Define a set <emphasis>I</emphasis> that is the intersection of all the individual sets
+ <emphasis>S<subscript>N</subscript></emphasis>.
+ </listitem>
+ <listitem>
+ Define a set <emphasis>U</emphasis> that is the union of all the individual sets
+ <emphasis>S<subscript>N</subscript></emphasis> that contain
+ <computeroutput><classname>proto::default_domain</classname></computeroutput>.
+ </listitem>
+ <listitem>
+ Define a set <emphasis>P</emphasis> that is the union of <emphasis>I</emphasis>
+ and <emphasis>U</emphasis>.
+ </listitem>
+ <listitem>
+ The common domain is the strongest domain in set <emphasis>P</emphasis>, with the
+ following caveat.
+ </listitem>
+ <listitem>
+ If the result is
+ <computeroutput><classname>proto::default_domain</classname></computeroutput>
+ and <emphasis>P</emphasis> contains an element that is <emphasis>not </emphasis>
+ <computeroutput><classname>proto::default_domain</classname></computeroutput>,
+ it is an error.
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Note: the above description sounds like it would be expensive to compute at compile time.
+ In fact, it can all be done using C++ function overloading.
+ </para>
+ </description>
</struct>
<!-- proto::is_domain -->
Modified: branches/release/libs/proto/doc/reference/make_expr.xml
==============================================================================
--- branches/release/libs/proto/doc/reference/make_expr.xml (original)
+++ branches/release/libs/proto/doc/reference/make_expr.xml 2010-06-15 18:08:34 EDT (Tue, 15 Jun 2010)
@@ -167,14 +167,10 @@
<type><replaceable>domain-deduced-from-child-types</replaceable></type>
<description>
<para>
- For each <computeroutput>x</computeroutput> in <computeroutput>[0,N)</computeroutput>
- (proceeding in order beginning with <computeroutput>x=0</computeroutput>), if
- <computeroutput><classname>proto::domain_of</classname><A<subscript>x</subscript>>::type</computeroutput> is not
- <computeroutput><classname>proto::default_domain</classname></computeroutput>, then
- <computeroutput>D</computeroutput> is
- <computeroutput><classname>proto::domain_of</classname><A<subscript>x</subscript>>::type</computeroutput>.
- Otherwise, <computeroutput>D</computeroutput> is
- <computeroutput><classname>proto::default_domain</classname></computeroutput>.
+ In this specialization, Proto uses the domains of the child expressions to compute the
+ domain of the parent. See
+ <computeroutput><classname>proto::deduce_domain</classname></computeroutput> for a full
+ description of the procedure used.
</para>
</description>
</typedef>
@@ -206,18 +202,42 @@
<typedef name="type">
<description>
<para>
+ Let <computeroutput><replaceable>WRAP<X></replaceable></computeroutput> be defined such that:
+ <itemizedlist>
+ <listitem>
+ <para>
+ If <computeroutput>X</computeroutput> is <computeroutput>Y &</computeroutput>
+ or (possibly cv-qualified) <computeroutput>boost::reference_wrapper<Y></computeroutput>,
+ then <computeroutput><replaceable>WRAP<X></replaceable></computeroutput> is equivalent to
+ <computeroutput><classname>proto::result_of::as_child</classname><Y, Domain></computeroutput>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Otherwise, <computeroutput><replaceable>WRAP<X></replaceable></computeroutput> is equivalent to
+ <computeroutput><classname>proto::result_of::as_expr</classname><X, Domain></computeroutput>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ If <computeroutput><classname>proto::wants_basic_expr</classname><typename Domain::proto_generator>::value</computeroutput>
+ is true, then let <computeroutput><replaceable>E</replaceable></computeroutput> be
+ <computeroutput><classname>proto::basic_expr</classname></computeroutput>; otherwise,
+ let <computeroutput><replaceable>E</replaceable></computeroutput> be
+ <computeroutput><classname>proto::expr</classname></computeroutput>.
+ </para>
+ <para>
If <computeroutput>Tag</computeroutput> is
<computeroutput><classname>proto::tag::terminal</classname></computeroutput>, then
<computeroutput>type</computeroutput> is a typedef for
- <computeroutput>boost::result_of<Domain(typename <classname>proto::base_expr</classname><
- Domain, <classname>proto::tag::terminal</classname>, <classname>proto::term</classname><
- A<subscript>0</subscript> > >::type)>::type</computeroutput>.
+ <computeroutput>typename <replaceable>WRAP<A<subscript>0</subscript>></replaceable>::type</computeroutput>.
</para>
<para>
Otherwise, <computeroutput>type</computeroutput> is a typedef for
- <computeroutput>boost::result_of<Domain(typename <classname>proto::base_expr</classname><
- Domain, Tag, <classname alt="proto::listN">proto::list<emphasis>N</emphasis></classname><
- typename <classname>proto::result_of::as_child</classname><A>::type...> >::type)>::type</computeroutput>
+ <computeroutput>boost::result_of<Domain(<replaceable>E</replaceable><
+ Tag, <classname alt="proto::listN">proto::list<emphasis>N</emphasis></classname><
+ typename <replaceable>WRAP<A></replaceable>::type...> >)>::type</computeroutput>
</para>
</description>
<type><emphasis>see-below</emphasis></type>
@@ -252,7 +272,7 @@
</para>
</description>
<typedef name="type">
- <purpose>Where S is a RandomAccessSequence equivalent to Sequence, and N is the size of S.</purpose>
+ <purpose>Where S is a Fusion RandomAccessSequence equivalent to Sequence, and N is the size of S.</purpose>
<type>
typename <classname>proto::result_of::make_expr</classname><
Tag,
@@ -329,10 +349,9 @@
<para>
This function template may be invoked either with or without specifying a
<computeroutput>Domain</computeroutput> template parameter. 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 <computeroutput><classname>proto::default_domain</classname></computeroutput>, if any such
- domain exists, or <computeroutput><classname>proto::default_domain</classname></computeroutput>
- otherwise.
+ is deduced by examining domains of the given arguments. See
+ <computeroutput><classname>proto::deduce_domain</classname></computeroutput> for a full
+ description of the procedure used.
</para>
<para>
Let <computeroutput><replaceable>WRAP</replaceable>(x)</computeroutput> be defined such that:
@@ -351,21 +370,29 @@
</para>
</listitem>
</itemizedlist>
- Let <computeroutput><replaceable>MAKE</replaceable><Tag>(a...)</computeroutput> be defined as
- <computeroutput><classname>proto::base_expr</classname><Domain, Tag,
- <classname alt="proto::listN">proto::list<emphasis>N</emphasis></classname><A...> >::make(a...)</computeroutput>
- where
- <computeroutput>A<subscript>x</subscript></computeroutput> is the type of
- <computeroutput>a<subscript>x</subscript></computeroutput>.
</para>
<para>
+ If <computeroutput><classname>proto::wants_basic_expr</classname><typename Domain::proto_generator>::value</computeroutput>
+ is true, then let <computeroutput><replaceable>E</replaceable></computeroutput> be
+ <computeroutput><classname>proto::basic_expr</classname></computeroutput>; otherwise,
+ let <computeroutput><replaceable>E</replaceable></computeroutput> be
+ <computeroutput><classname>proto::expr</classname></computeroutput>.
+ </para>
+ <para>
+ Let <computeroutput><replaceable>MAKE</replaceable>(Tag, b...)</computeroutput> be defined as
+ <computeroutput><replaceable>E</replaceable><Tag,
+ <classname alt="proto::listN">proto::list<emphasis>N</emphasis></classname><decltype(b)...> >::make(b...)</computeroutput>.
+ </para>
+ <para>
+ If <computeroutput>Tag</computeroutput> is
+ <computeroutput><classname>proto::tag::terminal</classname></computeroutput>, then return
+ <computeroutput><replaceable>WRAP</replaceable>(a<subscript>0</subscript>)</computeroutput>.
</para>
- </description>
- <returns>
<para>
- <computeroutput>Domain()(<replaceable>MAKE</replaceable><Tag>(<replaceable>WRAP</replaceable>(a)...))</computeroutput>.
+ Otherwise, return
+ <computeroutput>Domain()(<replaceable>MAKE</replaceable>(Tag, <replaceable>WRAP</replaceable>(a)...))</computeroutput>.
</para>
- </returns>
+ </description>
</overloaded-function>
<!-- proto::unpack_expr() -->
@@ -399,47 +426,56 @@
<description>
<para>
This function template may be invoked either with or without specifying a
- <computeroutput>Domain</computeroutput> argument. If no domain is specified, the domain is
- deduced by examining in order the domains of the elements of <computeroutput>sequence</computeroutput>
- and taking the first that is not
- <computeroutput><classname>proto::default_domain</classname></computeroutput>, if any such domain
- exists, or <computeroutput><classname>proto::default_domain</classname></computeroutput> otherwise.
+ <computeroutput>Domain</computeroutput> argument. If no domain is specified, the domain
+ is deduced by examining domains of each element of the sequence. See
+ <computeroutput><classname>proto::deduce_domain</classname></computeroutput> for a full
+ description of the procedure used.
</para>
<para>
- Let <computeroutput>s</computeroutput> be a Fusion Random Access Sequence equivalent to
+ Let <computeroutput>s</computeroutput> be a Fusion RandomAccessSequence equivalent to
<computeroutput>sequence</computeroutput>.
- Let <computeroutput><replaceable>WRAP</replaceable><N>(s)</computeroutput>, where
- <computeroutput>s</computeroutput> has type <computeroutput>S</computeroutput>, be defined such that:
+ Let <computeroutput><replaceable>WRAP</replaceable>(N, s)</computeroutput> be defined such that:
<itemizedlist>
<listitem>
<para>
- If <computeroutput>fusion::result_of::value_at_c<S,N>::type</computeroutput> is a reference,
- <computeroutput><replaceable>WRAP</replaceable><N>(s)</computeroutput> is equivalent to
+ If <computeroutput>fusion::result_of::value_at_c<decltype(s),N>::type</computeroutput> is a reference type
+ or an instantiation of <computeroutput>boost::reference_wrapper<></computeroutput>,
+ <computeroutput><replaceable>WRAP</replaceable>(N, s)</computeroutput> is equivalent to
<computeroutput><functionname>proto::as_child</functionname><Domain>(fusion::at_c<N>(s))</computeroutput>.
</para>
</listitem>
<listitem>
<para>
- Otherwise, <computeroutput><replaceable>WRAP</replaceable><N>(s)</computeroutput> is equivalent to
+ Otherwise, <computeroutput><replaceable>WRAP</replaceable>(N, s)</computeroutput> is equivalent to
<computeroutput><functionname>proto::as_expr</functionname><Domain>(fusion::at_c<N>(s))</computeroutput>.
</para>
</listitem>
</itemizedlist>
- Let <computeroutput><replaceable>MAKE</replaceable><Tag>(a...)</computeroutput> be defined as
- <computeroutput><classname>proto::base_expr</classname><Domain, Tag,
- <classname alt="proto::listN">proto::list<emphasis>N</emphasis></classname><A...> >::make(a...)</computeroutput>
- where
- <computeroutput>A<subscript>x</subscript></computeroutput> is the type of
- <computeroutput>a<subscript>x</subscript></computeroutput>.
</para>
- </description>
- <returns>
<para>
- <computeroutput>Domain()(<replaceable>MAKE</replaceable><Tag>(<replaceable>WRAP</replaceable><0>(s),...
- <replaceable>WRAP</replaceable><<replaceable>N</replaceable>-1>(s)))</computeroutput>, where
+ If <computeroutput><classname>proto::wants_basic_expr</classname><typename Domain::proto_generator>::value</computeroutput>
+ is true, then let <computeroutput><replaceable>E</replaceable></computeroutput> be
+ <computeroutput><classname>proto::basic_expr</classname></computeroutput>; otherwise,
+ let <computeroutput><replaceable>E</replaceable></computeroutput> be
+ <computeroutput><classname>proto::expr</classname></computeroutput>.
+ </para>
+ <para>
+ Let <computeroutput><replaceable>MAKE</replaceable>(Tag, b...)</computeroutput> be defined as
+ <computeroutput><replaceable>E</replaceable><Tag,
+ <classname alt="proto::listN">proto::list<emphasis>N</emphasis></classname><decltype(b)...> >::make(b...)</computeroutput>.
+ </para>
+ <para>
+ If <computeroutput>Tag</computeroutput> is
+ <computeroutput><classname>proto::tag::terminal</classname></computeroutput>, then return
+ <computeroutput><replaceable>WRAP</replaceable>(0, s)</computeroutput>.
+ </para>
+ <para>
+ Otherwise, return
+ <computeroutput>Domain()(<replaceable>MAKE</replaceable>(Tag, <replaceable>WRAP</replaceable>(0, s),...
+ <replaceable>WRAP</replaceable>(<replaceable>N</replaceable>-1, s)))</computeroutput>, where
<replaceable>N</replaceable> is the size of <computeroutput>Sequence</computeroutput>.
</para>
- </returns>
+ </description>
</overloaded-function>
</namespace>
</namespace>
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