Boost logo

Boost-Commit :

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


Author: cschladetsch
Date: 2009-06-28 04:55:26 EDT (Sun, 28 Jun 2009)
New Revision: 54458
URL: http://svn.boost.org/trac/boost/changeset/54458

Log:
changed comments

Added:
   sandbox/monotonic/boost/heterogenous/make_clone_allocator.hpp
      - copied, changed from r54455, /sandbox/monotonic/boost/heterogenous/make_cloneable_allocator.hpp
Removed:
   sandbox/monotonic/boost/heterogenous/make_cloneable_allocator.hpp
Text files modified:
   sandbox/monotonic/boost/heterogenous/make_clone_allocator.hpp | 23 ++++++++++++-----------
   sandbox/monotonic/boost/heterogenous/vector.hpp | 6 +++---
   sandbox/monotonic/boost/monotonic/allocator_base.hpp | 2 +-
   sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj | 2 +-
   4 files changed, 17 insertions(+), 16 deletions(-)

Copied: sandbox/monotonic/boost/heterogenous/make_clone_allocator.hpp (from r54455, /sandbox/monotonic/boost/heterogenous/make_cloneable_allocator.hpp)
==============================================================================
--- /sandbox/monotonic/boost/heterogenous/make_cloneable_allocator.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/make_clone_allocator.hpp 2009-06-28 04:55:26 EDT (Sun, 28 Jun 2009)
@@ -17,43 +17,44 @@
                 namespace impl
                 {
                         template <class Alloc>
- struct cloneable_allocator : Alloc, boost::abstract_allocator
+ struct clone_allocator : Alloc, abstract_allocator
                         {
                                 typedef typename Alloc::template rebind<char>::other CharAlloc;
 
                                 abstract_allocator::pointer allocate_bytes(size_t num_bytes, size_t alignment)
                                 {
- CharAlloc alloc;
- // todo: alignment; this is done already for monotonic, copy that here
+ CharAlloc alloc(*this);
+ // TODO: alignment; this is done already for monotonic, copy that here
                                         return alloc.allocate(num_bytes);
                                 }
 
                                 void deallocate_bytes(abstract_allocator::pointer ptr)
                                 {
- CharAlloc alloc;
+ CharAlloc alloc(*this);
                                         alloc.deallocate(ptr, 1);
                                 }
                         };
 
                         template <class Alloc, bool>
- struct make_cloneable_allocator
+ struct make_clone_allocator
                         {
- typedef cloneable_allocator<Alloc> type;
+ typedef clone_allocator<Alloc> type;
                         };
 
                         template <class Alloc>
- struct make_cloneable_allocator<Alloc, true>
+ struct make_clone_allocator<Alloc, true>
                         {
+ BOOST_STATIC_ASSERT(0);
                                 typedef Alloc type;
                         };
                 }
 
                 template <class Alloc>
- struct make_cloneable_allocator
+ struct make_clone_allocator
                 {
- typedef boost::is_convertible<Alloc *, boost::abstract_allocator *> is_convertible;
- BOOST_STATIC_CONSTANT(bool, is_cloneable = is_convertible::value);
- typedef typename impl::make_cloneable_allocator<Alloc, is_cloneable>::type type;
+ typedef boost::is_convertible<Alloc *, abstract_allocator *> is_convertible;
+ BOOST_STATIC_CONSTANT(bool, is_clone_alloc = is_convertible::value);
+ typedef typename impl::make_clone_allocator<Alloc, is_clone_alloc>::type type;
                 };
 
         } // namespace heterogenous

Deleted: sandbox/monotonic/boost/heterogenous/make_cloneable_allocator.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/make_cloneable_allocator.hpp 2009-06-28 04:55:26 EDT (Sun, 28 Jun 2009)
+++ (empty file)
@@ -1,67 +0,0 @@
-// Copyright (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)
-
-#ifndef BOOST_HETEROGENOUS_MAKE_CLONEABLE_ALLOCATOR_HPP
-#define BOOST_HETEROGENOUS_MAKE_CLONEABLE_ALLOCATOR_HPP
-
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/heterogenous/detail/prefix.hpp>
-#include <boost/heterogenous/allocator.hpp>
-
-namespace boost
-{
- namespace heterogenous
- {
- namespace impl
- {
- template <class Alloc>
- struct cloneable_allocator : Alloc, boost::abstract_allocator
- {
- typedef typename Alloc::template rebind<char>::other CharAlloc;
-
- abstract_allocator::pointer allocate_bytes(size_t num_bytes, size_t alignment)
- {
- CharAlloc alloc;
- // todo: alignment; this is done already for monotonic, copy that here
- return alloc.allocate(num_bytes);
- }
-
- void deallocate_bytes(abstract_allocator::pointer ptr)
- {
- CharAlloc alloc;
- alloc.deallocate(ptr, 1);
- }
- };
-
- template <class Alloc, bool>
- struct make_cloneable_allocator
- {
- typedef cloneable_allocator<Alloc> type;
- };
-
- template <class Alloc>
- struct make_cloneable_allocator<Alloc, true>
- {
- typedef Alloc type;
- };
- }
-
- template <class Alloc>
- struct make_cloneable_allocator
- {
- typedef boost::is_convertible<Alloc *, boost::abstract_allocator *> is_convertible;
- BOOST_STATIC_CONSTANT(bool, is_cloneable = is_convertible::value);
- typedef typename impl::make_cloneable_allocator<Alloc, is_cloneable>::type type;
- };
-
- } // namespace heterogenous
-
-} // namespace boost
-
-#include <boost/heterogenous/detail/suffix.hpp>
-
-#endif // BOOST_HETEROGENOUS_MAKE_CLONEABLE_ALLOCATOR_HPP
-
-//EOF

Modified: sandbox/monotonic/boost/heterogenous/vector.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/vector.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/vector.hpp 2009-06-28 04:55:26 EDT (Sun, 28 Jun 2009)
@@ -17,11 +17,11 @@
         namespace heterogenous
         {
                 /// a vector of heterogenous objects
- template <class Alloc = make_cloneable_allocator<std::allocator<char> >, class Base = common_base >
+ template <class Alloc, class Base = common_base >
                 struct vector
                 {
- typedef ptr_vector<Base, allocator, Alloc> implementation;
- typedef Alloc allocator_type;
+ typedef typename make_clone_allocator<Alloc>::type allocator_type;
+ typedef ptr_vector<Base, allocator, allocator_type> implementation;
                         typedef typename implementation::value_type value_type;
                         typedef typename implementation::reference reference_type;
                         typedef typename implementation::iterator iterator;

Modified: sandbox/monotonic/boost/monotonic/allocator_base.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/allocator_base.hpp (original)
+++ sandbox/monotonic/boost/monotonic/allocator_base.hpp 2009-06-28 04:55:26 EDT (Sun, 28 Jun 2009)
@@ -28,7 +28,7 @@
         {
                 /// common to other monotonic allocators for type T of type Derived
                 template <class T, class Derived>
- struct allocator_base : heterogenous::abstract_allocator
+ struct allocator_base// : heterogenous::abstract_allocator
                 {
                         typedef size_t size_type;
                         typedef ptrdiff_t difference_type;

Modified: sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj (original)
+++ sandbox/monotonic/libs/monotonic/test/clones/clones.vcproj 2009-06-28 04:55:26 EDT (Sun, 28 Jun 2009)
@@ -367,7 +367,7 @@
>
                                 </File>
                                 <File
- RelativePath="..\..\..\..\boost\heterogenous\make_cloneable_allocator.hpp"
+ RelativePath="..\..\..\..\boost\heterogenous\make_clone_allocator.hpp"
>
                                 </File>
                                 <File


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