Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54472 - in sandbox/monotonic: boost/heterogenous libs/monotonic/test/clones
From: christian.schladetsch_at_[hidden]
Date: 2009-06-28 17:24:35


Author: cschladetsch
Date: 2009-06-28 17:24:34 EDT (Sun, 28 Jun 2009)
New Revision: 54472
URL: http://svn.boost.org/trac/boost/changeset/54472

Log:
added foreach
Text files modified:
   sandbox/monotonic/boost/heterogenous/vector.hpp | 3 ++-
   sandbox/monotonic/libs/monotonic/test/clones/tests.cpp | 13 +++----------
   2 files changed, 5 insertions(+), 11 deletions(-)

Modified: sandbox/monotonic/boost/heterogenous/vector.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/vector.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/vector.hpp 2009-06-28 17:24:34 EDT (Sun, 28 Jun 2009)
@@ -8,6 +8,7 @@
 
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/foreach.hpp>
+#include <boost/monotonic/allocator.hpp>
 
 #include <boost/heterogenous/detail/prefix.hpp>
 #include <boost/heterogenous/base.hpp>
@@ -18,7 +19,7 @@
         namespace heterogenous
         {
                 /// a vector of heterogenous objects
- template <class Alloc, class Base = common_base >
+ template <class Alloc = monotonic::allocator<int>, class Base = common_base >
                 struct vector
                 {
                         typedef typename make_clone_allocator<Alloc>::type allocator_type;

Modified: sandbox/monotonic/libs/monotonic/test/clones/tests.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/clones/tests.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/clones/tests.cpp 2009-06-28 17:24:34 EDT (Sun, 28 Jun 2009)
@@ -9,7 +9,6 @@
 #include <string>
 #include <iostream>
 #include <boost/heterogenous/vector.hpp>
-#include <boost/monotonic/allocator.hpp>
 #include <boost/bind.hpp>
 
 using namespace std;
@@ -61,12 +60,10 @@
 
 int main()
 {
- // there is a problem with static_move_ptr<>
- //typedef heterogenous::vector<std::allocator<int> > vec;
- typedef heterogenous::vector<monotonic::allocator<int> > vec;
+ // a 'heterogenous' container of objects of any type that derives from common_base
+ typedef heterogenous::vector<> vec;
 
         {
- // a 'heterogenous' container of objects of any type that derives from common_base
                 vec bases;
 
                 // type of thing to insert must be passed explicitly, and must derive from common_base.
@@ -102,9 +99,7 @@
                 
                 BOOST_ASSERT(p1.num == 42);
                 BOOST_ASSERT(p2->str == "foo");
- BOOST_ASSERT(p3->real == 3.14f);
- BOOST_ASSERT(p3->num == -123);
- BOOST_ASSERT(p3->str == "spam");
+ BOOST_ASSERT(p3->real == 3.14f);BOOST_ASSERT(p3->num == -123);BOOST_ASSERT(p3->str == "spam");
 
                 bool caught = false;
                 try
@@ -118,8 +113,6 @@
                 BOOST_ASSERT(caught);
 
         }
- monotonic::static_storage<>::release();
-
         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