Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54453 - sandbox/monotonic/libs/monotonic/test/clones
From: christian.schladetsch_at_[hidden]
Date: 2009-06-28 03:29:38


Author: cschladetsch
Date: 2009-06-28 03:29:37 EDT (Sun, 28 Jun 2009)
New Revision: 54453
URL: http://svn.boost.org/trac/boost/changeset/54453

Log:
renamed

Added:
   sandbox/monotonic/libs/monotonic/test/clones/tests.cpp
      - copied, changed from r54452, /sandbox/monotonic/libs/monotonic/test/clones/main.cpp
Removed:
   sandbox/monotonic/libs/monotonic/test/clones/main.cpp
Text files modified:
   sandbox/monotonic/libs/monotonic/test/clones/tests.cpp | 1 -
   1 files changed, 0 insertions(+), 1 deletions(-)

Deleted: sandbox/monotonic/libs/monotonic/test/clones/main.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/clones/main.cpp 2009-06-28 03:29:37 EDT (Sun, 28 Jun 2009)
+++ (empty file)
@@ -1,93 +0,0 @@
-// (C) 2009 Christian Schladetsch
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/monotonic/doc/index.html
-// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/
-
-#include <string>
-#include <boost/heterogenous/vector.hpp>
-#include <boost/monotonic/allocator.hpp>
-
-using namespace std;
-using namespace boost;
-using namespace heterogenous;
-
-struct derived : base<derived>
-{
- int num;
- derived() : num(0) { }
- explicit derived(int n) : num(n) { }
-};
-
-struct derived2 : base<derived2>
-{
- std::string str;
-
- derived2() { }
- explicit derived2(std::string const &n) : str(n) { }
-};
-
-
-struct derived3 : base<derived3>
-{
- float real;
- int num;
- std::string str;
-
- derived3() { }
- explicit derived3(float f, int n, std::string const &s) : real(f), num(n), str(s) { }
-};
-
-int main()
-{
- // there is a problem with static_move_ptr<>
- //typedef heterogenous::vector<std::allocator<int> > vec;
- typedef heterogenous::vector<monotonic::allocator<int> > vec;
-
- {
- vec bases;
- bases.push_back<derived>(42);
- bases.push_back<derived2>("foo");
- bases.push_back<derived3>(3.14f, -123, "spam");
-
- BOOST_ASSERT(bases.size() == 3);
- vec copy = bases;
- BOOST_ASSERT(copy.size() == 3);
-
- common_base &generic0 = copy[0];
- common_base &generic1 = copy[1];
- common_base &generic2 = copy[2];
-
- derived &p1 = copy.ref_at<derived>(0);
- derived2 *p2 = copy.ptr_at<derived2>(1);
- derived3 *p3 = copy.ptr_at<derived3>(2);
-
- BOOST_ASSERT(p2);
- BOOST_ASSERT(p3);
-
- 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");
-
- bool caught = false;
- try
- {
- common_base &base = copy.ref_at<derived2>(0);
- }
- catch (std::bad_cast)
- {
- caught = true;
- }
- BOOST_ASSERT(caught);
-
- }
- monotonic::static_storage<>::release();
-
- return 0;
-}
-
-//EOF

Copied: sandbox/monotonic/libs/monotonic/test/clones/tests.cpp (from r54452, /sandbox/monotonic/libs/monotonic/test/clones/main.cpp)
==============================================================================
--- /sandbox/monotonic/libs/monotonic/test/clones/main.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/clones/tests.cpp 2009-06-28 03:29:37 EDT (Sun, 28 Jun 2009)
@@ -29,7 +29,6 @@
         explicit derived2(std::string const &n) : str(n) { }
 };
 
-
 struct derived3 : base<derived3>
 {
         float real;


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