`_
+.. raw:: html
+
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/examples.html b/doc/examples.html
index c422c11..e493b89 100644
--- a/doc/examples.html
+++ b/doc/examples.html
@@ -308,7 +308,9 @@ ul.auto-toc {
my_container.push_back( 0 ); // throws bad_ptr
my_container.replace( an_iterator, 0 ); // throws bad_ptr
-my_container.insert( an_iterator, 0 ); // throws bad_ptr
+my_container.insert( an_iterator, 0 ); // throws bad_ptr
+std::auto_ptr<T> p( 0 );
+my_container.push_back( p ); // throws bad_ptr
@@ -342,7 +344,7 @@ ptr_vector<T> vec3( vec1 ); // compile time error: copy-constructo
// a class that has no normal copy semantics
class X : boost::noncopyable { public: X* clone() const; ... };
-// this will be found by the library by argument dependent lookup
+// this will be found by the library by argument dependent lookup (ADL)
X* new_clone( const X& x )
{ return x.clone(); }
@@ -359,10 +361,12 @@ vec2.insert( vec2.end(), vec1.begin(), vec1.end() ); // inserting always means i
class X { ... }; // assume 'X' is Clonable
X x; // and 'X' can be stack-allocated
ptr_list<X> list;
-list.push_back( x ); // clone 'x' and then insert the resulting pointer
-list.push_back( new_clone( x ); // do it manually
+list.push_back( new_clone( x ) ); // insert a clone
list.push_back( new X ); // always give the pointer directly to the container to avoid leaks
list.push_back( &x ); // don't do this!!!
+std::auto_ptr<X> p( new X );
+list.push_back( p ); // give up ownership
+BOOST_ASSERT( p.get() == 0 );
@@ -376,6 +380,8 @@ typedef ptr_deque<T>::auto_type auto_type;
auto_type ptr = deq.release_back(); // remove back element from container and give up ownership
auto_type ptr2 = deq.release( deq.begin() + 2 ); // use an iterator to determine the element to release
ptr = deq.release_front(); // supported for 'ptr_list' and 'ptr_deque'
+
+deq.push_back( ptr.release() ); // give ownership back to the container
@@ -389,6 +395,7 @@ ptr_list<X> list; ptr_vector<X> vec;
list.transfer( list.begin(), vec.begin(), vec ); // make the first element of 'vec' the first element of 'list'
vec.transfer( vec.end(), list.begin(), list.end(), list ); // put all the lists element into the vector
+
We can also transfer objects from ptr_container<Derived> to ptr_container<Base without any problems.
@@ -396,6 +403,8 @@ vec.transfer( vec.end(), list.begin(), list.end(), list ); // put all the lists
+| tutorial.cpp: | A larger example with lots of comments. |
+
| incomplete_type_test.cpp: |
| | Shows how to implement the Composite pattern. |
@@ -430,12 +439,12 @@ as view into other containers:
.. raw:: html
:file: tut2.html -->
-Navigate:
+
Navigate:
-
+
diff --git a/doc/examples.rst b/doc/examples.rst
index c8fbc83..97bcd77 100755
--- a/doc/examples.rst
+++ b/doc/examples.rst
@@ -22,7 +22,9 @@ Some examples are given here and in the accompanying test files:
my_container.push_back( 0 ); // throws bad_ptr
my_container.replace( an_iterator, 0 ); // throws bad_ptr
- my_container.insert( an_iterator, 0 ); // throws bad_ptr
+ my_container.insert( an_iterator, 0 ); // throws bad_ptr
+ std::auto_ptr p( 0 );
+ my_container.push_back( p ); // throws bad_ptr
.. _`Example 2`:
@@ -67,7 +69,7 @@ Some examples are given here and in the accompanying test files:
// a class that has no normal copy semantics
class X : boost::noncopyable { public: X* clone() const; ... };
- // this will be found by the library by argument dependent lookup
+ // this will be found by the library by argument dependent lookup (ADL)
X* new_clone( const X& x )
{ return x.clone(); }
@@ -88,10 +90,12 @@ Some examples are given here and in the accompanying test files:
class X { ... }; // assume 'X' is Clonable
X x; // and 'X' can be stack-allocated
ptr_list list;
- list.push_back( x ); // clone 'x' and then insert the resulting pointer
- list.push_back( new_clone( x ); // do it manually
+ list.push_back( new_clone( x ) ); // insert a clone
list.push_back( new X ); // always give the pointer directly to the container to avoid leaks
list.push_back( &x ); // don't do this!!!
+ std::auto_ptr p( new X );
+ list.push_back( p ); // give up ownership
+ BOOST_ASSERT( p.get() == 0 );
.. _`Example 6`:
@@ -110,7 +114,8 @@ Some examples are given here and in the accompanying test files:
auto_type ptr2 = deq.release( deq.begin() + 2 ); // use an iterator to determine the element to release
ptr = deq.release_front(); // supported for 'ptr_list' and 'ptr_deque'
-
+ deq.push_back( ptr.release() ); // give ownership back to the container
+
.. _`Example 7`:
@@ -127,7 +132,8 @@ Some examples are given here and in the accompanying test files:
//
list.transfer( list.begin(), vec.begin(), vec ); // make the first element of 'vec' the first element of 'list'
vec.transfer( vec.end(), list.begin(), list.end(), list ); // put all the lists element into the vector
-
+
+We can also transfer objects from ``ptr_container`` to ``ptr_container`_: A larger example with lots of comments.
:incomplete_type_test.cpp_: Shows how to implement the Composite pattern.
:simple_test.cpp_: Shows how the usage of pointer container compares with a
container of pointer pointers
@@ -170,10 +177,18 @@ Some examples are given here and in the accompanying test files:
.. raw:: html
:file: tut2.html
+.. raw:: html
+
+
+
**Navigate:**
- `home `_
- `reference `_
+.. raw:: html
+
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/faq.html b/doc/faq.html
index dab1fce..5cf49f9 100644
--- a/doc/faq.html
+++ b/doc/faq.html
@@ -378,7 +378,7 @@ these references: [11]
Storing a null-pointer among a list of pointers does not fit well into the Object Oriented paradigm.
The most elegant design is to use the Null-Object Pattern where one basically makes a concrete
class with dummy implementations of the virtual functions. See [13] for details.
-
+
diff --git a/doc/faq.rst b/doc/faq.rst
index 9c60b16..ea0b7b8 100755
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -4,7 +4,7 @@
.. |Boost| image:: boost.png
-===
+
FAQ
===
@@ -98,6 +98,9 @@ Storing a null-pointer among a list of pointers does not fit well into the Objec
The most elegant design is to use the Null-Object Pattern where one basically makes a concrete
class with dummy implementations of the virtual functions. See `[13] `_ for details.
+.. raw:: html
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/guidelines.html b/doc/guidelines.html
index 8aff40b..fe2c793 100644
--- a/doc/guidelines.html
+++ b/doc/guidelines.html
@@ -414,12 +414,12 @@ your OO-code still does not need to worry about null-pointers.
Finally you might end up in a situation where not even the Null Object can help
you. That is when you truly need container< nullable<T> >.
-Navigate:
+
Navigate:
-
+
diff --git a/doc/guidelines.rst b/doc/guidelines.rst
index 6683513..a95f9aa 100755
--- a/doc/guidelines.rst
+++ b/doc/guidelines.rst
@@ -142,10 +142,18 @@ You might want to read
Finally you might end up in a situation where not even the Null Object can help
you. That is when you truly need ``container< nullable >``.
+.. raw:: html
+
+
+
**Navigate:**
- `home `_
- `reference `_
+.. raw:: html
+
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/headers.html b/doc/headers.html
index b4b891c..10027d8 100644
--- a/doc/headers.html
+++ b/doc/headers.html
@@ -334,16 +334,16 @@ and functions new_clone()<
| <boost/ptr_container/exception.hpp> |
-- classes bad_ptr_container_operation, bad_index
-- and bad_pointer
+- classes bad_ptr_container_operation, bad_index
+- and bad_pointer
|
| <boost/ptr_container/indirect_fun.hpp> |
-class indirect_fun |
+class indirect_fun |
| <boost/ptr_container/nullable.hpp> |
-class nullable |
+class nullable |
@@ -352,7 +352,7 @@ and functions new_clone()<
home
reference
-
+
diff --git a/doc/headers.rst b/doc/headers.rst
index 5dcb2f0..a618847 100755
--- a/doc/headers.rst
+++ b/doc/headers.rst
@@ -34,21 +34,30 @@ Library headers
```` classes `ptr_map_adapter `_ and `ptr_multimap_adapter `_
-```` classes ``bad_ptr_container_operation``, ``bad_index``
- and ``bad_pointer``
-```` class ``indirect_fun``
+```` classes `bad_ptr_container_operation`_, `bad_index`_
+ and `bad_pointer`_
+```` class `indirect_fun`_
-```` class ``nullable``
+```` class `nullable`_
======================================================= =============================================================
.. _`heap_clone_allocator`: reference.html#the-clone-allocator-concept
.. _`view_clone_allocator`: reference.html#the-clone-allocator-concept
+.. _`bad_ptr_container_operation`: reference.html#exception-classes
+.. _`bad_index`: reference.html#exception-classes
+.. _`bad_pointer`: reference.html#exception-classes
+.. _`nullable`: reference.html#class-nullable
+.. _`indirect_fun`: indirect_fun.html
+
**Navigate:**
- `home `_
- `reference `_
+.. raw:: html
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/indirect_fun.html b/doc/indirect_fun.html
index 4f07e5b..c0d0079 100644
--- a/doc/indirect_fun.html
+++ b/doc/indirect_fun.html
@@ -401,7 +401,7 @@ namespace boost
} // namespace 'boost'
-
+
diff --git a/doc/indirect_fun.rst b/doc/indirect_fun.rst
index 8219b5d..500237d 100755
--- a/doc/indirect_fun.rst
+++ b/doc/indirect_fun.rst
@@ -125,6 +125,9 @@ first operation is expanded inline.
} // namespace 'boost'
+.. raw:: html
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/ptr_array.html b/doc/ptr_array.html
index 8aeca8e..67cc647 100644
--- a/doc/ptr_array.html
+++ b/doc/ptr_array.html
@@ -293,12 +293,19 @@ ul.auto-toc {
A ptr_array<T,size> is a pointer container that uses an underlying boost::array<void*,size>
to store the pointers. The class is useful when there is no requirement
-of dynamic expansion and when absolute no overhead is tolerable.
-See also:
+of dynamic expansion and when no overhead is tolerable.
+Hierarchy:
Navigate:
@@ -545,7 +552,7 @@ namespace boost
-
+
diff --git a/doc/ptr_array.rst b/doc/ptr_array.rst
index fd4debf..c987fcd 100755
--- a/doc/ptr_array.rst
+++ b/doc/ptr_array.rst
@@ -9,17 +9,18 @@ Class ``ptr_array``
A ``ptr_array`` is a pointer container that uses an underlying ``boost::array``
to store the pointers. The class is useful when there is no requirement
-of dynamic expansion and when absolute no overhead is tolerable.
+of dynamic expansion and when no overhead is tolerable.
-**See also:**
+**Hierarchy:**
-- reversible_ptr_container_
-- ptr_sequence_adapter_
-- ptr_vector_
+- `reversible_ptr_container `_
-.. _reversible_ptr_container: reversible_ptr_container.html
-.. _ptr_sequence_adapter: ptr_sequence_adapter.html
-.. _ptr_vector: ptr_vector.html
+ - `ptr_sequence_adapter `_
+
+ - `ptr_vector `_
+ - `ptr_list `_
+ - `ptr_deque `_
+ - ``ptr_array``
**Navigate:**
@@ -250,5 +251,9 @@ Semantics: pointer container requirements
- Exception safety: Nothrow guarantee
+.. raw:: html
+
+
+
:Copyright: Thorsten Ottosen 2004-2006.
diff --git a/doc/ptr_container.html b/doc/ptr_container.html
index 94906a2..398e666 100644
--- a/doc/ptr_container.html
+++ b/doc/ptr_container.html
@@ -6,7 +6,7 @@
Boost Pointer Container Library
-
+