Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63091 - in trunk: boost/proto boost/proto/detail libs/proto/example
From: eric_at_[hidden]
Date: 2010-06-18 23:32:59


Author: eric_niebler
Date: 2010-06-18 23:32:55 EDT (Fri, 18 Jun 2010)
New Revision: 63091
URL: http://svn.boost.org/trac/boost/changeset/63091

Log:
work-arounds for msvc-7.1
Text files modified:
   trunk/boost/proto/detail/as_expr.hpp | 30 ++++++++++++++++++++++++++----
   trunk/boost/proto/domain.hpp | 4 ++--
   trunk/boost/proto/proto_fwd.hpp | 2 +-
   trunk/libs/proto/example/futures.cpp | 13 +++++++++++--
   trunk/libs/proto/example/map_assign.cpp | 11 +++++++++++
   5 files changed, 51 insertions(+), 9 deletions(-)

Modified: trunk/boost/proto/detail/as_expr.hpp
==============================================================================
--- trunk/boost/proto/detail/as_expr.hpp (original)
+++ trunk/boost/proto/detail/as_expr.hpp 2010-06-18 23:32:55 EDT (Fri, 18 Jun 2010)
@@ -11,6 +11,8 @@
 #ifndef BOOST_PROTO_DETAIL_AS_EXPR_HPP_EAN_06_09_2010
 #define BOOST_PROTO_DETAIL_AS_EXPR_HPP_EAN_06_09_2010
 
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/proto/proto_fwd.hpp>
 #include <boost/proto/args.hpp>
@@ -97,7 +99,12 @@
     template<typename T, typename Generator>
     struct as_child<T, Generator, false>
     {
- typedef proto::expr<proto::tag::terminal, term<T &>, 0> expr_type;
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ typedef typename term_traits<T &>::reference reference;
+ #else
+ typedef T &reference;
+ #endif
+ typedef proto::expr<proto::tag::terminal, term<reference>, 0> expr_type;
         typedef typename Generator::template result<Generator(expr_type)>::type result_type;
 
         result_type operator()(T &t) const
@@ -110,7 +117,12 @@
     template<typename T, typename Generator>
     struct as_child<T, Generator, true>
     {
- typedef proto::basic_expr<proto::tag::terminal, term<T &>, 0> expr_type;
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ typedef typename term_traits<T &>::reference reference;
+ #else
+ typedef T &reference;
+ #endif
+ typedef proto::basic_expr<proto::tag::terminal, term<reference>, 0> expr_type;
         typedef typename Generator::template result<Generator(expr_type)>::type result_type;
 
         result_type operator()(T &t) const
@@ -123,7 +135,12 @@
     template<typename T>
     struct as_child<T, proto::default_generator, false>
     {
- typedef proto::expr<proto::tag::terminal, term<T &>, 0> result_type;
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ typedef typename term_traits<T &>::reference reference;
+ #else
+ typedef T &reference;
+ #endif
+ typedef proto::expr<proto::tag::terminal, term<reference>, 0> result_type;
 
         result_type operator()(T &t) const
         {
@@ -135,7 +152,12 @@
     template<typename T>
     struct as_child<T, proto::default_generator, true>
     {
- typedef proto::basic_expr<proto::tag::terminal, term<T &>, 0> result_type;
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ typedef typename term_traits<T &>::reference reference;
+ #else
+ typedef T &reference;
+ #endif
+ typedef proto::basic_expr<proto::tag::terminal, term<reference>, 0> result_type;
 
         result_type operator()(T &t) const
         {

Modified: trunk/boost/proto/domain.hpp
==============================================================================
--- trunk/boost/proto/domain.hpp (original)
+++ trunk/boost/proto/domain.hpp 2010-06-18 23:32:55 EDT (Fri, 18 Jun 2010)
@@ -216,7 +216,7 @@
         /// either an instance of \c proto::expr\<\> or
         /// \c proto::basic_expr\<\>.
         ///
- template<typename Domain, typename Tag, typename Args, typename Void /*= void*/>
+ template<typename Domain, typename Tag, typename Args, bool WantsBasicExpr>
         struct base_expr
         {
             typedef proto::expr<Tag, Args, Args::arity> type;
@@ -225,7 +225,7 @@
         /// INTERNAL ONLY
         ///
         template<typename Domain, typename Tag, typename Args>
- struct base_expr<Domain, Tag, Args, typename Domain::proto_generator::proto_use_basic_expr_>
+ struct base_expr<Domain, Tag, Args, true>
         {
             typedef proto::basic_expr<Tag, Args, Args::arity> type;
         };

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2010-06-18 23:32:55 EDT (Fri, 18 Jun 2010)
@@ -278,7 +278,7 @@
 
         struct deduce_domain;
 
- template<typename Domain, typename Tag, typename Args, typename Void = void>
+ template<typename Domain, typename Tag, typename Args, bool WantsBasicExpr = wants_basic_expr<typename Domain::proto_generator>::value>
         struct base_expr;
     }
 

Modified: trunk/libs/proto/example/futures.cpp
==============================================================================
--- trunk/libs/proto/example/futures.cpp (original)
+++ trunk/libs/proto/example/futures.cpp 2010-06-18 23:32:55 EDT (Fri, 18 Jun 2010)
@@ -24,6 +24,11 @@
     typedef L type;
 };
 
+// Work-arounds for Microsoft Visual C++ 7.1
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+#define FutureGroup(x) proto::call<FutureGroup(x)>
+#endif
+
 // Define the grammar of future group expression, as well as a
 // transform to turn them into a Fusion sequence of the correct
 // type.
@@ -39,8 +44,8 @@
       , proto::when<
             proto::logical_and<FutureGroup, FutureGroup>
           , fusion::joint_view<
- boost::add_const<FutureGroup(proto::_left)>
- , boost::add_const<FutureGroup(proto::_right)>
+ boost::add_const<FutureGroup(proto::_left) >
+ , boost::add_const<FutureGroup(proto::_right) >
>(FutureGroup(proto::_left), FutureGroup(proto::_right))
>
         // (a || b) becomes the sequence for 'a', so long
@@ -55,6 +60,10 @@
>
 {};
 
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+#undef FutureGroup
+#endif
+
 template<class E>
 struct future_expr;
 

Modified: trunk/libs/proto/example/map_assign.cpp
==============================================================================
--- trunk/libs/proto/example/map_assign.cpp (original)
+++ trunk/libs/proto/example/map_assign.cpp 2010-06-18 23:32:55 EDT (Fri, 18 Jun 2010)
@@ -40,6 +40,12 @@
     }
 };
 
+// Work-arounds for Microsoft Visual C++ 7.1
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+#define MapListOf(x) proto::call<MapListOf(x)>
+#define _value(x) call<proto::_value(x)>
+#endif
+
 // The grammar for valid map-list expressions, and a
 // transform that populates the map.
 struct MapListOf
@@ -71,6 +77,11 @@
>
 {};
 
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+#undef MapListOf
+#undef _value
+#endif
+
 template<typename Expr>
 struct map_list_of_expr;
 


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