|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54634 - in sandbox/cloneable/libs/cloneable/doc: . html html/cloneable html/cloneable/containers html/cloneable/heterogenous_containers html/cloneable/tutorial
From: christian.schladetsch_at_[hidden]
Date: 2009-07-04 05:10:06
Author: cschladetsch
Date: 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
New Revision: 54634
URL: http://svn.boost.org/trac/boost/changeset/54634
Log:
updated docs
Added:
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/container_method_names.html (contents, props changed)
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/extended_object_hierarhcy.html (contents, props changed)
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/hashmap_and_hashset.html (contents, props changed)
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/list.html (contents, props changed)
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/map.html (contents, props changed)
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/set.html (contents, props changed)
sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/vector.html (contents, props changed)
Text files modified:
sandbox/cloneable/libs/cloneable/doc/Jamfile.v2 | 2
sandbox/cloneable/libs/cloneable/doc/cloneable.qbk | 270 ++++++++++++++++++++++++++++++---------
sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html | 2
sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html | 102 ++++++++------
sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/list.html | 38 +---
sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/set.html | 27 ++-
sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/vector.html | 36 ++++
sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html | 6
sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html | 8
sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html | 8
sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html | 6
sandbox/cloneable/libs/cloneable/doc/html/index.html | 28 ++-
sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest | 18 +-
13 files changed, 368 insertions(+), 183 deletions(-)
Modified: sandbox/cloneable/libs/cloneable/doc/Jamfile.v2
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/Jamfile.v2 (original)
+++ sandbox/cloneable/libs/cloneable/doc/Jamfile.v2 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -5,7 +5,7 @@
xml cloneable : cloneable.qbk ;
-path-constant images : html/images ;
+path-constant images : doc/html/images ;
boostbook standalone
:
Modified: sandbox/cloneable/libs/cloneable/doc/cloneable.qbk
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/cloneable.qbk (original)
+++ sandbox/cloneable/libs/cloneable/doc/cloneable.qbk 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -314,9 +314,9 @@
[endsect]
-[section Dealing with Muliple SubObjects]
+[section Dealing with Muliple Sub-Objects]
-When dealing with types that have multiple cloneable sub-objects, we must use the
+When working with types that have multiple cloneable sub-objects, we must use the
`clone_as<T>` and `create_as<T>` methods to disambiguate which sub-type to clone
or create.
@@ -352,8 +352,6 @@
no_default_construction will be thrown if you attempt to default-create a new S instance
from a T instance.
-However, it is always safe to clone types that are not default constructable.
-
[endsect]
[section Customising the Cloning Process]
@@ -390,33 +388,6 @@
[endsect]
-[section Cloneable Traits]
-
-This is mostly relevant to library maintainers and is not important otherwise.
-
-To assist with dealing with cloneable objects in other systems, the following
-traits are provided:
-
-``
-class Base { virtual ~Base() { } };
-struct T : base<T, Base> { };
-struct U : base<T, Base, no_default_construction> { };
-struct V { };
-
-BOOST_STATIC_ASSERT(cloneable::is_cloneable<T>::value);
-BOOST_STATIC_ASSERT(cloneable::is_cloneable<U>::value);
-BOOST_STATIC_ASSERT(!cloneable::is_cloneable<V>::value);
-BOOST_STATIC_ASSERT(cloneable::has_base<T,Base>::value);
-
-//BOOST_STATIC_ASSERT(cloneable::is_default_constructable<V>::value); compile-time error: no traits
-BOOST_STATIC_ASSERT(cloneable::is_default_constructable<T>::value);
-BOOST_STATIC_ASSERT(!cloneable::is_default_constructable<T>::value);
-``
-
-More details are in the `clonable::traits<T>` structure.
-
-[endsect]
-
[section Using Custom Allocators]
The entire Cloneable system was designed to support general allocators. This provides
@@ -476,75 +447,228 @@
[endsect]
+[section Cloneable Traits]
+
+This is mostly relevant to library maintainers and is not important otherwise.
+
+To assist with dealing with cloneable objects in other systems, the following
+traits are provided:
+
+``
+class Base { virtual ~Base() { } };
+struct T : base<T, Base> { };
+struct U : base<T, Base, no_default_construction> { };
+struct V { };
+
+BOOST_STATIC_ASSERT(cloneable::is_cloneable<T>::value);
+BOOST_STATIC_ASSERT(cloneable::is_cloneable<U>::value);
+BOOST_STATIC_ASSERT(!cloneable::is_cloneable<V>::value);
+BOOST_STATIC_ASSERT(cloneable::has_base<T,Base>::value);
+
+//BOOST_STATIC_ASSERT(cloneable::is_default_constructable<V>::value); compile-time error: no traits
+BOOST_STATIC_ASSERT(cloneable::is_default_constructable<T>::value);
+BOOST_STATIC_ASSERT(!cloneable::is_default_constructable<T>::value);
+``
+
+More details are in the `clonable::traits<T>` structure.
[endsect]
-[section Containers]
+
+[endsect]
+
+[section Heterogenous Containers]
This section of the tutorial presents the first glimpse of the so-called ['heterogenous containers]
provided by the Cloneable library. These are:
* `list<Base, Allocator>`
* `vector<Base, Allocator>`
+* `deque<Base, Allocator>`
+* `chain<Base, LinkLength, Allocator>`
* `map<Base, Predicate, Allocator>`
* `set<Base, Predicate, Allocator>`
+* `multimap<Base, Pred, Alloc>`
+* `multiset<Base, Pred, Alloc>`
* `hash_map<Base, Predicate, Hash, Allocator>`
* `hash_set<Base, Predicate, Hash, Allocator>`
+* `hash_multimap<Base, Pred, Hash, Alloc>`.
+* `hash_multiset<Base, Pred, Hash, Alloc>`
All of these containers store pointers to objects. However, they each expose their contained objects using value semantics.
-If this seems similar to Boost.PtrContainer, that is not coincidental, as these containers are based on a modified implementation
+If this seems similar to [*Boost.PtrContainer], that is not coincidental, as these containers are based on a modified implementation
of that library.
-You will have noted that each container is specialised over a Base type, rather than a concrete derived type. This is
-because they are intended to store base pointers. It may be surprising that `map<>` takes only one type - the Base type - of
-object to store, rather than the more familiar key and mapped types. This is because a heterogenous map provides
+You will have noted that each container is specialised over a `Base` type, rather than a concrete derived type. This is
+because they are intended to store base pointers.
+
+It may be surprising that `map<>` takes only one type - the `Base` type - of
+objects to store, rather than the more familiar ['key] and ['mapped] types. This is because a heterogenous map provides
an association between objects with the same base type.
+All heterogenous containers create objects to be added 'in place', in storage created by the containers allocator.
+As such, to add a new object to a heterogenous container, you provide the type and the construction arguments. Allocation
+and construction is dealt with by the container, and, importantly, ['objects are not copied into the container]:
+
+``
+container.add_method<Type>(construction args..);
+``
+
+This means, for instance, that you can use non-default-constructable objects in heterogenous vectors.
+
+It also means that you can use objects that do not or cannot have assignment defined.
+
+Basically, as long as you can construct the object at all, you can use it in a heterogenous container.
+
+Importantly, clones are guaranteed to be created using the same allocator as that used to make the original objects.
+
+This is why it is
+important that you overload `make_copy(abstract_allocator &) const`, rather than the `make_copy() const` method that
+does not take an allocator. (['Indeed, there is a good case to be made for removing this second method from the library
+completely - CJS]).
+
These containers will be presented in order, with some motivational examples which combines them. First, we shall
-extend our little Animal hierarchy to include an age member, and a comparison operator:
+extend our little Animal hierarchy to include an age member, and comparison operators.
+
+[section Extended Object Hierarhcy]
+
+This is the definitions we will use in the following examples. First, let's look at a slightly
+extended base type for our Animal hierarchy:
``
struct Animal
{
double age;
+ string name;
+
Animal(double years_old = 0) : age(years_old) { }
+ Animal(string n, double years_old = 0) : age(years_old), name(n) { }
- bool operator<(const Animal &other) const
+ friend bool operator==(const Animal &left, const Animal &right) const
{
- return age < other.age;
+ return left.age == right.age;
}
+ friend bool operator<(const Animal &left, const Animal &right) const
+ {
+ return left.age < right.age;
+ }
+ struct CompareNames
+ {
+ friend bool operator<(const Animal &left, const Animal &right) const
+ {
+ return left.name < right.name;
+ }
+ };
};
+``
+This is just a little more elaborate than the previous example hierarchy we used earlier in the tutorial.
+We have added an `age` field for all animals, which is how old it is in years. Animals have relational
+operators for testing equivalence and sorting. Another functor named `CompareNames` is provided, which
+sorts by the name field of animals rather than age.
+
+You are aware that getting your base class right is very important to the strength and efficacy of the
+hierarchy as a whole. At a minimum, you must of course use a virtual destructor. Getting the comparison
+operators right is very important as well, but of course we can always add more sorting predicates such
+as `CompareNames` as needed.
+
+What we would like to avoid is having a so-called ['fat interface] as the base class, which
+has a lot of extra information that is only relevant to one or more derived types. Some of these issues
+can be addressed with further use of interfaces and virtual methods to obtain sorting criteria.
+
+A full discussion on object-oriented design is beyond the scope of this brief tutorial - and I'm sure you're
+very aware of the issues in any case. Suffice to say
+that you should pay attention to how you design your base types. Always use a virtual
+destructor, try to keep state to a minimum, and bear in mind how you will want to compare objects.
+
+Moving on, we define our derived types:
+
+``
struct Cat : cloneable::base<Cat, Animal>
{
- Cat(double age = 0) : base_type(age) { }
+ Cat(string name, double age = 10) : Animal(name, age) { }
};
struct Dog : cloneable::base<Dog, Animal>
{
- Dog(double age = 0) : base_type(age) { }
+ Dog(string name, double age = 0) : Animal(name, age) { }
};
struct Labrador : Dog, cloneable::base<Labrador, Animal>
{
- Labrador(double age = 0) : base_type(age) { }
+ bool is_guide_dog;
+ Labrador(string name, bool can_lead, double age = 0) : Dog(name, age), is_guide_dog(can_lead) { }
};
+``
+
+Labradors now have an extra field indicating that a given instance has been trained as a guide dog, and each Animal
+type can be constructed by passing its name and age. Note that there are no default constructors for
+any of the Animal types.
+
+Feel free to return to this page to refresh your memory as we walk through some
+examples that use these definitions.
+
+First, a preamble on names and semantics.
+
+[endsect]
+[section Container Method Names]
+
+To add an element of type `Ty` to any heterogenous
+container such as a `list`, `vector` or `set` we use the following syntax:
+
+``
+container.add_method_name<Ty>(a0, a1,..., an);
+``
+
+Specifically, we do not directly add an object to a heterogenous container. Rather, we specify the type of thing
+to add, and provide any construction arguments. This is true as well for specifying
+objects to search for in associative containers:
+
+``
+container.find<Ty>(a0, a1,..., an);
``
+This creates a new object of type `Ty`, constructed with the provided arguments, and searches for it
+in the container. But, I'm getting a little ahead of ourselves here - more on associative containers later; let's
+look at that syntax again.
+
+The name for the method to add new objects to heterogenous sequence containers has gone from
+being called `push_back` to `emplace_back` to `push_emplace_back`
+and back to `push_back`. Similarly for associative containers the names have varied
+from `insert` to `emplace` to `emplace_insert` and back to `insert`.
+
+The C++0x containers have emplace methods that insert a new object after a given iterator
+location, by passing construction arguments. These are called `emplace` methods.
+
+This is similar to the way that objects are added to heterogenous containers, but not
+the same. For all heterogenous containers, the process is to specify the type of thing
+and any creation arguments. There is no need to specify an iterator, but there
+is a need to specify the type explicitly. This is different to the C++0x containers, which
+do not require the type.
+
+For this reason the names have changed and are yet to be settled. All suggestions
+for the names of the methods, or namespaces, are welcome. I am sure they'll end up being
+called something like `emplace_back` rather than `push_back`; but the difference is that
+there is no `push_back` in a heterogenous container: everything is always ['emplaced],
+so this is one reason why I've been vasilating over the naming conventions to use.
+
With this in mind, let's visit the first container: the faithful list.
+[endsect]
+
[section List]
-TODO
+The first heterogenous container we'll look at is the `list`. It is very much like a standard `list<T>`.
+But it is also very different:
``
typedef heterogenous::list<Animal> List;
List list;
-list.emplace_back<Cat>("sam", 12);
-list.emplace_back<Dog>("spot", 8);
-list.emplace_back<Labrador>("max", 14);
+list.push_back<Cat>("sam", 12);
+list.push_back<Dog>("spot", 8);
+list.push_back<Labrador>("max", 14);
List copy = list;
@@ -553,31 +677,24 @@
``
The first thing you may notice is the strange way we add new items to a list. All heterogenous containers use ['emplace]
-semantics for adding or querying objects.
-
-This means that the container creates the objects 'in place', in storage created by the containers allocator.
-As such, to add a new object to a heterogenous container, you provide the type and the construction arguments.
-
-Clones are created using the same allocator as that used to make the original objects; this is why it is
-important that you overload `make_copy(abstract_allocator &) const`, rather than the `make_copy` method that
-does not take an allocator. Indeed, there is a good case to be made for removing this second method from the library
-completely.
+semantics for searching for existing objects or adding new objects.
-For now, it will be enough to absorb the emplace syntax, and to note that the cloned list called `copy` made
+For now, it will be enough to absorb the ['emplacement syntax] for adding new elements, and to note that the cloned list called `copy` made
a deep copy of the list; the underlying base pointers were not just copied - they were cloned.
[endsect]
[section Vector]
-TODO
+The vector gets the same treatment as lists, with the same syntax for adding new elements, but also some
+extra methods for random access of specifically typed contained objects:
``
typedef heterogenous::vector<Animal> Vector;
Vector vector;
-vector.emplace_back<Cat>("sam");
-vector.emplace_back<Dog>("spot");
-vector.emplace_back<Labrador>("max", 14);
+vector.push_back<Cat>("sam");
+vector.push_back<Dog>("spot");
+vector.push_back<Labrador>("max", 14);
Vector copy = vector;
@@ -585,13 +702,31 @@
Dog &labs_dog = vector.as<Dog>(2);
Dog &spot = vector.as<Dog>(1);
+const Dog *maybe_dog = vector.cast<Dog>(0);
``
+['Again, the names here have undergone a number of changes and remain in flux. Suggestions welcome!]
+
+`push_back` works just like with `list` and is not surprising. But the `as` and `cast` methods are new.
+
+`vector::as` is the same as `vector::at` except that it requires a type to convert to. `at` will return
+a base reference. `as` returns a derived-type reference, or throws `std::bad_cast`.
+
+`vector::cast` (['another name in need of a better name]) returns a pointer of the given type to
+the specified element, or returns the null pointer if conversion was not possible or ambiguous.
+
+The other members in `vector` are largely what you would expect with no real surprises. See the reference for complete details.
+
[endsect]
[section Set]
-TODO
+So far we have been intoduced to the two basic heterogenous sequence containers, `list` and `vector`. The main
+difference over the standard containers is how you add new objects to them, and that they are, well, heterogenous.
+You can store any type of object in them that derives from the base type that you used to define the list or vector.
+
+Things start to get interesting with the associative containers `set` and `map`. Here we take a quick look
+at how we might use a heterogenous set to store a collection of animals.
``
int main()
@@ -599,21 +734,22 @@
typedef heterogenous::set<Animal> Set;
Set set;
- Cat &sam = set.emplace<Cat>("sam", 1.5);
- Dog &spot = set.emplace<Dog>("spot", 3);
- Labrador &max = set.emplace<Labrador>("max", 14);
+ const Cat &sam = set.emplace<Cat>("sam", 1.5).deref();
+ const Dog &spot = set.emplace<Dog>("spot", 3).deref();
+ const Labrador &max = set.emplace<Labrador>("max", 14).deref();
Set copy = set;
- Set::iterator dog = copy.find<Dog>(14);
- Set::iterator any = copy.find<Animal>(1.5);
+ Set::iterator dog = copy.find<Dog>(14); // find a dog aged 14
+ Set::iterator any = copy.find<Animal>(1.5); // find any animal aged 1.5
+ Set::iterator cat = copy.find<Cat>(3); // find a cat aged 3
assert(&*dog == &max);
assert(&*any == &sam);
+ assert(cat == set.end());
return 0;
}
-
``
[endsect]
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -27,7 +27,7 @@
<a name="cloneable.change_log"></a><a class="link" href="change_log.html" title="Change Log"> Change Log</a>
</h2></div></div></div>
<a name="cloneable.change_log.version_0_1"></a><h4>
-<a name="id663379"></a>
+<a name="id646995"></a>
<a class="link" href="change_log.html#cloneable.change_log.version_0_1">Version 0.1</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -6,8 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="../index.html" title="Cloneable 0.1">
<link rel="up" href="../index.html" title="Cloneable 0.1">
-<link rel="prev" href="tutorial/using_custom_allocators.html" title="Using Custom Allocators">
-<link rel="next" href="containers/list.html" title="List">
+<link rel="prev" href="tutorial/cloneable_traits.html" title="Cloneable Traits">
+<link rel="next" href="containers/extended_object_hierarhcy.html" title="Extended Object Hierarhcy">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,13 +20,17 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="tutorial/using_custom_allocators.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="containers/list.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorial/cloneable_traits.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="containers/extended_object_hierarhcy.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Containers">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="cloneable.containers"></a><a class="link" href="containers.html" title="Containers">Containers</a>
</h2></div></div></div>
<div class="toc"><dl>
+<dt><span class="section"><a href="containers/extended_object_hierarhcy.html">Extended
+ Object Hierarhcy</a></span></dt>
+<dt><span class="section"><a href="containers/container_method_names.html">Container
+ Method Names</a></span></dt>
<dt><span class="section">List</span></dt>
<dt><span class="section">Vector</span></dt>
<dt><span class="section">Set</span></dt>
@@ -41,64 +45,76 @@
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><code class="computeroutput"><span class="identifier">list</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
<li class="listitem"><code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">deque</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">chain</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">LinkLength</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
<li class="listitem"><code class="computeroutput"><span class="identifier">map</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Predicate</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
<li class="listitem"><code class="computeroutput"><span class="identifier">set</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Predicate</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">multimap</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Pred</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">></span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">multiset</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Pred</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">></span></code></li>
<li class="listitem"><code class="computeroutput"><span class="identifier">hash_map</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Predicate</span><span class="special">,</span> <span class="identifier">Hash</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
<li class="listitem"><code class="computeroutput"><span class="identifier">hash_set</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Predicate</span><span class="special">,</span> <span class="identifier">Hash</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span></code></li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">hash_multimap</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Pred</span><span class="special">,</span> <span class="identifier">Hash</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">></span></code>.
+ </li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">hash_multiset</span><span class="special"><</span><span class="identifier">Base</span><span class="special">,</span> <span class="identifier">Pred</span><span class="special">,</span> <span class="identifier">Hash</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">></span></code></li>
</ul></div>
<p>
All of these containers store pointers to objects. However, they each expose
- their contained objects using value semantics. If this seems similar to Boost.PtrContainer,
- that is not coincidental, as these containers are based on a modified implementation
- of that library.
+ their contained objects using value semantics. If this seems similar to <span class="bold"><strong>Boost.PtrContainer</strong></span>, that is not coincidental, as these
+ containers are based on a modified implementation of that library.
</p>
<p>
- You will have noted that each container is specialised over a Base type, rather
- than a concrete derived type. This is because they are intended to store base
- pointers. It may be surprising that <code class="computeroutput"><span class="identifier">map</span><span class="special"><></span></code> takes only one type - the Base type
- - of object to store, rather than the more familiar key and mapped types. This
- is because a heterogenous map provides an association between objects with
- the same base type.
+ You will have noted that each container is specialised over a <code class="computeroutput"><span class="identifier">Base</span></code> type, rather than a concrete derived
+ type. This is because they are intended to store base pointers.
</p>
<p>
- These containers will be presented in order, with some motivational examples
- which combines them. First, we shall extend our little Animal hierarchy to
- include an age member, and a comparison operator:
+ It may be surprising that <code class="computeroutput"><span class="identifier">map</span><span class="special"><></span></code> takes only one type - the <code class="computeroutput"><span class="identifier">Base</span></code> type - of objects to store, rather than
+ the more familiar <span class="emphasis"><em>key</em></span> and <span class="emphasis"><em>mapped</em></span>
+ types. This is because a heterogenous map provides an association between objects
+ with the same base type.
+ </p>
+<p>
+ All heterogenous containers create objects to be added 'in place', in storage
+ created by the containers allocator. As such, to add a new object to a heterogenous
+ container, you provide the type and the construction arguments. Allocation
+ and construction is dealt with by the container, and, importantly, <span class="emphasis"><em>objects
+ are not copied into the container</em></span>:
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">Animal</span>
-<span class="special">{</span>
- <span class="keyword">double</span> <span class="identifier">age</span><span class="special">;</span>
- <span class="identifier">Animal</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">years_old</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">age</span><span class="special">(</span><span class="identifier">years_old</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
-
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">other</span><span class="special">)</span> <span class="keyword">const</span>
- <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">age</span> <span class="special"><</span> <span class="identifier">other</span><span class="special">.</span><span class="identifier">age</span><span class="special">;</span>
- <span class="special">}</span>
-<span class="special">};</span>
-
-<span class="keyword">struct</span> <span class="identifier">Cat</span> <span class="special">:</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">></span>
-<span class="special">{</span>
- <span class="identifier">Cat</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">age</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">base_type</span><span class="special">(</span><span class="identifier">age</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
-<span class="special">};</span>
-
-<span class="keyword">struct</span> <span class="identifier">Dog</span> <span class="special">:</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">></span>
-<span class="special">{</span>
- <span class="identifier">Dog</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">age</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">base_type</span><span class="special">(</span><span class="identifier">age</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
-<span class="special">};</span>
-
-<span class="keyword">struct</span> <span class="identifier">Labrador</span> <span class="special">:</span> <span class="identifier">Dog</span><span class="special">,</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">></span>
-<span class="special">{</span>
- <span class="identifier">Labrador</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">age</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">base_type</span><span class="special">(</span><span class="identifier">age</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
-<span class="special">};</span>
-
+<pre class="programlisting"><span class="identifier">container</span><span class="special">.</span><span class="identifier">add_method</span><span class="special"><</span><span class="identifier">Type</span><span class="special">>(</span><span class="identifier">args</span><span class="special">..);</span>
</pre>
<p>
</p>
<p>
- With this in mind, let's visit the first container: the faithful list.
+ This means, for instance, that you can use non-default-constructable objects
+ in heterogenous vectors.
+ </p>
+<p>
+ It also means that you can use objects that do not or cannot have assignment
+ defined.
+ </p>
+<p>
+ Basically, as long as you can construct the object at all, you can use it in
+ a heterogenous container.
+ </p>
+<p>
+ Importantly, clones are guaranteed to be created using the same allocator as
+ that used to make the original objects.
+ </p>
+<p>
+ This is why it is important that you overload <code class="computeroutput"><span class="identifier">make_copy</span><span class="special">(</span><span class="identifier">abstract_allocator</span>
+ <span class="special">&)</span> <span class="keyword">const</span></code>,
+ rather than the <code class="computeroutput"><span class="identifier">make_copy</span><span class="special">()</span>
+ <span class="keyword">const</span></code> method that does not take an allocator.
+ (<span class="emphasis"><em>Indeed, there is a good case to be made for removing this second
+ method from the library completely</em></span>).
+ </p>
+<p>
+ These containers will be presented in order, with some motivational examples
+ which combines them. First, we shall extend our little Animal hierarchy to
+ include an age member, and comparison operators.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -111,7 +127,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="tutorial/using_custom_allocators.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="containers/list.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorial/cloneable_traits.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="containers/extended_object_hierarhcy.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/list.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/list.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/list.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="../../index.html" title="Cloneable 0.1">
<link rel="up" href="../containers.html" title="Containers">
-<link rel="prev" href="../containers.html" title="Containers">
+<link rel="prev" href="container_method_names.html" title="Container Method Names">
<link rel="next" href="vector.html" title="Vector">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,14 +20,16 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../containers.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="container_method_names.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="List">
<div class="titlepage"><div><div><h3 class="title">
<a name="cloneable.containers.list"></a><a class="link" href="list.html" title="List">List</a>
</h3></div></div></div>
<p>
- TODO
+ The first heterogenous container we'll look at is the <code class="computeroutput"><span class="identifier">list</span></code>.
+ It is very much like a standard <code class="computeroutput"><span class="identifier">list</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>.
+ But it is also very different:
</p>
<p>
@@ -35,9 +37,9 @@
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">List</span><span class="special">;</span>
<span class="identifier">List</span> <span class="identifier">list</span><span class="special">;</span>
-<span class="identifier">list</span><span class="special">.</span><span class="identifier">emplace_back</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">12</span><span class="special">);</span>
-<span class="identifier">list</span><span class="special">.</span><span class="identifier">emplace_back</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">8</span><span class="special">);</span>
-<span class="identifier">list</span><span class="special">.</span><span class="identifier">emplace_back</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
+<span class="identifier">list</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">12</span><span class="special">);</span>
+<span class="identifier">list</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">8</span><span class="special">);</span>
+<span class="identifier">list</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
<span class="identifier">List</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">list</span><span class="special">;</span>
@@ -49,26 +51,12 @@
<p>
The first thing you may notice is the strange way we add new items to a list.
All heterogenous containers use <span class="emphasis"><em>emplace</em></span> semantics for
- adding or querying objects.
+ searching for existing objects or adding new objects.
</p>
<p>
- This means that the container creates the objects 'in place', in storage
- created by the containers allocator. As such, to add a new object to a heterogenous
- container, you provide the type and the construction arguments.
- </p>
-<p>
- Clones are created using the same allocator as that used to make the original
- objects; this is why it is important that you overload <code class="computeroutput"><span class="identifier">make_copy</span><span class="special">(</span><span class="identifier">abstract_allocator</span>
- <span class="special">&)</span> <span class="keyword">const</span></code>,
- rather than the <code class="computeroutput"><span class="identifier">make_copy</span></code>
- method that does not take an allocator. Indeed, there is a good case to be
- made for removing this second method from the library completely.
- </p>
-<p>
- For now, it will be enough to absorb the emplace syntax, and to note that
- the cloned list called <code class="computeroutput"><span class="identifier">copy</span></code>
- made a deep copy of the list; the underlying base pointers were not just
- copied - they were cloned.
+ For now, it will be enough to absorb the <span class="emphasis"><em>emplacement syntax</em></span>
+ for adding new elements, and to note that the cloned list called <code class="computeroutput"><span class="identifier">copy</span></code> made a deep copy of the list; the
+ underlying base pointers were not just copied - they were cloned.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -81,7 +69,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../containers.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="container_method_names.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/set.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/set.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/set.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -27,7 +27,17 @@
<a name="cloneable.containers.set"></a><a class="link" href="set.html" title="Set">Set</a>
</h3></div></div></div>
<p>
- TODO
+ So far we have been intoduced to the two basic heterogenous sequence containers,
+ <code class="computeroutput"><span class="identifier">list</span></code> and <code class="computeroutput"><span class="identifier">vector</span></code>.
+ The main difference over the standard containers is how you add new objects
+ to them, and that they are, well, heterogenous. You can store any type of
+ object in them that derives from the base type that you used to define the
+ list or vector.
+ </p>
+<p>
+ Things start to get interesting with the associative containers <code class="computeroutput"><span class="identifier">set</span></code> and <code class="computeroutput"><span class="identifier">map</span></code>.
+ Here we take a quick look at how we might use a heterogenous set to store
+ a collection of animals.
</p>
<p>
@@ -37,21 +47,22 @@
<span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">Set</span><span class="special">;</span>
<span class="identifier">Set</span> <span class="identifier">set</span><span class="special">;</span>
- <span class="identifier">Cat</span> <span class="special">&</span><span class="identifier">sam</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">1.5</span><span class="special">);</span>
- <span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">spot</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">3</span><span class="special">);</span>
- <span class="identifier">Labrador</span> <span class="special">&</span><span class="identifier">max</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
+ <span class="keyword">const</span> <span class="identifier">Cat</span> <span class="special">&</span><span class="identifier">sam</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">1.5</span><span class="special">).</span><span class="identifier">deref</span><span class="special">();</span>
+ <span class="keyword">const</span> <span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">spot</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">3</span><span class="special">).</span><span class="identifier">deref</span><span class="special">();</span>
+ <span class="keyword">const</span> <span class="identifier">Labrador</span> <span class="special">&</span><span class="identifier">max</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">).</span><span class="identifier">deref</span><span class="special">();</span>
<span class="identifier">Set</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">;</span>
- <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">dog</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">14</span><span class="special">);</span>
- <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">any</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">>(</span><span class="number">1.5</span><span class="special">);</span>
-
+ <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">dog</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">14</span><span class="special">);</span> <span class="comment">// find a dog aged 14
+</span> <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">any</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">>(</span><span class="number">1.5</span><span class="special">);</span> <span class="comment">// find any animal aged 1.5
+</span> <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">cat</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// find a cat aged 3
+</span>
<span class="identifier">assert</span><span class="special">(&*</span><span class="identifier">dog</span> <span class="special">==</span> <span class="special">&</span><span class="identifier">max</span><span class="special">);</span>
<span class="identifier">assert</span><span class="special">(&*</span><span class="identifier">any</span> <span class="special">==</span> <span class="special">&</span><span class="identifier">sam</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">cat</span> <span class="special">==</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">end</span><span class="special">());</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
-
</pre>
<p>
</p>
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/vector.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/vector.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers/vector.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -27,16 +27,18 @@
<a name="cloneable.containers.vector"></a><a class="link" href="vector.html" title="Vector">Vector</a>
</h3></div></div></div>
<p>
- TODO
+ The vector gets the same treatment as lists, with the same syntax for adding
+ new elements, but also some extra methods for random access of specifically
+ typed contained objects:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">Vector</span><span class="special">;</span>
<span class="identifier">Vector</span> <span class="identifier">vector</span><span class="special">;</span>
-<span class="identifier">vector</span><span class="special">.</span><span class="identifier">emplace_back</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">);</span>
-<span class="identifier">vector</span><span class="special">.</span><span class="identifier">emplace_back</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">);</span>
-<span class="identifier">vector</span><span class="special">.</span><span class="identifier">emplace_back</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
+<span class="identifier">vector</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">);</span>
+<span class="identifier">vector</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">);</span>
+<span class="identifier">vector</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
<span class="identifier">Vector</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">;</span>
@@ -44,9 +46,35 @@
<span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">labs_dog</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">as</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">2</span><span class="special">);</span>
<span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">spot</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">as</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">1</span><span class="special">);</span>
+<span class="keyword">const</span> <span class="identifier">Dog</span> <span class="special">*</span><span class="identifier">maybe_dog</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">cast</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">0</span><span class="special">);</span>
</pre>
<p>
</p>
+<p>
+ <span class="emphasis"><em>Again, the names here have undergone a number of changes and remain
+ in flux. Suggestions welcome!</em></span>
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">push_back</span></code> works just like
+ with <code class="computeroutput"><span class="identifier">list</span></code> and is not surprising.
+ But the <code class="computeroutput"><span class="identifier">as</span></code> and <code class="computeroutput"><span class="identifier">cast</span></code> methods are new.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">vector</span><span class="special">::</span><span class="identifier">as</span></code> is the same as <code class="computeroutput"><span class="identifier">vector</span><span class="special">::</span><span class="identifier">at</span></code> except
+ that it requires a type to convert to. <code class="computeroutput"><span class="identifier">at</span></code>
+ will return a base reference. <code class="computeroutput"><span class="identifier">as</span></code>
+ returns a derived-type reference, or throws <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_cast</span></code>.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">vector</span><span class="special">::</span><span class="identifier">cast</span></code> (<span class="emphasis"><em>another name in need of
+ a better name</em></span>) returns a pointer of the given type to the specified
+ element, or returns the null pointer if conversion was not possible or ambiguous.
+ </p>
+<p>
+ The other members in <code class="computeroutput"><span class="identifier">vector</span></code>
+ are largely what you would expect with no real surprises. See the reference
+ for complete details.
+ </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/container_method_names.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/container_method_names.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,108 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Container Method Names</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="extended_object_hierarhcy.html" title="Extended Object Hierarhcy">
+<link rel="next" href="list.html" title="List">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="extended_object_hierarhcy.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="list.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Container Method Names">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.container_method_names"></a><a class="link" href="container_method_names.html" title="Container Method Names">Container
+ Method Names</a>
+</h3></div></div></div>
+<p>
+ To add an element of type <code class="computeroutput"><span class="identifier">Ty</span></code>
+ to any heterogenous container such as a <code class="computeroutput"><span class="identifier">list</span></code>,
+ <code class="computeroutput"><span class="identifier">vector</span></code> or <code class="computeroutput"><span class="identifier">set</span></code>
+ we use the following syntax:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">container</span><span class="special">.</span><span class="identifier">add_method_name</span><span class="special"><</span><span class="identifier">Ty</span><span class="special">>(</span><span class="identifier">a0</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">,...,</span> <span class="identifier">an</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Specifically, we do not directly add an object to a heterogenous container.
+ Rather, we specify the type of thing to add, and provide any construction
+ arguments. This is true as well for specifying objects to search for in associative
+ containers:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">container</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Ty</span><span class="special">>(</span><span class="identifier">a0</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">,...,</span> <span class="identifier">an</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ This creates a new object of type <code class="computeroutput"><span class="identifier">Ty</span></code>,
+ constructed with the provided arguments, and searches for it in the container.
+ But, I'm getting a little ahead of ourselves here - more on associative containers
+ later; let's look at that syntax again.
+ </p>
+<p>
+ The name for the method to add new objects to heterogenous sequence containers
+ has gone from being called <code class="computeroutput"><span class="identifier">push_back</span></code>
+ to <code class="computeroutput"><span class="identifier">emplace_back</span></code> to <code class="computeroutput"><span class="identifier">push_emplace_back</span></code> and back to <code class="computeroutput"><span class="identifier">push_back</span></code>. Similarly for associative containers
+ the names have varied from <code class="computeroutput"><span class="identifier">insert</span></code>
+ to <code class="computeroutput"><span class="identifier">emplace</span></code> to <code class="computeroutput"><span class="identifier">emplace_insert</span></code> and back to <code class="computeroutput"><span class="identifier">insert</span></code>.
+ </p>
+<p>
+ The C++0x containers have emplace methods that insert a new object after
+ a given iterator location, by passing construction arguments. These are called
+ <code class="computeroutput"><span class="identifier">emplace</span></code> methods.
+ </p>
+<p>
+ This is similar to the way that objects are added to heterogenous containers,
+ but not the same. For all heterogenous containers, the process is to specify
+ the type of thing and any creation arguments. There is no need to specify
+ an iterator, but there is a need to specify the type explicitly. This is
+ different to the C++0x containers, which do not require the type.
+ </p>
+<p>
+ For this reason the names have changed and are yet to be settled. All suggestions
+ for the names of the methods, or namespaces, are welcome. I am sure they'll
+ end up being called something like <code class="computeroutput"><span class="identifier">emplace_back</span></code>
+ rather than <code class="computeroutput"><span class="identifier">push_back</span></code>; but
+ the difference is that there is no <code class="computeroutput"><span class="identifier">push_back</span></code>
+ in a heterogenous container: everything is always <span class="emphasis"><em>emplaced</em></span>,
+ so this is one reason why I've been vasilating over the naming conventions
+ to use.
+ </p>
+<p>
+ With this in mind, let's visit the first container: the faithful list.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="extended_object_hierarhcy.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="list.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/extended_object_hierarhcy.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/extended_object_hierarhcy.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,142 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Extended Object Hierarhcy</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="next" href="container_method_names.html" title="Container Method Names">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="container_method_names.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Extended Object Hierarhcy">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.extended_object_hierarhcy"></a><a class="link" href="extended_object_hierarhcy.html" title="Extended Object Hierarhcy">Extended
+ Object Hierarhcy</a>
+</h3></div></div></div>
+<p>
+ This is the definitions we will use in the following examples. First, let's
+ look at a slightly extended base type for our Animal hierarchy:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">Animal</span>
+<span class="special">{</span>
+ <span class="keyword">double</span> <span class="identifier">age</span><span class="special">;</span>
+ <span class="identifier">string</span> <span class="identifier">name</span><span class="special">;</span>
+
+ <span class="identifier">Animal</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">years_old</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">age</span><span class="special">(</span><span class="identifier">years_old</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+ <span class="identifier">Animal</span><span class="special">(</span><span class="identifier">string</span> <span class="identifier">n</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">years_old</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">age</span><span class="special">(</span><span class="identifier">years_old</span><span class="special">),</span> <span class="identifier">name</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">left</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">right</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">left</span><span class="special">.</span><span class="identifier">age</span> <span class="special">==</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">age</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">left</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">right</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">left</span><span class="special">.</span><span class="identifier">age</span> <span class="special"><</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">age</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">struct</span> <span class="identifier">CompareNames</span>
+ <span class="special">{</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">left</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Animal</span> <span class="special">&</span><span class="identifier">right</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">left</span><span class="special">.</span><span class="identifier">name</span> <span class="special"><</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">name</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ This is just a little more elaborate than the previous example hierarchy
+ we used earlier in the tutorial. We have added an <code class="computeroutput"><span class="identifier">age</span></code>
+ field for all animals, which is how old it is in years. Animals have relational
+ operators for testing equivalence and sorting. Another functor named <code class="computeroutput"><span class="identifier">CompareNames</span></code> is provided, which sorts by
+ the name field of animals rather than age.
+ </p>
+<p>
+ You are aware that getting your base class right is very important to the
+ strength and efficacy of the hierarchy as a whole. At a minimum, you must
+ of course use a virtual destructor. Getting the comparison operators right
+ is very important as well, but of course we can always add more sorting predicates
+ such as <code class="computeroutput"><span class="identifier">CompareNames</span></code> as needed.
+ </p>
+<p>
+ What we would like to avoid is having a so-called <span class="emphasis"><em>fat interface</em></span>
+ as the base class, which has a lot of extra information that is only relevant
+ to one or more derived types. Some of these issues can be addressed with
+ further use of interfaces and virtual methods to obtain sorting criteria.
+ </p>
+<p>
+ A full discussion on object-oriented design is beyond the scope of this brief
+ tutorial - and I'm sure you're very aware of the issues in any case. Suffice
+ to say that you should pay attention to how you design your base types. Always
+ use a virtual destructor, try to keep state to a minimum, and bear in mind
+ how you will want to compare objects.
+ </p>
+<p>
+ Moving on, we define our derived types:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">Cat</span> <span class="special">:</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">></span>
+<span class="special">{</span>
+ <span class="identifier">Cat</span><span class="special">(</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">age</span> <span class="special">=</span> <span class="number">10</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">Animal</span><span class="special">(</span><span class="identifier">name</span><span class="special">,</span> <span class="identifier">age</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">struct</span> <span class="identifier">Dog</span> <span class="special">:</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">></span>
+<span class="special">{</span>
+ <span class="identifier">Dog</span><span class="special">(</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">age</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">Animal</span><span class="special">(</span><span class="identifier">name</span><span class="special">,</span> <span class="identifier">age</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">struct</span> <span class="identifier">Labrador</span> <span class="special">:</span> <span class="identifier">Dog</span><span class="special">,</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">></span>
+<span class="special">{</span>
+ <span class="keyword">bool</span> <span class="identifier">is_guide_dog</span><span class="special">;</span>
+ <span class="identifier">Labrador</span><span class="special">(</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">can_lead</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">age</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">Dog</span><span class="special">(</span><span class="identifier">name</span><span class="special">,</span> <span class="identifier">age</span><span class="special">),</span> <span class="identifier">is_guide_dog</span><span class="special">(</span><span class="identifier">can_lead</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ Labradors now have an extra field indicating that a given instance has been
+ trained as a guide dog, and each Animal type can be constructed by passing
+ its name and age. Note that there are no default constructors for any of
+ the Animal types.
+ </p>
+<p>
+ Feel free to return to this page to refresh your memory as we walk through
+ some examples that use these definitions.
+ </p>
+<p>
+ First, a preamble on names and semantics.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="container_method_names.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/hashmap_and_hashset.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/hashmap_and_hashset.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>HashMap and HashSet</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="map.html" title="Map">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="map.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a>
+</div>
+<div class="section" title="HashMap and HashSet">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.hashmap_and_hashset"></a><a class="link" href="hashmap_and_hashset.html" title="HashMap and HashSet">HashMap
+ and HashSet</a>
+</h3></div></div></div>
+<p>
+ These share the same interface as <code class="computeroutput"><span class="identifier">map</span></code>
+ and <code class="computeroutput"><span class="identifier">set</span></code>, but are based on
+ hash tables rather than a tree.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="map.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/list.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/list.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,75 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>List</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="container_method_names.html" title="Container Method Names">
+<link rel="next" href="vector.html" title="Vector">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="container_method_names.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="List">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.list"></a><a class="link" href="list.html" title="List">List</a>
+</h3></div></div></div>
+<p>
+ The first heterogenous container we'll look at is the <code class="computeroutput"><span class="identifier">list</span></code>.
+ It is very much like a standard <code class="computeroutput"><span class="identifier">list</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>.
+ But it is also very different:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">List</span><span class="special">;</span>
+
+<span class="identifier">List</span> <span class="identifier">list</span><span class="special">;</span>
+<span class="identifier">list</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">12</span><span class="special">);</span>
+<span class="identifier">list</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">8</span><span class="special">);</span>
+<span class="identifier">list</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
+
+<span class="identifier">List</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">list</span><span class="special">;</span>
+
+<span class="keyword">const</span> <span class="identifier">Labrador</span> <span class="special">&</span><span class="identifier">lab</span> <span class="special">=</span> <span class="identifier">list</span><span class="special">.</span><span class="identifier">back_as</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>();</span>
+<span class="identifier">assert</span><span class="special">(</span><span class="identifier">lab</span><span class="special">.</span><span class="identifier">name</span> <span class="special">==</span> <span class="string">"max"</span> <span class="special">&&</span> <span class="identifier">lab</span><span class="special">.</span><span class="identifier">age</span> <span class="special">==</span> <span class="number">14</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ The first thing you may notice is the strange way we add new items to a list.
+ All heterogenous containers use <span class="emphasis"><em>emplace</em></span> semantics for
+ searching for existing objects or adding new objects.
+ </p>
+<p>
+ For now, it will be enough to absorb the <span class="emphasis"><em>emplacement syntax</em></span>
+ for adding new elements, and to note that the cloned list called <code class="computeroutput"><span class="identifier">copy</span></code> made a deep copy of the list; the
+ underlying base pointers were not just copied - they were cloned.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="container_method_names.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/map.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/map.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,69 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Map</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="set.html" title="Set">
+<link rel="next" href="hashmap_and_hashset.html" title="HashMap and HashSet">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="hashmap_and_hashset.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Map">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.map"></a><a class="link" href="map.html" title="Map">Map</a>
+</h3></div></div></div>
+<p>
+ TODO
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">Map</span><span class="special">;</span>
+ <span class="identifier">Map</span> <span class="identifier">map</span><span class="special">;</span>
+ <span class="identifier">Map</span><span class="special">::</span><span class="identifier">value_type</span> <span class="special">&</span><span class="identifier">pair0</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">key</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">12</span><span class="special">).</span><span class="identifier">value</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"rover"</span><span class="special">,</span> <span class="number">8</span><span class="special">);</span>
+ <span class="identifier">Map</span><span class="special">::</span><span class="identifier">value_type</span> <span class="special">&</span><span class="identifier">pair1</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">key</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">6</span><span class="special">).</span><span class="identifier">value</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sooty"</span><span class="special">,</span> <span class="number">10</span><span class="special">);</span>
+ <span class="identifier">Map</span><span class="special">::</span><span class="identifier">value_type</span> <span class="special">&</span><span class="identifier">pair2</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">key</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"fluffy"</span><span class="special">,</span> <span class="number">10</span><span class="special">).</span><span class="identifier">value</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"tigger"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
+ <span class="identifier">Map</span><span class="special">::</span><span class="identifier">value_type</span> <span class="special">&</span><span class="identifier">pair3</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">key</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">12</span><span class="special">).</span><span class="identifier">value</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sooty"</span><span class="special">,</span> <span class="number">3</span><span class="special">);</span>
+
+ <span class="identifier">Map</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">;</span>
+
+ <span class="identifier">Map</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">found_pair0</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span>
+
+ <span class="identifier">assert</span><span class="special">(&</span><span class="identifier">found_pair0</span><span class="special">-></span><span class="identifier">first</span> <span class="special">==</span> <span class="identifier">pair1</span><span class="special">.</span><span class="identifier">first</span><span class="special">);</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="hashmap_and_hashset.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/set.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/set.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,83 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Set</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="vector.html" title="Vector">
+<link rel="next" href="map.html" title="Map">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="vector.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="map.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Set">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.set"></a><a class="link" href="set.html" title="Set">Set</a>
+</h3></div></div></div>
+<p>
+ So far we have been intoduced to the two basic heterogenous sequence containers,
+ <code class="computeroutput"><span class="identifier">list</span></code> and <code class="computeroutput"><span class="identifier">vector</span></code>.
+ The main difference over the standard containers is how you add new objects
+ to them, and that they are, well, heterogenous. You can store any type of
+ object in them that derives from the base type that you used to define the
+ list or vector.
+ </p>
+<p>
+ Things start to get interesting with the associative containers <code class="computeroutput"><span class="identifier">set</span></code> and <code class="computeroutput"><span class="identifier">map</span></code>.
+ Here we take a quick look at how we might use a heterogenous set to store
+ a collection of animals.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">Set</span><span class="special">;</span>
+ <span class="identifier">Set</span> <span class="identifier">set</span><span class="special">;</span>
+
+ <span class="keyword">const</span> <span class="identifier">Cat</span> <span class="special">&</span><span class="identifier">sam</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">,</span> <span class="number">1.5</span><span class="special">).</span><span class="identifier">deref</span><span class="special">();</span>
+ <span class="keyword">const</span> <span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">spot</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">,</span> <span class="number">3</span><span class="special">).</span><span class="identifier">deref</span><span class="special">();</span>
+ <span class="keyword">const</span> <span class="identifier">Labrador</span> <span class="special">&</span><span class="identifier">max</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">emplace</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">).</span><span class="identifier">deref</span><span class="special">();</span>
+
+ <span class="identifier">Set</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">set</span><span class="special">;</span>
+
+ <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">dog</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">14</span><span class="special">);</span> <span class="comment">// find a dog aged 14
+</span> <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">any</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">>(</span><span class="number">1.5</span><span class="special">);</span> <span class="comment">// find any animal aged 1.5
+</span> <span class="identifier">Set</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">cat</span> <span class="special">=</span> <span class="identifier">copy</span><span class="special">.</span><span class="identifier">find</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// find a cat aged 3
+</span>
+ <span class="identifier">assert</span><span class="special">(&*</span><span class="identifier">dog</span> <span class="special">==</span> <span class="special">&</span><span class="identifier">max</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(&*</span><span class="identifier">any</span> <span class="special">==</span> <span class="special">&</span><span class="identifier">sam</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">cat</span> <span class="special">==</span> <span class="identifier">set</span><span class="special">.</span><span class="identifier">end</span><span class="special">());</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="vector.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="map.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/vector.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/heterogenous_containers/vector.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -0,0 +1,92 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Vector</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../heterogenous_containers.html" title="Heterogenous Containers">
+<link rel="prev" href="list.html" title="List">
+<link rel="next" href="set.html" title="Set">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="list.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="set.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Vector">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.heterogenous_containers.vector"></a><a class="link" href="vector.html" title="Vector">Vector</a>
+</h3></div></div></div>
+<p>
+ The vector gets the same treatment as lists, with the same syntax for adding
+ new elements, but also some extra methods for random access of specifically
+ typed contained objects:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">heterogenous</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">Animal</span><span class="special">></span> <span class="identifier">Vector</span><span class="special">;</span>
+<span class="identifier">Vector</span> <span class="identifier">vector</span><span class="special">;</span>
+<span class="identifier">vector</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Cat</span><span class="special">>(</span><span class="string">"sam"</span><span class="special">);</span>
+<span class="identifier">vector</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="string">"spot"</span><span class="special">);</span>
+<span class="identifier">vector</span><span class="special">.</span><span class="identifier">push_back</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="string">"max"</span><span class="special">,</span> <span class="number">14</span><span class="special">);</span>
+
+<span class="identifier">Vector</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">;</span>
+
+<span class="identifier">Labrador</span> <span class="special">&</span><span class="identifier">lab</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">as</span><span class="special"><</span><span class="identifier">Labrador</span><span class="special">>(</span><span class="number">2</span><span class="special">);</span>
+<span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">labs_dog</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">as</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">2</span><span class="special">);</span>
+<span class="identifier">Dog</span> <span class="special">&</span><span class="identifier">spot</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">as</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">1</span><span class="special">);</span>
+
+<span class="keyword">const</span> <span class="identifier">Dog</span> <span class="special">*</span><span class="identifier">maybe_dog</span> <span class="special">=</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">cast</span><span class="special"><</span><span class="identifier">Dog</span><span class="special">>(</span><span class="number">0</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ <span class="emphasis"><em>Again, the names here have undergone a number of changes and remain
+ in flux. Suggestions welcome!</em></span>
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">push_back</span></code> works just like
+ with <code class="computeroutput"><span class="identifier">list</span></code> and is not surprising.
+ But the <code class="computeroutput"><span class="identifier">as</span></code> and <code class="computeroutput"><span class="identifier">cast</span></code> methods are new.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">vector</span><span class="special">::</span><span class="identifier">as</span></code> is the same as <code class="computeroutput"><span class="identifier">vector</span><span class="special">::</span><span class="identifier">at</span></code> except
+ that it requires a type to convert to. <code class="computeroutput"><span class="identifier">at</span></code>
+ will return a base reference. <code class="computeroutput"><span class="identifier">as</span></code>
+ returns a derived-type reference, or throws <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_cast</span></code>.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">vector</span><span class="special">::</span><span class="identifier">cast</span></code> (<span class="emphasis"><em>another name in need of
+ a better name</em></span>) returns a pointer of the given type to the specified
+ element, or returns the null pointer if conversion was not possible or ambiguous.
+ </p>
+<p>
+ The other members in <code class="computeroutput"><span class="identifier">vector</span></code>
+ are largely what you would expect with no real surprises. See the reference
+ for complete details.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="list.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../heterogenous_containers.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="set.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -33,13 +33,13 @@
Construction</a></span></dt>
<dt><span class="section"><a href="tutorial/using_external_types.html">Using External
Types</a></span></dt>
-<dt><span class="section"><a href="tutorial/dealing_with_muliple_subobjects.html">Dealing
- with Muliple SubObjects</a></span></dt>
+<dt><span class="section"><a href="tutorial/dealing_with_muliple_sub_objects.html">Dealing
+ with Muliple Sub-Objects</a></span></dt>
<dt><span class="section"><a href="tutorial/customising_the_cloning_process.html">Customising
the Cloning Process</a></span></dt>
-<dt><span class="section">Cloneable Traits</span></dt>
<dt><span class="section"><a href="tutorial/using_custom_allocators.html">Using Custom
Allocators</a></span></dt>
+<dt><span class="section">Cloneable Traits</span></dt>
</dl></div>
<p>
This tutorial progresses through the basic usage of the library, demonstrating
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -6,8 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="../../index.html" title="Cloneable 0.1">
<link rel="up" href="../tutorial.html" title="Tutorial">
-<link rel="prev" href="dealing_with_muliple_subobjects.html" title="Dealing with Muliple SubObjects">
-<link rel="next" href="cloneable_traits.html" title="Cloneable Traits">
+<link rel="prev" href="dealing_with_muliple_sub_objects.html" title="Dealing with Muliple Sub-Objects">
+<link rel="next" href="using_custom_allocators.html" title="Using Custom Allocators">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="dealing_with_muliple_subobjects.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="cloneable_traits.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="dealing_with_muliple_sub_objects.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="using_custom_allocators.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Customising the Cloning Process">
<div class="titlepage"><div><div><h3 class="title">
@@ -76,7 +76,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="dealing_with_muliple_subobjects.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="cloneable_traits.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="dealing_with_muliple_sub_objects.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="using_custom_allocators.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -6,8 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="../../index.html" title="Cloneable 0.1">
<link rel="up" href="../tutorial.html" title="Tutorial">
-<link rel="prev" href="cloneable_traits.html" title="Cloneable Traits">
-<link rel="next" href="../containers.html" title="Containers">
+<link rel="prev" href="customising_the_cloning_process.html" title="Customising the Cloning Process">
+<link rel="next" href="cloneable_traits.html" title="Cloneable Traits">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="cloneable_traits.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../containers.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="customising_the_cloning_process.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="cloneable_traits.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Using Custom Allocators">
<div class="titlepage"><div><div><h3 class="title">
@@ -122,7 +122,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="cloneable_traits.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../containers.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="customising_the_cloning_process.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="cloneable_traits.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -7,7 +7,7 @@
<link rel="home" href="../../index.html" title="Cloneable 0.1">
<link rel="up" href="../tutorial.html" title="Tutorial">
<link rel="prev" href="controlling_construction.html" title="Controlling Construction">
-<link rel="next" href="dealing_with_muliple_subobjects.html" title="Dealing with Muliple SubObjects">
+<link rel="next" href="dealing_with_muliple_sub_objects.html" title="Dealing with Muliple Sub-Objects">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="controlling_construction.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="dealing_with_muliple_subobjects.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="controlling_construction.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="dealing_with_muliple_sub_objects.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Using External Types">
<div class="titlepage"><div><div><h3 class="title">
@@ -98,7 +98,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="controlling_construction.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="dealing_with_muliple_subobjects.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="controlling_construction.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="dealing_with_muliple_sub_objects.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/cloneable/libs/cloneable/doc/html/index.html
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/index.html (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/index.html 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -28,7 +28,7 @@
</h3></div></div></div>
<div><p class="copyright">Copyright © 2009 Christian Schladetsch</p></div>
<div><div class="legalnotice" title="Legal Notice">
-<a name="id663289"></a><p>
+<a name="id646905"></a><p>
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)
</p>
@@ -49,28 +49,32 @@
Construction</a></span></dt>
<dt><span class="section"><a href="cloneable/tutorial/using_external_types.html">Using External
Types</a></span></dt>
-<dt><span class="section"><a href="cloneable/tutorial/dealing_with_muliple_subobjects.html">Dealing
- with Muliple SubObjects</a></span></dt>
+<dt><span class="section"><a href="cloneable/tutorial/dealing_with_muliple_sub_objects.html">Dealing
+ with Muliple Sub-Objects</a></span></dt>
<dt><span class="section"><a href="cloneable/tutorial/customising_the_cloning_process.html">Customising
the Cloning Process</a></span></dt>
-<dt><span class="section">Cloneable Traits</span></dt>
<dt><span class="section"><a href="cloneable/tutorial/using_custom_allocators.html">Using Custom
Allocators</a></span></dt>
+<dt><span class="section">Cloneable Traits</span></dt>
</dl></dd>
-<dt><span class="section">Containers</span></dt>
+<dt><span class="section">Heterogenous Containers</span></dt>
<dd><dl>
-<dt><span class="section">List</span></dt>
-<dt><span class="section">Vector</span></dt>
-<dt><span class="section">Set</span></dt>
-<dt><span class="section">Map</span></dt>
-<dt><span class="section"><a href="cloneable/containers/hashmap_and_hashset.html">HashMap and
- HashSet</a></span></dt>
+<dt><span class="section"><a href="cloneable/heterogenous_containers/extended_object_hierarhcy.html">Extended
+ Object Hierarhcy</a></span></dt>
+<dt><span class="section"><a href="cloneable/heterogenous_containers/container_method_names.html">Container
+ Method Names</a></span></dt>
+<dt><span class="section">List</span></dt>
+<dt><span class="section">Vector</span></dt>
+<dt><span class="section">Set</span></dt>
+<dt><span class="section">Map</span></dt>
+<dt><span class="section"><a href="cloneable/heterogenous_containers/hashmap_and_hashset.html">HashMap
+ and HashSet</a></span></dt>
</dl></dd>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: July 04, 2009 at 02:08:30 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 04, 2009 at 09:08:01 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest (original)
+++ sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest 2009-07-04 05:10:04 EDT (Sat, 04 Jul 2009)
@@ -5,13 +5,15 @@
cloneable/tutorial/simple_hierarchical_cloning.html
cloneable/tutorial/controlling_construction.html
cloneable/tutorial/using_external_types.html
-cloneable/tutorial/dealing_with_muliple_subobjects.html
+cloneable/tutorial/dealing_with_muliple_sub_objects.html
cloneable/tutorial/customising_the_cloning_process.html
-cloneable/tutorial/cloneable_traits.html
cloneable/tutorial/using_custom_allocators.html
-cloneable/containers.html
-cloneable/containers/list.html
-cloneable/containers/vector.html
-cloneable/containers/set.html
-cloneable/containers/map.html
-cloneable/containers/hashmap_and_hashset.html
+cloneable/tutorial/cloneable_traits.html
+cloneable/heterogenous_containers.html
+cloneable/heterogenous_containers/extended_object_hierarhcy.html
+cloneable/heterogenous_containers/container_method_names.html
+cloneable/heterogenous_containers/list.html
+cloneable/heterogenous_containers/vector.html
+cloneable/heterogenous_containers/set.html
+cloneable/heterogenous_containers/map.html
+cloneable/heterogenous_containers/hashmap_and_hashset.html
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