|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58310 - trunk/boost/proto
From: eric_at_[hidden]
Date: 2009-12-12 04:37:34
Author: eric_niebler
Date: 2009-12-12 04:37:33 EST (Sat, 12 Dec 2009)
New Revision: 58310
URL: http://svn.boost.org/trac/boost/changeset/58310
Log:
add forward declarations for proto::term and proto::listN
Text files modified:
trunk/boost/proto/args.hpp | 179 +++++++++++++++++++--------------------
trunk/boost/proto/proto_fwd.hpp | 20 ++++
2 files changed, 108 insertions(+), 91 deletions(-)
Modified: trunk/boost/proto/args.hpp
==============================================================================
--- trunk/boost/proto/args.hpp (original)
+++ trunk/boost/proto/args.hpp 2009-12-12 04:37:33 EST (Sat, 12 Dec 2009)
@@ -28,96 +28,95 @@
{
namespace detail
{
- /// 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<is_function<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];
- };
+ /// 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<is_function<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];
+ };
}
////////////////////////////////////////////////////////////////////////////////////////////
@@ -158,8 +157,6 @@
}
////////////////////////////////////////////////////////////////////////////////////////////
-
- using namespace argsns_;
}}
#endif
Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2009-12-12 04:37:33 EST (Sat, 12 Dec 2009)
@@ -14,7 +14,9 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
@@ -140,6 +142,24 @@
typedef detail::ignore const ignore;
+ 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
+ }
+
+ using argsns_::term;
+
+ #define M0(Z, N, DATA) using argsns_::BOOST_PP_CAT(list, N);
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), M0, ~)
+ #undef M0
+
///////////////////////////////////////////////////////////////////////////////
// Operator tags
namespace tag
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