Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54489 - in sandbox/monotonic: boost libs/monotonic/test/clones
From: christian.schladetsch_at_[hidden]
Date: 2009-06-28 19:27:28


Author: cschladetsch
Date: 2009-06-28 19:27:27 EDT (Sun, 28 Jun 2009)
New Revision: 54489
URL: http://svn.boost.org/trac/boost/changeset/54489

Log:
removed infinite recursion in any::any(any)

Text files modified:
   sandbox/monotonic/boost/any.hpp | 5 +++--
   sandbox/monotonic/libs/monotonic/test/clones/tests.cpp | 3 ---
   2 files changed, 3 insertions(+), 5 deletions(-)

Modified: sandbox/monotonic/boost/any.hpp
==============================================================================
--- sandbox/monotonic/boost/any.hpp (original)
+++ sandbox/monotonic/boost/any.hpp 2009-06-28 19:27:27 EDT (Sun, 28 Jun 2009)
@@ -91,8 +91,9 @@
                 }
 
         any(const any & other)
- : alloc(other.alloc), content(other.content ? other.content->clone() : 0)
+ : alloc(other.alloc)
         {
+ content = other.content ? other.content->clone() : 0;
         }
 
         ~any()
@@ -181,7 +182,7 @@
 
             virtual placeholder * clone() const
             {
- return parent->construct_type<holder<ValueType> >(held, *parent);
+ return parent->construct_holder<ValueType>(held);
             }
 
         public: // representation

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 19:27:27 EDT (Sun, 28 Jun 2009)
@@ -126,12 +126,9 @@
         typedef std::vector<any<monotonic::allocator<char> >, monotonic::allocator<any<monotonic::allocator<char> > > > vec;
         vec v;
         v.push_back(derived(42));
- cout << "storage.used: " << monotonic::static_storage<>::used() << endl;
         v.push_back(derived2("foo"));
- cout << "storage.used: " << monotonic::static_storage<>::used() << endl;
 
         vec v2 = v;
- cout << "storage.used: " << monotonic::static_storage<>::used() << endl;
 
         BOOST_ASSERT(any_cast<derived2 &>(v2[1]).str == "foo");
 }


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