From adc94a80adbb7b720bd149c8b805876baa77b815 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 5 Aug 2020 11:28:26 +0100 Subject: [PATCH] Fix invalid XHTML markup in docs The reStructuredText files insert
HTML elements, which are not valid in XHTML. The doc/tutorial_example.html file contains unquoted attributes and unclosed and tags (although since that file is included into another document, it probably shouldn't have , and elements at all). --- doc/associative_ptr_container.html | 2 +- doc/associative_ptr_container.rst | 2 +- doc/examples.html | 2 +- doc/examples.rst | 4 +- doc/faq.html | 2 +- doc/faq.rst | 2 +- doc/guidelines.html | 4 +- doc/guidelines.rst | 4 +- doc/headers.html | 2 +- doc/headers.rst | 2 +- doc/indirect_fun.html | 2 +- doc/indirect_fun.rst | 2 +- doc/ptr_array.html | 2 +- doc/ptr_array.rst | 2 +- doc/ptr_container.html | 2 +- doc/ptr_container.rst | 2 +- doc/ptr_deque.html | 2 +- doc/ptr_deque.rst | 2 +- doc/ptr_inserter.html | 2 +- doc/ptr_inserter.rst | 2 +- doc/ptr_list.html | 2 +- doc/ptr_list.rst | 2 +- doc/ptr_map.html | 2 +- doc/ptr_map.rst | 2 +- doc/ptr_map_adapter.html | 2 +- doc/ptr_map_adapter.rst | 2 +- doc/ptr_multimap_adapter.html | 2 +- doc/ptr_multimap_adapter.rst | 2 +- doc/ptr_multiset.html | 2 +- doc/ptr_multiset.rst | 2 +- doc/ptr_multiset_adapter.html | 2 +- doc/ptr_multiset_adapter.rst | 2 +- doc/ptr_sequence_adapter.html | 2 +- doc/ptr_sequence_adapter.rst | 2 +- doc/ptr_set.html | 2 +- doc/ptr_set.rst | 2 +- doc/ptr_set_adapter.html | 2 +- doc/ptr_set_adapter.rst | 2 +- doc/ptr_vector.html | 2 +- doc/ptr_vector.rst | 2 +- doc/reference.html | 4 +- doc/reference.rst | 4 +- doc/reversible_ptr_container.html | 2 +- doc/reversible_ptr_container.rst | 2 +- doc/tutorial.html | 4 +- doc/tutorial.rst | 4 +- doc/tutorial_example.html | 384 ++++++++++++++--------------- 47 files changed, 245 insertions(+), 245 deletions(-) diff --git a/doc/associative_ptr_container.html b/doc/associative_ptr_container.html index ccc4d9fa..9467864f 100644 --- a/libs/ptr_container/doc/associative_ptr_container.html +++ b/libs/ptr_container/doc/associative_ptr_container.html @@ -529,7 +529,7 @@

+
diff --git a/doc/associative_ptr_container.rst b/doc/associative_ptr_container.rst index b9b8d45a..6dcd0833 100644 --- a/libs/ptr_container/doc/associative_ptr_container.rst +++ b/libs/ptr_container/doc/associative_ptr_container.rst @@ -216,7 +216,7 @@ Semantics: algorithms .. raw:: html -
+
:Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/examples.html b/doc/examples.html index 5568b323..dbc8ce2b 100644 --- a/libs/ptr_container/doc/examples.html +++ b/libs/ptr_container/doc/examples.html @@ -886,7 +886,7 @@

9. A large example

  • home
  • reference
  • -
    +
    diff --git a/doc/examples.rst b/doc/examples.rst index 213094bf..d82f4b85 100644 --- a/libs/ptr_container/doc/examples.rst +++ b/libs/ptr_container/doc/examples.rst @@ -180,7 +180,7 @@ The source code can also be found `here <../test/tut1.cpp>`_. .. raw:: html -
    +
    **Navigate:** @@ -189,7 +189,7 @@ The source code can also be found `here <../test/tut1.cpp>`_. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/faq.html b/doc/faq.html index f318483b..1d701131 100644 --- a/libs/ptr_container/doc/faq.html +++ b/libs/ptr_container/doc/faq.html @@ -373,7 +373,7 @@

    [13] for details.

    -

    +
    diff --git a/doc/faq.rst b/doc/faq.rst index 40c8eb2d..e2ead8d7 100644 --- a/libs/ptr_container/doc/faq.rst +++ b/libs/ptr_container/doc/faq.rst @@ -95,7 +95,7 @@ class with dummy implementations of the virtual functions. See `[13] +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/guidelines.html b/doc/guidelines.html index 759b6259..25d1f148 100644 --- a/libs/ptr_container/doc/guidelines.html +++ b/libs/ptr_container/doc/guidelines.html @@ -414,12 +414,12 @@

    container< nullable<T> >.

    -

    Navigate:

    +

    Navigate:

    -

    +
    diff --git a/doc/guidelines.rst b/doc/guidelines.rst index 1c39c7ba..bf69dac8 100644 --- a/libs/ptr_container/doc/guidelines.rst +++ b/libs/ptr_container/doc/guidelines.rst @@ -144,7 +144,7 @@ you. That is when you truly need ``container< nullable >``. .. raw:: html -
    +
    **Navigate:** @@ -153,7 +153,7 @@ you. That is when you truly need ``container< nullable >``. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/headers.html b/doc/headers.html index 4b040825..aa1609ab 100644 --- a/libs/ptr_container/doc/headers.html +++ b/libs/ptr_container/doc/headers.html @@ -375,7 +375,7 @@

    Library headers

  • home
  • reference
  • -
    +
    diff --git a/doc/headers.rst b/doc/headers.rst index befcbb55..8c8e8ded 100644 --- a/libs/ptr_container/doc/headers.rst +++ b/libs/ptr_container/doc/headers.rst @@ -75,7 +75,7 @@ Library headers .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/indirect_fun.html b/doc/indirect_fun.html index a0446472..acc13346 100644 --- a/libs/ptr_container/doc/indirect_fun.html +++ b/libs/ptr_container/doc/indirect_fun.html @@ -401,7 +401,7 @@

    Indirected functions

    } // namespace 'boost' -
    +
    diff --git a/doc/indirect_fun.rst b/doc/indirect_fun.rst index 5fd13df2..f6583d90 100644 --- a/libs/ptr_container/doc/indirect_fun.rst +++ b/libs/ptr_container/doc/indirect_fun.rst @@ -127,7 +127,7 @@ first operation is expanded inline. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_array.html b/doc/ptr_array.html index 30da95f7..483fcfa4 100644 --- a/libs/ptr_container/doc/ptr_array.html +++ b/libs/ptr_container/doc/ptr_array.html @@ -660,7 +660,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_array.rst b/doc/ptr_array.rst index 68c2b47b..a7390236 100644 --- a/libs/ptr_container/doc/ptr_array.rst +++ b/libs/ptr_container/doc/ptr_array.rst @@ -281,7 +281,7 @@ Semantics: pointer container requirements .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_container.html b/doc/ptr_container.html index 5672bdfd..77a89a35 100644 --- a/libs/ptr_container/doc/ptr_container.html +++ b/libs/ptr_container/doc/ptr_container.html @@ -735,7 +735,7 @@

    References

    [13]Kevlin Henney, Null Object, 2002.
    -
    +
    diff --git a/doc/ptr_container.rst b/doc/ptr_container.rst index 0436cce7..257a2fda 100644 --- a/libs/ptr_container/doc/ptr_container.rst +++ b/libs/ptr_container/doc/ptr_container.rst @@ -384,7 +384,7 @@ __ http://www.two-sdg.demon.co.uk/curbralan/papers/europlop/NullObject.pdf .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. diff --git a/doc/ptr_deque.html b/doc/ptr_deque.html index 5216aa0e..bc996969 100644 --- a/libs/ptr_container/doc/ptr_deque.html +++ b/libs/ptr_container/doc/ptr_deque.html @@ -526,7 +526,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_deque.rst b/doc/ptr_deque.rst index 020ba362..a2a2cc99 100644 --- a/libs/ptr_container/doc/ptr_deque.rst +++ b/libs/ptr_container/doc/ptr_deque.rst @@ -170,7 +170,7 @@ Semantics: pointer container requirements .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_inserter.html b/doc/ptr_inserter.html index 9fb05a8a..92e4a527 100644 --- a/libs/ptr_container/doc/ptr_inserter.html +++ b/libs/ptr_container/doc/ptr_inserter.html @@ -348,7 +348,7 @@

    Insert Iterators

    } // namespace 'ptr_container' } // namespace 'boost' -
    +
    diff --git a/doc/ptr_inserter.rst b/doc/ptr_inserter.rst index 574bbdad..ef1c820b 100644 --- a/libs/ptr_container/doc/ptr_inserter.rst +++ b/libs/ptr_container/doc/ptr_inserter.rst @@ -70,7 +70,7 @@ can be transfered as well. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2008. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_list.html b/doc/ptr_list.html index 1a8e6798..c76aeaf9 100644 --- a/libs/ptr_container/doc/ptr_list.html +++ b/libs/ptr_container/doc/ptr_list.html @@ -500,7 +500,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_list.rst b/doc/ptr_list.rst index 302049d0..2eceb9d7 100644 --- a/libs/ptr_container/doc/ptr_list.rst +++ b/libs/ptr_container/doc/ptr_list.rst @@ -146,7 +146,7 @@ Semantics: list operations .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_map.html b/doc/ptr_map.html index e5fd2c9c..bc75e5cb 100644 --- a/libs/ptr_container/doc/ptr_map.html +++ b/libs/ptr_container/doc/ptr_map.html @@ -342,7 +342,7 @@

    Class -

    +
    diff --git a/doc/ptr_map.rst b/doc/ptr_map.rst index 6b50a2ba..64113937 100644 --- a/libs/ptr_container/doc/ptr_map.rst +++ b/libs/ptr_container/doc/ptr_map.rst @@ -63,7 +63,7 @@ to store the pointers. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_map_adapter.html b/doc/ptr_map_adapter.html index 2ed30539..b451914c 100644 --- a/libs/ptr_container/doc/ptr_map_adapter.html +++ b/libs/ptr_container/doc/ptr_map_adapter.html @@ -556,7 +556,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_map_adapter.rst b/doc/ptr_map_adapter.rst index 517ea7fc..aabf5c4e 100644 --- a/libs/ptr_container/doc/ptr_map_adapter.rst +++ b/libs/ptr_container/doc/ptr_map_adapter.rst @@ -194,7 +194,7 @@ Semantics: pointer container requirements .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_multimap_adapter.html b/doc/ptr_multimap_adapter.html index 3780ec8c..49243a16 100644 --- a/libs/ptr_container/doc/ptr_multimap_adapter.html +++ b/libs/ptr_container/doc/ptr_multimap_adapter.html @@ -540,7 +540,7 @@

    Semantics: typedefs

    -
    +
    diff --git a/doc/ptr_multimap_adapter.rst b/doc/ptr_multimap_adapter.rst index 3b9e9961..56d37f5d 100644 --- a/libs/ptr_container/doc/ptr_multimap_adapter.rst +++ b/libs/ptr_container/doc/ptr_multimap_adapter.rst @@ -189,7 +189,7 @@ Semantics: pointer container requirements .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_multiset.html b/doc/ptr_multiset.html index a82a7995..50fa9681 100644 --- a/libs/ptr_container/doc/ptr_multiset.html +++ b/libs/ptr_container/doc/ptr_multiset.html @@ -349,7 +349,7 @@

    Class
    • Using nullable<T> as Key is meaningless and is not allowed
    -

    +
    diff --git a/doc/ptr_multiset.rst b/doc/ptr_multiset.rst index 120891bd..3af8bef3 100644 --- a/libs/ptr_container/doc/ptr_multiset.rst +++ b/libs/ptr_container/doc/ptr_multiset.rst @@ -70,7 +70,7 @@ to store the pointers. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_multiset_adapter.html b/doc/ptr_multiset_adapter.html index 6bcfebb1..96e811d1 100644 --- a/libs/ptr_container/doc/ptr_multiset_adapter.html +++ b/libs/ptr_container/doc/ptr_multiset_adapter.html @@ -491,7 +491,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_multiset_adapter.rst b/doc/ptr_multiset_adapter.rst index eb9eafe2..8c437fb1 100644 --- a/libs/ptr_container/doc/ptr_multiset_adapter.rst +++ b/libs/ptr_container/doc/ptr_multiset_adapter.rst @@ -134,7 +134,7 @@ Semantics: pointer container requirements .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_sequence_adapter.html b/doc/ptr_sequence_adapter.html index aa2e7a42..9c4af800 100644 --- a/libs/ptr_container/doc/ptr_sequence_adapter.html +++ b/libs/ptr_container/doc/ptr_sequence_adapter.html @@ -827,7 +827,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_sequence_adapter.rst b/doc/ptr_sequence_adapter.rst index 5640d029..d98684c1 100644 --- a/libs/ptr_container/doc/ptr_sequence_adapter.rst +++ b/libs/ptr_container/doc/ptr_sequence_adapter.rst @@ -443,7 +443,7 @@ contain any nulls*. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_set.html b/doc/ptr_set.html index 8e66779f..1a5a37b0 100644 --- a/libs/ptr_container/doc/ptr_set.html +++ b/libs/ptr_container/doc/ptr_set.html @@ -350,7 +350,7 @@

    Class
  • Using nullable<T> as Key is meaningless and is not allowed
  • -

    +
    diff --git a/doc/ptr_set.rst b/doc/ptr_set.rst index 6679a8b2..5fb83d1e 100644 --- a/libs/ptr_container/doc/ptr_set.rst +++ b/libs/ptr_container/doc/ptr_set.rst @@ -72,7 +72,7 @@ to store the pointers. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_set_adapter.html b/doc/ptr_set_adapter.html index 12820d38..e32501da 100644 --- a/libs/ptr_container/doc/ptr_set_adapter.html +++ b/libs/ptr_container/doc/ptr_set_adapter.html @@ -491,7 +491,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_set_adapter.rst b/doc/ptr_set_adapter.rst index bb19e148..7b89c184 100644 --- a/libs/ptr_container/doc/ptr_set_adapter.rst +++ b/libs/ptr_container/doc/ptr_set_adapter.rst @@ -136,7 +136,7 @@ Semantics: pointer container requirements .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/ptr_vector.html b/doc/ptr_vector.html index def2a569..150c9a71 100644 --- a/libs/ptr_container/doc/ptr_vector.html +++ b/libs/ptr_container/doc/ptr_vector.html @@ -550,7 +550,7 @@

    Semantics

    -
    +
    diff --git a/doc/ptr_vector.rst b/doc/ptr_vector.rst index 374166f2..575a5679 100644 --- a/libs/ptr_container/doc/ptr_vector.rst +++ b/libs/ptr_container/doc/ptr_vector.rst @@ -185,7 +185,7 @@ Semantics: C-array support .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2007. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/reference.html b/doc/reference.html index 1ae18479..653b4324 100644 --- a/libs/ptr_container/doc/reference.html +++ b/libs/ptr_container/doc/reference.html @@ -797,11 +797,11 @@

    BOOST_NO_EXCEPTIONS is defined, then BOOST_PTR_CONTAINER_NO_EXCEPTIONS is also defined.

    -

    Navigate:

    +

    Navigate:

    -

    +
    diff --git a/doc/reference.rst b/doc/reference.rst index 3dffbc68..0b827e0e 100644 --- a/libs/ptr_container/doc/reference.rst +++ b/libs/ptr_container/doc/reference.rst @@ -486,7 +486,7 @@ is also defined. .. raw:: html -
    +
    **Navigate:** @@ -494,7 +494,7 @@ is also defined. .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2007. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/reversible_ptr_container.html b/doc/reversible_ptr_container.html index ede30c57..e45fcde8 100644 --- a/libs/ptr_container/doc/reversible_ptr_container.html +++ b/libs/ptr_container/doc/reversible_ptr_container.html @@ -885,7 +885,7 @@

    Semantics

    Boost.Serialization
  • Exception safety: Loading gives the basic guarantee
  • -
    +
    diff --git a/doc/reversible_ptr_container.rst b/doc/reversible_ptr_container.rst index 360f7d97..4fb24163 100644 --- a/libs/ptr_container/doc/reversible_ptr_container.rst +++ b/libs/ptr_container/doc/reversible_ptr_container.rst @@ -506,7 +506,7 @@ All containers can be serialized by means of .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2007. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/tutorial.html b/doc/tutorial.html index 7c93b469..05047afd 100644 --- a/libs/ptr_container/doc/tutorial.html +++ b/libs/ptr_container/doc/tutorial.html @@ -773,7 +773,7 @@

    Algorithms

    BOOST_ASSERT( another_zoo.empty() );

    That is all; now you have learned all the basics!

    -

    See also

    +

    See also

    -
    +
    diff --git a/doc/tutorial.rst b/doc/tutorial.rst index a7c12e20..8b84364a 100644 --- a/libs/ptr_container/doc/tutorial.rst +++ b/libs/ptr_container/doc/tutorial.rst @@ -440,7 +440,7 @@ That is all; now you have learned all the basics! .. raw:: html -
    +
    **See also** @@ -455,7 +455,7 @@ That is all; now you have learned all the basics! .. raw:: html -
    +
    :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__). diff --git a/doc/tutorial_example.html b/doc/tutorial_example.html index 202a17bb..9ebf4a1c 100644 --- a/libs/ptr_container/doc/tutorial_example.html +++ b/libs/ptr_container/doc/tutorial_example.html @@ -1,12 +1,12 @@ - + - + -
    //
    +    
    //
     // Boost.Pointer Container
     //
     //  Copyright Thorsten Ottosen 2003-2005. Use, modification and
    @@ -30,149 +30,149 @@
     //
     // First we select which container to use.
     //
    -#include <boost/ptr_container/ptr_deque.hpp>
    +#include <boost/ptr_container/ptr_deque.hpp>
     
    -//
    +//
     // we need these later in the example
     //
    -#include <boost/assert.hpp>
    -#include <string>
    -#include <exception>
    +#include <boost/assert.hpp>
    +#include <string>
    +#include <exception>
     
     
    -//
    +//
     // Then we define a small polymorphic class
     // hierarchy.
     // 
     
    -class animal : boost::noncopyable
    -{
    -    virtual std::string do_speak() const = 0;
    -    std::string name_;
    +class animal : boost::noncopyable
    +{
    +    virtual std::string do_speak() const = 0;
    +    std::string name_;
     
    -protected:
    -    //
    +protected:
    +    //
         // Animals cannot be copied...
         //
    -    animal( const animal& r ) : name_( r.name_ )           { }
    -    void operator=( const animal& );
    +    animal( const animal& r ) : name_( r.name_ )           { }
    +    void operator=( const animal& );
     
    -private:
    -    //
    +private:
    +    //
         // ...but due to advances in genetics, we can clone them!
         //
     
    -    virtual animal* do_clone() const = 0;
    +    virtual animal* do_clone() const = 0;
             
    -public:
    -    animal( const std::string& name ) : name_(name)        { }
    -    virtual ~animal() throw()                              { }
    +public:
    +    animal( const std::string& name ) : name_(name)        { }
    +    virtual ~animal() throw()                              { }
         
    -    std::string speak() const
    -    {
    -        return do_speak();
    -    }
    -
    -    std::string name() const
    -    {
    -        return name_;
    -    }
    -
    -    animal* clone() const
    -    {
    -        return do_clone();
    -    }
    -};
    -
    -//
    +    std::string speak() const
    +    {
    +        return do_speak();
    +    }
    +
    +    std::string name() const
    +    {
    +        return name_;
    +    }
    +
    +    animal* clone() const
    +    {
    +        return do_clone();
    +    }
    +};
    +
    +//
     // An animal is still not Clonable. We need this last hook.
     //
     // Notice that we pass the animal by const reference
     // and return by pointer.
     //
     
    -animal* new_clone( const animal& a )
    -{
    -    return a.clone();
    -}
    +animal* new_clone( const animal& a )
    +{
    +    return a.clone();
    +}
     
    -//
    +//
     // We do not need to define 'delete_clone()' since
     // since the default is to call the default 'operator delete()'.
     //
     
    -const std::string muuuh = "Muuuh!";
    -const std::string oiink = "Oiiink";
    -
    -class cow : public animal
    -{
    -    virtual std::string do_speak() const
    -    {
    -        return muuuh;
    -    }
    -
    -    virtual animal* do_clone() const
    -    {
    -        return new cow( *this );
    -    }
    -
    -public:
    -    cow( const std::string& name ) : animal(name)          { }
    -};
    -
    -class pig : public animal
    -{
    -    virtual std::string do_speak() const
    -    {
    -        return oiink;
    -    }
    -
    -    virtual animal* do_clone() const
    -    {
    -        return new pig( *this );
    -    }
    +const std::string muuuh = "Muuuh!";
    +const std::string oiink = "Oiiink";
    +
    +class cow : public animal
    +{
    +    virtual std::string do_speak() const
    +    {
    +        return muuuh;
    +    }
    +
    +    virtual animal* do_clone() const
    +    {
    +        return new cow( *this );
    +    }
    +
    +public:
    +    cow( const std::string& name ) : animal(name)          { }
    +};
    +
    +class pig : public animal
    +{
    +    virtual std::string do_speak() const
    +    {
    +        return oiink;
    +    }
    +
    +    virtual animal* do_clone() const
    +    {
    +        return new pig( *this );
    +    }
         
    -public:
    -    pig( const std::string& name ) : animal(name)          { }
    -};
    +public:
    +    pig( const std::string& name ) : animal(name)          { }
    +};
     
    -//
    +//
     // Then we, of course, need a place to put all
     // those animals.
     //
     
    -class farm
    -{
    -    //
    +class farm
    +{
    +    //
         // This is where the smart containers are handy
         //
    -    typedef boost::ptr_deque<animal> barn_type;
    -    barn_type                        barn;
    +    typedef boost::ptr_deque<animal> barn_type;
    +    barn_type                        barn;
     
    -    //
    +    //
         // A convenience typedef for the compiler-appropriate
         // smart pointer used to manage barns
         //    
    -    typedef compatible-smart-ptr<barn_type> raii_ptr;
    +    typedef compatible-smart-ptr<barn_type> raii_ptr;
     
    -    //
    +    //
         // An error type
         //
    -    struct farm_trouble : public std::exception           { };
    +    struct farm_trouble : public std::exception           { };
     
    -public:
    -    // 
    +public:
    +    // 
         // We would like to make it possible to
         // iterate over the animals in the farm
         //
    -    typedef barn_type::iterator  animal_iterator;
    +    typedef barn_type::iterator  animal_iterator;
     
    -    //
    +    //
         // We also need to count the farm's size...
         //
    -    typedef barn_type::size_type size_type;
    +    typedef barn_type::size_type size_type;
         
    -    //
    +    //
         // And we also want to transfer an animal
         // safely around. The easiest way to think
         // about '::auto_type' is to imagine a simplified
    @@ -184,100 +184,100 @@
         //
         // but not more.
         //
    -    typedef barn_type::auto_type  animal_transport;
    +    typedef barn_type::auto_type  animal_transport;
     
    -    // 
    +    // 
         // Create an empty farm.
         //
    -    farm()                                                 { }
    +    farm()                                                 { }
         
    -    //
    +    //
         // We need a constructor that can make a new
         // farm by cloning a range of animals.
         //
    -    farm( animal_iterator begin, animal_iterator end )
    -     : 
    -        //
    +    farm( animal_iterator begin, animal_iterator end )
    +     : 
    +        //
             // Objects are always cloned before insertion
             // unless we explicitly add a pointer or 
             // use 'release()'. Therefore we actually
             // clone all animals in the range
             //
    -        barn( begin, end )                               { }
    +        barn( begin, end )                               { }
         
    -    //
    +    //
         // ... so we need some other function too
         //
     
    -    animal_iterator begin()
    -    {
    -        return barn.begin();
    -    }
    +    animal_iterator begin()
    +    {
    +        return barn.begin();
    +    }
     
    -    animal_iterator end()
    -    {
    -        return barn.end();
    -    }
    +    animal_iterator end()
    +    {
    +        return barn.end();
    +    }
         
    -    //
    +    //
         // Here it is quite ok to have an 'animal*' argument.
         // The smart container will handle all ownership
         // issues.
         //
    -    void buy_animal( animal* a )
    -    {
    -        barn.push_back( a );
    -    }
    +    void buy_animal( animal* a )
    +    {
    +        barn.push_back( a );
    +    }
     
    -    //
    +    //
         // The farm can also be in economical trouble and
         // therefore be in the need to sell animals.
         //
    -    animal_transport sell_animal( animal_iterator to_sell )
    -    {
    -        if( to_sell == end() )
    -            throw farm_trouble();
    +    animal_transport sell_animal( animal_iterator to_sell )
    +    {
    +        if( to_sell == end() )
    +            throw farm_trouble();
     
    -        //
    +        //
             // Here we remove the animal from the barn,
             // but the animal is not deleted yet...it's
             // up to the buyer to decide what
             // to do with it.
             //
    -        return barn.release( to_sell );
    -    }
    +        return barn.release( to_sell );
    +    }
     
    -    //
    +    //
         // How big a farm do we have?
         //
    -    size_type size() const
    -    {
    -        return barn.size();
    -    }
    +    size_type size() const
    +    {
    +        return barn.size();
    +    }
     
    -    //
    +    //
         // If things are bad, we might choose to sell all animals :-(
           //
     
    -    raii_ptr sell_farm()
    -    {
    -        return barn.release();
    -    }
    +    raii_ptr sell_farm()
    +    {
    +        return barn.release();
    +    }
     
    -    //
    +    //
         // However, if things are good, we might buy somebody
         // else's farm :-)
         //
     
    -    void buy_farm( raii_ptr other )
    -    {
    -        //
    +    void buy_farm( raii_ptr other )
    +    {
    +        //
             // This line inserts all the animals from 'other'
             // and is guaranteed either to succeed or to have no
             // effect
             //
    -        barn.transfer( barn.end(), // insert new animals at the end
    -                         *other );     // we want to transfer all animals,
    +        barn.transfer( barn.end(), // insert new animals at the end
    +                         *other );     // we want to transfer all animals,
                                            // so we use the whole container as argument
             //
             // You might think you would have to do
    @@ -286,86 +286,86 @@
             //
             // but '*other' is empty and can go out of scope as it wants
             //
    -        BOOST_ASSERT( other->empty() );
    -    }
    +        BOOST_ASSERT( other->empty() );
    +    }
         
    -}; // class 'farm'.
    +}; // class 'farm'.
     
    -int main()
    -{
    -    //
    +int main()
    +{
    +    //
         // First we make a farm
         //
    -    farm animal_farm;
    -    BOOST_ASSERT( animal_farm.size() == 0u );
    +    farm animal_farm;
    +    BOOST_ASSERT( animal_farm.size() == 0u );
         
    -    animal_farm.buy_animal( new pig("Betty") );
    -    animal_farm.buy_animal( new pig("Benny") );
    -    animal_farm.buy_animal( new pig("Jeltzin") );
    -    animal_farm.buy_animal( new cow("Hanz") );
    -    animal_farm.buy_animal( new cow("Mary") );
    -    animal_farm.buy_animal( new cow("Frederik") );
    -    BOOST_ASSERT( animal_farm.size() == 6u );
    -
    -    //
    +    animal_farm.buy_animal( new pig("Betty") );
    +    animal_farm.buy_animal( new pig("Benny") );
    +    animal_farm.buy_animal( new pig("Jeltzin") );
    +    animal_farm.buy_animal( new cow("Hanz") );
    +    animal_farm.buy_animal( new cow("Mary") );
    +    animal_farm.buy_animal( new cow("Frederik") );
    +    BOOST_ASSERT( animal_farm.size() == 6u );
    +
    +    //
         // Then we make another farm...it will actually contain
         // a clone of the other farm.
         //
    -    farm new_farm( animal_farm.begin(), animal_farm.end() );
    -    BOOST_ASSERT( new_farm.size() == 6u );
    +    farm new_farm( animal_farm.begin(), animal_farm.end() );
    +    BOOST_ASSERT( new_farm.size() == 6u );
     
    -    //
    +    //
         // Is it really clones in the new farm?
         //
    -    BOOST_ASSERT( new_farm.begin()->name() == "Betty" );
    +    BOOST_ASSERT( new_farm.begin()->name() == "Betty" );
         
    -    //
    +    //
         // Then we search for an animal, Mary (the Crown Princess of Denmark),
         // because we would like to buy her ...
         //
    -    typedef farm::animal_iterator iterator;
    -    iterator to_sell;
    -    for( iterator i   = animal_farm.begin(),
    -                  end = animal_farm.end();
    -         i != end; ++i )
    -    {
    -        if( i->name() == "Mary" )
    -        {
    -            to_sell = i;
    -            break;
    -        }
    -    }
    -
    -    farm::animal_transport mary = animal_farm.sell_animal( to_sell );
    -
    -
    -    if( mary->speak() == muuuh )
    -        //
    +    typedef farm::animal_iterator iterator;
    +    iterator to_sell;
    +    for( iterator i   = animal_farm.begin(),
    +                  end = animal_farm.end();
    +         i != end; ++i )
    +    {
    +        if( i->name() == "Mary" )
    +        {
    +            to_sell = i;
    +            break;
    +        }
    +    }
    +
    +    farm::animal_transport mary = animal_farm.sell_animal( to_sell );
    +
    +
    +    if( mary->speak() == muuuh )
    +        //
             // Great, Mary is a cow, and she may live longer
             //
    -        new_farm.buy_animal( mary.release() );
    -    else
    -        //
    +        new_farm.buy_animal( mary.release() );
    +    else
    +        //
             // Then the animal would be destroyed (!)
             // when we go out of scope.
             //
    -        ;
    +        ;
     
    -    //
    +    //
         // Now we can observe some changes to the two farms...
         //
    -    BOOST_ASSERT( animal_farm.size() == 5u );
    -    BOOST_ASSERT( new_farm.size()    == 7u );
    +    BOOST_ASSERT( animal_farm.size() == 5u );
    +    BOOST_ASSERT( new_farm.size()    == 7u );
     
    -    //
    +    //
         // The new farm has however underestimated how much
         // it cost to feed Mary and its owner is forced to sell the farm...
         //
    -    animal_farm.buy_farm( new_farm.sell_farm() );
    +    animal_farm.buy_farm( new_farm.sell_farm() );
     
    -    BOOST_ASSERT( new_farm.size()    == 0u );
    -    BOOST_ASSERT( animal_farm.size() == 12u );     
    -}
    +    BOOST_ASSERT( new_farm.size()    == 0u );
    +    BOOST_ASSERT( animal_farm.size() == 12u );     
    +}