Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54519 - in sandbox/monotonic: boost/heterogenous libs/monotonic/test/clones
From: christian.schladetsch_at_[hidden]
Date: 2009-06-30 01:12:48


Author: cschladetsch
Date: 2009-06-30 01:12:48 EDT (Tue, 30 Jun 2009)
New Revision: 54519
URL: http://svn.boost.org/trac/boost/changeset/54519

Log:
renamed base<> to cloneable<>

Text files modified:
   sandbox/monotonic/boost/heterogenous/adaptor.hpp | 6 ++++--
   sandbox/monotonic/boost/heterogenous/base.hpp | 8 ++++----
   sandbox/monotonic/boost/heterogenous/forward_declarations.hpp | 2 +-
   sandbox/monotonic/libs/monotonic/test/clones/tests.cpp | 28 ++++++++++++++--------------
   4 files changed, 23 insertions(+), 21 deletions(-)

Modified: sandbox/monotonic/boost/heterogenous/adaptor.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/adaptor.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/adaptor.hpp 2009-06-30 01:12:48 EDT (Tue, 30 Jun 2009)
@@ -15,9 +15,11 @@
         {
                 /// an adaptor for an existing class
                 ///
- /// this is a type that can be used correctly in an homogenous container
+ /// this is a type that can be used in an homogenous container
+ ///
+ /// ...this may or may not be a good idea...
                 template <class T, class Base, class AbstractBase>
- struct adaptor : T, base<adaptor<T,Base,AbstractBase>, Base, AbstractBase>
+ struct adaptor : T, cloneable<adaptor<T, Base, AbstractBase>, Base, AbstractBase>
                 {
                         adaptor() { }
 

Modified: sandbox/monotonic/boost/heterogenous/base.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/base.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/base.hpp 2009-06-30 01:12:48 EDT (Tue, 30 Jun 2009)
@@ -17,19 +17,19 @@
                 /// base for the given derived type, using the given base class
                 /// TODO: rename this - perhaps to 'cloneable'?
                 template <class Derived, class Base, class AbstractBase>
- struct base : AbstractBase
+ struct cloneable : AbstractBase
                 {
                         typedef Derived derived_type;
                         typedef Base base_type;
                         typedef AbstractBase abstract_base_type;
- typedef base<Derived, Base, AbstractBase> this_type;
+ typedef cloneable<Derived, Base, AbstractBase> this_type;
 
                 private:
                         static size_t alignment; ///< required alignment for allocation
                         mutable derived_type *self_ptr; ///< pointer to derived object in this
 
                 public:
- base() : self_ptr(0) { }
+ cloneable() : self_ptr(0) { }
 
                         virtual this_type *allocate(abstract_allocator &alloc) const
                         {
@@ -62,7 +62,7 @@
 
                 /// ensure correct alignment when allocating derived instances
                 template <class Derived, class Base, class AbstractBase>
- size_t base<Derived, Base, AbstractBase>::alignment = aligned_storage<sizeof(Derived)>::alignment;
+ size_t cloneable<Derived, Base, AbstractBase>::alignment = aligned_storage<sizeof(Derived)>::alignment;
 
         } // namespace heterogenous
 

Modified: sandbox/monotonic/boost/heterogenous/forward_declarations.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/forward_declarations.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/forward_declarations.hpp 2009-06-30 01:12:48 EDT (Tue, 30 Jun 2009)
@@ -25,7 +25,7 @@
                         class Derived
                         , class Base = default_base_type
                         , class AbstractBase = abstract_base<Base> >
- struct base;
+ struct cloneable;
 
                 /// an adaptor for an existing class.
                 ///

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-30 01:12:48 EDT (Tue, 30 Jun 2009)
@@ -24,14 +24,14 @@
         virtual ~my_base() { }
 };
 
-struct derived : base<derived, my_base>
+struct derived : cloneable<derived, my_base>
 {
         int num;
         derived() : num(0) { }
         derived(int n) : num(n) { }
 };
 
-struct derived2 : base<derived2, my_base>
+struct derived2 : cloneable<derived2, my_base>
 {
         std::string str;
 
@@ -39,7 +39,7 @@
         derived2(std::string const &n) : str(n) { }
 };
 
-struct derived3 : base<derived3, my_base>
+struct derived3 : cloneable<derived3, my_base>
 {
         float real;
         int num;
@@ -59,11 +59,11 @@
 {
 };
 
-struct derived4 : derived4_impl, base<derived4>
+struct derived4 : derived4_impl, cloneable<derived4>
 {
 };
 
-struct derived5 : derived4_impl, base<derived5>
+struct derived5 : derived4_impl, cloneable<derived5>
 {
 };
 
@@ -81,8 +81,8 @@
                 virtual ~my_base() { }
         };
 
- struct T0 : base<T0, my_base> { };
- struct T1 : base<T1, my_base> { };
+ struct T0 : cloneable<T0, my_base> { };
+ struct T1 : cloneable<T1, my_base> { };
 
         void run()
         {
@@ -105,7 +105,7 @@
 };
 
 /// make an adaptor type, which makes `ExternalType` heterogenous
-typedef heterogenous::adaptor<ExternalType, my_base> T4;
+typedef heterogenous::adaptor<ExternalType, my_base> ExternalType_;
 
 int main()
 {
@@ -126,7 +126,7 @@
                 bases.emplace_back<derived>(42);
                 bases.emplace_back<derived2>("foo");
                 bases.emplace_back<derived3>(3.14f, -123, "spam");
- bases.emplace_back<T4>("external");
+ bases.emplace_back<ExternalType_>("external");
 
                 // perform functor on each contained object of the given type
                 bases.for_each<derived3>(boost::bind(&derived3::print, _1));
@@ -152,7 +152,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(copy.ref_at<T4>(3).text == "external");
+ BOOST_ASSERT(copy.ref_at<ExternalType_>(3).text == "external");
 
                 bool caught = false;
                 try
@@ -207,19 +207,19 @@
         virtual ~my_base2() { }
 };
 
-struct T0 : heterogenous::base<T0, my_base2>
+struct T0 : heterogenous::cloneable<T0, my_base2>
 {
 };
 
-struct T1 : heterogenous::base<T1, my_base2>
+struct T1 : heterogenous::cloneable<T1, my_base2>
 {
 };
 
-struct T2 : heterogenous::base<T2, my_base2>
+struct T2 : heterogenous::cloneable<T2, my_base2>
 {
 };
 
-struct T3 : heterogenous::base<T3, my_base2>
+struct T3 : heterogenous::cloneable<T3, my_base2>
 {
 };
 


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