Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54037 - sandbox/monotonic/libs/monotonic/test
From: christian.schladetsch_at_[hidden]
Date: 2009-06-17 20:03:26


Author: cschladetsch
Date: 2009-06-17 20:03:26 EDT (Wed, 17 Jun 2009)
New Revision: 54037
URL: http://svn.boost.org/trac/boost/changeset/54037

Log:
fixes for monotonic::shared_allocator to provide correct construction of elements that are also monotonic containers

Text files modified:
   sandbox/monotonic/libs/monotonic/test/main.cpp | 28 ++++++++++++++--------------
   1 files changed, 14 insertions(+), 14 deletions(-)

Modified: sandbox/monotonic/libs/monotonic/test/main.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/main.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/main.cpp 2009-06-17 20:03:26 EDT (Wed, 17 Jun 2009)
@@ -338,20 +338,20 @@
 void test_mono_map()
 {
         monotonic::storage<> store;
- //monotonic::shared_storage<> shared_store;
- //{
- // typedef std::list<int, monotonic::shared_allocator<int> > List;
- // typedef std::vector<List, monotonic::shared_allocator<List> > Vector;
-
- // BOOST_STATIC_ASSERT(monotonic::detail::is_monotonic<List>::value);
- // BOOST_STATIC_ASSERT(monotonic::detail::is_monotonic<Vector>::value);
-
- // Vector vec(shared_store);
- //
- // vec.resize(1);
- // BOOST_ASSERT(vec[0].get_allocator().get_storage() == vec.get_allocator().get_storage());
- // vec[0].push_back(42);
- //}
+ monotonic::shared_storage<> shared_store;
+ {
+ typedef std::list<int, monotonic::shared_allocator<int> > List;
+ typedef std::vector<List, monotonic::shared_allocator<List> > Vector;
+
+ BOOST_STATIC_ASSERT(monotonic::detail::is_monotonic<List>::value);
+ BOOST_STATIC_ASSERT(monotonic::detail::is_monotonic<Vector>::value);
+
+ Vector vec(shared_store);
+
+ vec.resize(1);
+ BOOST_ASSERT(vec[0].get_allocator().get_storage() == vec.get_allocator().get_storage());
+ vec[0].push_back(42);
+ }
 
         {
                 typedef std::list<int, monotonic::allocator<int> > List;


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