Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48907 - trunk/libs/proto/example
From: eric_at_[hidden]
Date: 2008-09-20 01:01:49


Author: eric_niebler
Date: 2008-09-20 01:01:49 EDT (Sat, 20 Sep 2008)
New Revision: 48907
URL: http://svn.boost.org/trac/boost/changeset/48907

Log:
fix map_assign example
Text files modified:
   trunk/libs/proto/example/map_assign.cpp | 14 ++++++++------
   1 files changed, 8 insertions(+), 6 deletions(-)

Modified: trunk/libs/proto/example/map_assign.cpp
==============================================================================
--- trunk/libs/proto/example/map_assign.cpp (original)
+++ trunk/libs/proto/example/map_assign.cpp 2008-09-20 01:01:49 EDT (Sat, 20 Sep 2008)
@@ -86,10 +86,11 @@
     BOOST_PROTO_BASIC_EXTENDS(Expr, map_list_of_expr, map_list_of_dom)
     BOOST_PROTO_EXTENDS_FUNCTION()
 
- template<typename Map>
- operator Map() const
+ template<typename Key, typename Value, typename Cmp, typename Al>
+ operator std::map<Key, Value, Cmp, Al> () const
     {
- Map map;
+ BOOST_MPL_ASSERT((proto::matches<Expr, MapListOf>));
+ std::map<Key, Value, Cmp, Al> map;
         return MapListOf()(*this, 0, map);
     }
 };
@@ -101,11 +102,11 @@
     // Initialize a map:
     std::map<std::string, int> op =
         map_list_of
- ("<",1)
+ ("<", 1)
             ("<=",2)
- (">",3)
+ (">", 3)
             (">=",4)
- ("=",5)
+ ("=", 5)
             ("<>",6)
         ;
 
@@ -119,3 +120,4 @@
     return 0;
 }
 //]
+


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