Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71616 - sandbox/block_ptr/boost
From: phil_at_[hidden]
Date: 2011-04-29 21:56:00


Author: pbouchard
Date: 2011-04-29 21:55:59 EDT (Fri, 29 Apr 2011)
New Revision: 71616
URL: http://svn.boost.org/trac/boost/changeset/71616

Log:
* Remade construxctor and assignment operator of raw pointer public
Text files modified:
   sandbox/block_ptr/boost/block_ptr.hpp | 84 ++++++++++++++++++++-------------------
   1 files changed, 43 insertions(+), 41 deletions(-)

Modified: sandbox/block_ptr/boost/block_ptr.hpp
==============================================================================
--- sandbox/block_ptr/boost/block_ptr.hpp (original)
+++ sandbox/block_ptr/boost/block_ptr.hpp 2011-04-29 21:55:59 EDT (Fri, 29 Apr 2011)
@@ -247,47 +247,6 @@
             intrusive_stack::node pn_; /**< Tag used for enlisting a pointer on the heap to later share the @c block_header it belongs to. */
         };
 
- /**
- Initialization of a pointer living on the stack or proper enlistment if living on the heap.
-
- @param p New pointee object to manage.
- */
-
- template <typename V>
- block_ptr(block<V> * p) : base(p)
- {
- if (! block_base::pool_.is_from(this))
- {
- ps_ = new block_header();
-
- init(p);
- }
- else
- {
- block_base::pool_.top(this)->ptrs_.push(& pn_);
- block_base::pool_.top(this)->inits_.merge(p->inits_);
- }
- }
-
-
- /**
- Assignment & union of 2 sets if the pointee resides a different @c block_header.
-
- @param p New pointee object to manage.
- */
-
- template <typename V>
- block_ptr & operator = (block<V> * p)
- {
- release(false);
-
- init(p);
-
- base::operator = (p);
-
- return * this;
- }
-
                 template <typename V>
                         friend block_ptr<V> make_block();
 
@@ -347,6 +306,29 @@
 
 
                 /**
+ Initialization of a pointer living on the stack or proper enlistment if living on the heap.
+
+ @param p New pointee object to manage.
+ */
+
+ template <typename V>
+ block_ptr(block<V> * p) : base(p)
+ {
+ if (! block_base::pool_.is_from(this))
+ {
+ ps_ = new block_header();
+
+ init(p);
+ }
+ else
+ {
+ block_base::pool_.top(this)->ptrs_.push(& pn_);
+ block_base::pool_.top(this)->inits_.merge(p->inits_);
+ }
+ }
+
+
+ /**
                         Assignment & union of 2 sets if the pointee resides a different @c block_header.
                         
                         @param p New pointer to manage.
@@ -378,6 +360,26 @@
                 return operator = <T>(p);
             }
 
+
+ /**
+ Assignment & union of 2 sets if the pointee resides a different @c block_header.
+
+ @param p New pointee object to manage.
+ */
+
+ template <typename V>
+ block_ptr & operator = (block<V> * p)
+ {
+ release(false);
+
+ init(p);
+
+ base::operator = (p);
+
+ return * this;
+ }
+
+
         void reset()
         {
             release(false);


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