Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71617 - sandbox/block_ptr/boost
From: phil_at_[hidden]
Date: 2011-04-29 22:01:01


Author: pbouchard
Date: 2011-04-29 22:01:00 EDT (Fri, 29 Apr 2011)
New Revision: 71617
URL: http://svn.boost.org/trac/boost/changeset/71617

Log:
* Unmade constructor and assignment operator of raw pointer public
Text files modified:
   sandbox/block_ptr/boost/block_ptr.hpp | 84 +++++++++++++++++++--------------------
   1 files changed, 41 insertions(+), 43 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 22:01:00 EDT (Fri, 29 Apr 2011)
@@ -247,6 +247,47 @@
             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();
 
@@ -306,29 +347,6 @@
 
 
                 /**
- 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.
@@ -360,26 +378,6 @@
                 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