From 4882dfdb945560b240c50a913954d8709f23600d Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 15 Jan 2004 15:33:35 +0000 Subject: [PATCH] Generated BoostBook HTML documentation for 1.31.0 [SVN r21754] --- doc/html/Assignable.html | 75 ++ doc/html/BOOST_VARIANT_ENUM_PARAMS.html | 84 +++ .../BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html | 82 +++ doc/html/BOOST_VARIANT_LIMIT_TYPES.html | 78 +++ ...ANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html | 83 +++ .../BOOST_VARIANT_NO_REFERENCE_SUPPORT.html | 75 ++ ...OOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html | 78 +++ doc/html/BidirectionalIterator.html | 88 +++ doc/html/CopyConstructible.html | 74 ++ doc/html/DefaultConstructible.html | 74 ++ doc/html/EqualityComparable.html | 74 ++ doc/html/ForwardIterator.html | 88 +++ doc/html/InputIterator.html | 93 +++ doc/html/LessThanComparable.html | 75 ++ doc/html/OutputIterator.html | 95 +++ doc/html/RandomAccessIterator.html | 91 +++ doc/html/SignedInteger.html | 75 ++ doc/html/any.html | 121 +++- doc/html/any.reference.html | 100 +++ doc/html/array.ack.html | 73 ++ doc/html/array.html | 113 ++- doc/html/array.issues.html | 81 +++ doc/html/array.more.info.html | 80 +++ doc/html/array.rationale.html | 87 +++ doc/html/array.reference.html | 88 +++ doc/html/boostbook.documenting.html | 172 +++++ doc/html/boostbook.dtd.boostbook.html | 84 +++ .../boostbook.dtd.class-specialization.html | 103 +++ doc/html/boostbook.dtd.class.html | 136 ++++ doc/html/boostbook.dtd.code.html | 84 +++ doc/html/boostbook.dtd.compile-fail-test.html | 86 +++ doc/html/boostbook.dtd.compile-test.html | 86 +++ doc/html/boostbook.dtd.complexity.html | 81 +++ doc/html/boostbook.dtd.constructor.html | 96 +++ doc/html/boostbook.dtd.copy-assignment.html | 99 +++ doc/html/boostbook.dtd.data-member.html | 84 +++ doc/html/boostbook.dtd.default.html | 81 +++ doc/html/boostbook.dtd.description.html | 87 +++ doc/html/boostbook.dtd.destructor.html | 94 +++ doc/html/boostbook.dtd.effects.html | 81 +++ doc/html/boostbook.dtd.enum.html | 84 +++ doc/html/boostbook.dtd.enumvalue.html | 82 +++ .../boostbook.dtd.free-function-group.html | 83 +++ doc/html/boostbook.dtd.function.html | 141 ++++ doc/html/boostbook.dtd.functionname.html | 88 +++ doc/html/boostbook.dtd.header.html | 81 +++ doc/html/boostbook.dtd.if-fails.html | 87 +++ doc/html/boostbook.dtd.inherit.html | 84 +++ doc/html/boostbook.dtd.lib.html | 81 +++ doc/html/boostbook.dtd.library-reference.html | 100 +++ doc/html/boostbook.dtd.library.html | 84 +++ doc/html/boostbook.dtd.librarycategory.html | 81 +++ .../boostbook.dtd.librarycategorydef.html | 81 +++ .../boostbook.dtd.librarycategorylist.html | 84 +++ doc/html/boostbook.dtd.libraryinfo.html | 83 +++ doc/html/boostbook.dtd.librarylist.html | 81 +++ doc/html/boostbook.dtd.libraryname.html | 81 +++ doc/html/boostbook.dtd.librarypurpose.html | 83 +++ doc/html/boostbook.dtd.link-fail-test.html | 86 +++ doc/html/boostbook.dtd.link-test.html | 86 +++ doc/html/boostbook.dtd.method-group.html | 83 +++ doc/html/boostbook.dtd.method.html | 97 +++ doc/html/boostbook.dtd.namespace.html | 104 +++ doc/html/boostbook.dtd.notes.html | 81 +++ .../boostbook.dtd.overloaded-function.html | 95 +++ doc/html/boostbook.dtd.overloaded-method.html | 95 +++ doc/html/boostbook.dtd.parameter.html | 83 +++ doc/html/boostbook.dtd.paramtype.html | 81 +++ doc/html/boostbook.dtd.postconditions.html | 81 +++ doc/html/boostbook.dtd.precondition.html | 81 +++ doc/html/boostbook.dtd.programlisting.html | 81 +++ doc/html/boostbook.dtd.purpose.html | 81 +++ doc/html/boostbook.dtd.rationale.html | 79 +++ doc/html/boostbook.dtd.requirement.html | 87 +++ doc/html/boostbook.dtd.requires.html | 81 +++ doc/html/boostbook.dtd.returns.html | 81 +++ doc/html/boostbook.dtd.run-fail-test.html | 86 +++ doc/html/boostbook.dtd.run-test.html | 86 +++ doc/html/boostbook.dtd.signature.html | 90 +++ doc/html/boostbook.dtd.snippet.html | 81 +++ doc/html/boostbook.dtd.source.html | 90 +++ doc/html/boostbook.dtd.specialization.html | 82 +++ doc/html/boostbook.dtd.static-constant.html | 85 +++ .../boostbook.dtd.struct-specialization.html | 105 +++ doc/html/boostbook.dtd.struct.html | 104 +++ doc/html/boostbook.dtd.template-arg.html | 81 +++ ...stbook.dtd.template-nontype-parameter.html | 84 +++ ...boostbook.dtd.template-type-parameter.html | 83 +++ doc/html/boostbook.dtd.template-varargs.html | 85 +++ doc/html/boostbook.dtd.template.html | 84 +++ doc/html/boostbook.dtd.testsuite.html | 87 +++ doc/html/boostbook.dtd.throws.html | 81 +++ doc/html/boostbook.dtd.type.html | 81 +++ doc/html/boostbook.dtd.typedef.html | 84 +++ .../boostbook.dtd.union-specialization.html | 105 +++ doc/html/boostbook.dtd.union.html | 104 +++ doc/html/boostbook.dtd.using-class.html | 81 +++ doc/html/boostbook.dtd.using-namespace.html | 81 +++ doc/html/boostbook.getting.started.html | 183 +++++ doc/html/boostbook.html | 130 +++- doc/html/boostbook.together.html | 111 +++ doc/html/ch01s02.html | 183 +++++ doc/html/ch02s02.html | 171 +++++ doc/html/ch02s04.html | 73 ++ doc/html/ch06s02.html | 649 ++++++++++++++++++ doc/html/ch06s04.html | 97 +++ doc/html/ch06s05.html | 173 +++++ doc/html/ch06s06.html | 340 +++++++++ doc/html/class.boost.any.html | 161 +++++ .../class.boost.apply_visitor_delayed_t.html | 99 +++ doc/html/class.boost.array.html | 229 ++++++ doc/html/class.boost.bad_any_cast.html | 79 +++ doc/html/class.boost.bad_function_call.html | 80 +++ doc/html/class.boost.bad_get.html | 79 +++ doc/html/class.boost.bad_visit.html | 78 +++ doc/html/class.boost.function.html | 217 ++++++ doc/html/class.boost.functionN.html | 202 ++++++ doc/html/class.boost.function_base.html | 85 +++ .../class.boost.is_recursive_wrapper.html | 86 +++ .../class.boost.is_reference_wrapper.html | 81 +++ doc/html/class.boost.last_value.html | 90 +++ .../class.boost.make_recursive_variant.html | 105 +++ ...ass.boost.make_recursive_variant_over.html | 89 +++ doc/html/class.boost.make_variant_over.html | 89 +++ doc/html/class.boost.recursive_wrapper.html | 154 +++++ doc/html/class.boost.reference_wrapper.html | 126 ++++ doc/html/class.boost.signal.html | 94 +++ doc/html/class.boost.signalN.html | 243 +++++++ doc/html/class.boost.signals.connection.html | 162 +++++ ...class.boost.signals.scoped_connection.html | 108 +++ doc/html/class.boost.signals.trackable.html | 116 ++++ doc/html/class.boost.slot.html | 89 +++ doc/html/class.boost.static_visitor.html | 84 +++ .../class.boost.unwrap_recursive_wrapper.html | 82 +++ doc/html/class.boost.unwrap_reference.html | 82 +++ doc/html/class.boost.variant.html | 325 +++++++++ doc/html/class.boost.visitor_ptr_t.html | 99 +++ doc/html/function.faq.html | 146 ++++ doc/html/function.history.html | 122 ++++ doc/html/function.html | 97 ++- doc/html/function.misc.html | 83 +++ doc/html/function.reference.html | 141 ++++ doc/html/function.testsuite.html | 73 ++ doc/html/function.tutorial.html | 183 +++++ doc/html/id2354683-bb.html | 85 +++ doc/html/id2383300-bb.html | 95 +++ doc/html/id2493238-bb.html | 120 ++++ doc/html/id2518553-bb.html | 81 +++ doc/html/id2524211-bb.html | 86 +++ doc/html/id2532119-bb.html | 98 +++ doc/html/id2544445-bb.html | 85 +++ doc/html/id2557051-bb.html | 124 ++++ doc/html/index.html | 128 ++++ doc/html/libraries.html | 111 +++ doc/html/ref.ack.html | 79 +++ doc/html/ref.html | 118 +++- doc/html/ref.reference.html | 79 +++ doc/html/reference.html | 147 ++++ doc/html/signals.html | 100 ++- doc/html/signals.reference.html | 103 +++ doc/html/signals.tests.html | 81 +++ doc/html/variant.design.html | 265 +++++++ doc/html/variant.html | 161 ++++- doc/html/variant.misc.html | 140 ++++ doc/html/variant.reference.html | 210 ++++++ doc/html/variant.refs.html | 149 ++++ doc/html/variant.tutorial.html | 457 ++++++++++++ 167 files changed, 18221 insertions(+), 70 deletions(-) create mode 100644 doc/html/Assignable.html create mode 100644 doc/html/BOOST_VARIANT_ENUM_PARAMS.html create mode 100644 doc/html/BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html create mode 100644 doc/html/BOOST_VARIANT_LIMIT_TYPES.html create mode 100644 doc/html/BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html create mode 100644 doc/html/BOOST_VARIANT_NO_REFERENCE_SUPPORT.html create mode 100644 doc/html/BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html create mode 100644 doc/html/BidirectionalIterator.html create mode 100644 doc/html/CopyConstructible.html create mode 100644 doc/html/DefaultConstructible.html create mode 100644 doc/html/EqualityComparable.html create mode 100644 doc/html/ForwardIterator.html create mode 100644 doc/html/InputIterator.html create mode 100644 doc/html/LessThanComparable.html create mode 100644 doc/html/OutputIterator.html create mode 100644 doc/html/RandomAccessIterator.html create mode 100644 doc/html/SignedInteger.html create mode 100644 doc/html/any.reference.html create mode 100644 doc/html/array.ack.html create mode 100644 doc/html/array.issues.html create mode 100644 doc/html/array.more.info.html create mode 100644 doc/html/array.rationale.html create mode 100644 doc/html/array.reference.html create mode 100644 doc/html/boostbook.documenting.html create mode 100644 doc/html/boostbook.dtd.boostbook.html create mode 100644 doc/html/boostbook.dtd.class-specialization.html create mode 100644 doc/html/boostbook.dtd.class.html create mode 100644 doc/html/boostbook.dtd.code.html create mode 100644 doc/html/boostbook.dtd.compile-fail-test.html create mode 100644 doc/html/boostbook.dtd.compile-test.html create mode 100644 doc/html/boostbook.dtd.complexity.html create mode 100644 doc/html/boostbook.dtd.constructor.html create mode 100644 doc/html/boostbook.dtd.copy-assignment.html create mode 100644 doc/html/boostbook.dtd.data-member.html create mode 100644 doc/html/boostbook.dtd.default.html create mode 100644 doc/html/boostbook.dtd.description.html create mode 100644 doc/html/boostbook.dtd.destructor.html create mode 100644 doc/html/boostbook.dtd.effects.html create mode 100644 doc/html/boostbook.dtd.enum.html create mode 100644 doc/html/boostbook.dtd.enumvalue.html create mode 100644 doc/html/boostbook.dtd.free-function-group.html create mode 100644 doc/html/boostbook.dtd.function.html create mode 100644 doc/html/boostbook.dtd.functionname.html create mode 100644 doc/html/boostbook.dtd.header.html create mode 100644 doc/html/boostbook.dtd.if-fails.html create mode 100644 doc/html/boostbook.dtd.inherit.html create mode 100644 doc/html/boostbook.dtd.lib.html create mode 100644 doc/html/boostbook.dtd.library-reference.html create mode 100644 doc/html/boostbook.dtd.library.html create mode 100644 doc/html/boostbook.dtd.librarycategory.html create mode 100644 doc/html/boostbook.dtd.librarycategorydef.html create mode 100644 doc/html/boostbook.dtd.librarycategorylist.html create mode 100644 doc/html/boostbook.dtd.libraryinfo.html create mode 100644 doc/html/boostbook.dtd.librarylist.html create mode 100644 doc/html/boostbook.dtd.libraryname.html create mode 100644 doc/html/boostbook.dtd.librarypurpose.html create mode 100644 doc/html/boostbook.dtd.link-fail-test.html create mode 100644 doc/html/boostbook.dtd.link-test.html create mode 100644 doc/html/boostbook.dtd.method-group.html create mode 100644 doc/html/boostbook.dtd.method.html create mode 100644 doc/html/boostbook.dtd.namespace.html create mode 100644 doc/html/boostbook.dtd.notes.html create mode 100644 doc/html/boostbook.dtd.overloaded-function.html create mode 100644 doc/html/boostbook.dtd.overloaded-method.html create mode 100644 doc/html/boostbook.dtd.parameter.html create mode 100644 doc/html/boostbook.dtd.paramtype.html create mode 100644 doc/html/boostbook.dtd.postconditions.html create mode 100644 doc/html/boostbook.dtd.precondition.html create mode 100644 doc/html/boostbook.dtd.programlisting.html create mode 100644 doc/html/boostbook.dtd.purpose.html create mode 100644 doc/html/boostbook.dtd.rationale.html create mode 100644 doc/html/boostbook.dtd.requirement.html create mode 100644 doc/html/boostbook.dtd.requires.html create mode 100644 doc/html/boostbook.dtd.returns.html create mode 100644 doc/html/boostbook.dtd.run-fail-test.html create mode 100644 doc/html/boostbook.dtd.run-test.html create mode 100644 doc/html/boostbook.dtd.signature.html create mode 100644 doc/html/boostbook.dtd.snippet.html create mode 100644 doc/html/boostbook.dtd.source.html create mode 100644 doc/html/boostbook.dtd.specialization.html create mode 100644 doc/html/boostbook.dtd.static-constant.html create mode 100644 doc/html/boostbook.dtd.struct-specialization.html create mode 100644 doc/html/boostbook.dtd.struct.html create mode 100644 doc/html/boostbook.dtd.template-arg.html create mode 100644 doc/html/boostbook.dtd.template-nontype-parameter.html create mode 100644 doc/html/boostbook.dtd.template-type-parameter.html create mode 100644 doc/html/boostbook.dtd.template-varargs.html create mode 100644 doc/html/boostbook.dtd.template.html create mode 100644 doc/html/boostbook.dtd.testsuite.html create mode 100644 doc/html/boostbook.dtd.throws.html create mode 100644 doc/html/boostbook.dtd.type.html create mode 100644 doc/html/boostbook.dtd.typedef.html create mode 100644 doc/html/boostbook.dtd.union-specialization.html create mode 100644 doc/html/boostbook.dtd.union.html create mode 100644 doc/html/boostbook.dtd.using-class.html create mode 100644 doc/html/boostbook.dtd.using-namespace.html create mode 100644 doc/html/boostbook.getting.started.html create mode 100644 doc/html/boostbook.together.html create mode 100644 doc/html/ch01s02.html create mode 100644 doc/html/ch02s02.html create mode 100644 doc/html/ch02s04.html create mode 100644 doc/html/ch06s02.html create mode 100644 doc/html/ch06s04.html create mode 100644 doc/html/ch06s05.html create mode 100644 doc/html/ch06s06.html create mode 100644 doc/html/class.boost.any.html create mode 100644 doc/html/class.boost.apply_visitor_delayed_t.html create mode 100644 doc/html/class.boost.array.html create mode 100644 doc/html/class.boost.bad_any_cast.html create mode 100644 doc/html/class.boost.bad_function_call.html create mode 100644 doc/html/class.boost.bad_get.html create mode 100644 doc/html/class.boost.bad_visit.html create mode 100644 doc/html/class.boost.function.html create mode 100644 doc/html/class.boost.functionN.html create mode 100644 doc/html/class.boost.function_base.html create mode 100644 doc/html/class.boost.is_recursive_wrapper.html create mode 100644 doc/html/class.boost.is_reference_wrapper.html create mode 100644 doc/html/class.boost.last_value.html create mode 100644 doc/html/class.boost.make_recursive_variant.html create mode 100644 doc/html/class.boost.make_recursive_variant_over.html create mode 100644 doc/html/class.boost.make_variant_over.html create mode 100644 doc/html/class.boost.recursive_wrapper.html create mode 100644 doc/html/class.boost.reference_wrapper.html create mode 100644 doc/html/class.boost.signal.html create mode 100644 doc/html/class.boost.signalN.html create mode 100644 doc/html/class.boost.signals.connection.html create mode 100644 doc/html/class.boost.signals.scoped_connection.html create mode 100644 doc/html/class.boost.signals.trackable.html create mode 100644 doc/html/class.boost.slot.html create mode 100644 doc/html/class.boost.static_visitor.html create mode 100644 doc/html/class.boost.unwrap_recursive_wrapper.html create mode 100644 doc/html/class.boost.unwrap_reference.html create mode 100644 doc/html/class.boost.variant.html create mode 100644 doc/html/class.boost.visitor_ptr_t.html create mode 100644 doc/html/function.faq.html create mode 100644 doc/html/function.history.html create mode 100644 doc/html/function.misc.html create mode 100644 doc/html/function.reference.html create mode 100644 doc/html/function.testsuite.html create mode 100644 doc/html/function.tutorial.html create mode 100644 doc/html/id2354683-bb.html create mode 100644 doc/html/id2383300-bb.html create mode 100644 doc/html/id2493238-bb.html create mode 100644 doc/html/id2518553-bb.html create mode 100644 doc/html/id2524211-bb.html create mode 100644 doc/html/id2532119-bb.html create mode 100644 doc/html/id2544445-bb.html create mode 100644 doc/html/id2557051-bb.html create mode 100644 doc/html/index.html create mode 100644 doc/html/libraries.html create mode 100644 doc/html/ref.ack.html create mode 100644 doc/html/ref.reference.html create mode 100644 doc/html/reference.html create mode 100644 doc/html/signals.reference.html create mode 100644 doc/html/signals.tests.html create mode 100644 doc/html/variant.design.html create mode 100644 doc/html/variant.misc.html create mode 100644 doc/html/variant.reference.html create mode 100644 doc/html/variant.refs.html create mode 100644 doc/html/variant.tutorial.html diff --git a/doc/html/Assignable.html b/doc/html/Assignable.html new file mode 100644 index 0000000000..91790ff750 --- /dev/null +++ b/doc/html/Assignable.html @@ -0,0 +1,75 @@ +Concept Assignable
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept Assignable

Assignable

Description

Assignable types must have copy constructors, + operator= for assignment, and the swap() + function defined.

Refinement of

Notation

X
A type playing the role of assignable-type in the Assignable concept.
x, y
Objects of type X

Valid expressions

NameExpressionTypeSemantics

Assignment

x = y

X &

Require operator=

Swap

swap(x, y)

void

Require swap() function

Models

  • int
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/BOOST_VARIANT_ENUM_PARAMS.html b/doc/html/BOOST_VARIANT_ENUM_PARAMS.html new file mode 100644 index 0000000000..1854b2000b --- /dev/null +++ b/doc/html/BOOST_VARIANT_ENUM_PARAMS.html @@ -0,0 +1,84 @@ +Macro BOOST_VARIANT_ENUM_PARAMS
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Macro BOOST_VARIANT_ENUM_PARAMS

BOOST_VARIANT_ENUM_PARAMS — Enumerate parameters for use with + variant.

Synopsis

BOOST_VARIANT_ENUM_PARAMS(param)

Description

Expands to a comma-separated sequence of length + BOOST_VARIANT_LIMIT_TYPES, where + each element in the sequence consists of the concatenation of + param with its zero-based index into the + sequence. That is, + param ## 0, param ## 1, ..., param ## BOOST_VARIANT_LIMIT_TYPES - 1.

Rationale: This macro greatly + simplifies for the user the process of declaring + variant types + in function templates or explicit partial specializations of class + templates, as shown in the + tutorial.

Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
diff --git a/doc/html/BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html b/doc/html/BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html new file mode 100644 index 0000000000..bd207a8018 --- /dev/null +++ b/doc/html/BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html @@ -0,0 +1,82 @@ +Macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS

BOOST_VARIANT_ENUM_SHIFTED_PARAMS — Enumerate all but the first parameter for use with + variant.

Synopsis

BOOST_VARIANT_ENUM_SHIFTED_PARAMS(param)

Description

Expands to a comma-separated sequence of length + BOOST_VARIANT_LIMIT_TYPES - 1, + where each element in the sequence consists of the concatenation of + param with its one-based index into the sequence. + That is, + param ## 1, ..., param ## BOOST_VARIANT_LIMIT_TYPES - 1.

Note: This macro results in the + same expansion as + BOOST_VARIANT_ENUM_PARAMS -- but + without the first term.

Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
diff --git a/doc/html/BOOST_VARIANT_LIMIT_TYPES.html b/doc/html/BOOST_VARIANT_LIMIT_TYPES.html new file mode 100644 index 0000000000..3dcf032cb3 --- /dev/null +++ b/doc/html/BOOST_VARIANT_LIMIT_TYPES.html @@ -0,0 +1,78 @@ +Macro BOOST_VARIANT_LIMIT_TYPES
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Macro BOOST_VARIANT_LIMIT_TYPES

BOOST_VARIANT_LIMIT_TYPES — Expands to the length of the + template parameter list for + variant.

Synopsis

BOOST_VARIANT_LIMIT_TYPES

Description

Note: Conforming + implementations of variant must allow at least ten + template arguments. That is, BOOST_VARIANT_LIMIT_TYPES must be greater + or equal to 10.

Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
diff --git a/doc/html/BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html b/doc/html/BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html new file mode 100644 index 0000000000..5b18830fca --- /dev/null +++ b/doc/html/BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html @@ -0,0 +1,83 @@ +Macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT

BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT — Indicates + make_recursive_variant operates in + an implementation-defined manner.

Synopsis

BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT

Description

Defined only if + make_recursive_variant does not + operate as documented on the target compiler, but rather in an + implementation-defined manner.

Implementation Note: If + BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT is + defined for the target compiler, the current implementation uses the + MPL lambda mechanism to approximate the + desired behavior. (In most cases, however, such compilers do not have + full lambda support either.)

Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
diff --git a/doc/html/BOOST_VARIANT_NO_REFERENCE_SUPPORT.html b/doc/html/BOOST_VARIANT_NO_REFERENCE_SUPPORT.html new file mode 100644 index 0000000000..924174b135 --- /dev/null +++ b/doc/html/BOOST_VARIANT_NO_REFERENCE_SUPPORT.html @@ -0,0 +1,75 @@ +Macro BOOST_VARIANT_NO_REFERENCE_SUPPORT
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Macro BOOST_VARIANT_NO_REFERENCE_SUPPORT

BOOST_VARIANT_NO_REFERENCE_SUPPORT — Indicates variant does not + support references as bounded types.

Synopsis

BOOST_VARIANT_NO_REFERENCE_SUPPORT

Description

Defined only if variant does + not support references as bounded types.

Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
diff --git a/doc/html/BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html b/doc/html/BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html new file mode 100644 index 0000000000..395766f5bc --- /dev/null +++ b/doc/html/BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html @@ -0,0 +1,78 @@ +Macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT

BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT — Indicates absence of support for specifying the bounded types + of a variant by the elements of a + type sequence.

Synopsis

BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT

Description

Defined only if + make_variant_over and + make_recursive_variant_over + are not supported for some reason on the target compiler.

Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
diff --git a/doc/html/BidirectionalIterator.html b/doc/html/BidirectionalIterator.html new file mode 100644 index 0000000000..ab4cd2243d --- /dev/null +++ b/doc/html/BidirectionalIterator.html @@ -0,0 +1,88 @@ +Concept BidirectionalIterator
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept BidirectionalIterator

BidirectionalIterator

Description

A bidirectional iterator is an iterator that can read through a sequence + of values. It can move in either direction through the sequence, and can + be either mutable (data pointed to by it can be changed) or not mutable.

An iterator represents a position in a sequence. Therefore, the + iterator can point into the sequence (returning a value when dereferenced + and being incrementable), or be off-the-end (and not dereferenceable or + incrementable).

Refinement of

Associated types

  • value_type

    std::iterator_traits<Iter>::value_type

    The value type of the iterator

  • category

    std::iterator_traits<Iter>::iterator_category

    The category of the iterator

Notation

Iter
A type playing the role of iterator-type in the BidirectionalIterator concept.
i, j
Objects of type Iter
x
Object of type value_type

Type expressions

Category tag

category must be + derived from std::bidirectional_iterator_tag. +

Valid expressions

NameExpressionTypePreconditionSemanticsPostcondition

Predecrement

--i

Iter &

i is incrementable (not + off-the-end) and some dereferenceable iterator j exists + such that i == ++j

  

Postdecrement

i--

Iter

Same as for predecrement

Equivalent to {Iter j = i; --i; return j;}

i is dereferenceable or + off-the-end

Complexity

+ All iterator operations must take amortized constant time. +

Invariants

Predecrement must return object

&i = &(--i)

Unique path through sequence

i == j implies --i == --j

Increment and decrement are inverses

++i; --i; and --i; ++i; must end up with the + value of i unmodified, if i both of the + operations in the pair are valid. +

Models

  • T *
  • std::list<T>::iterator
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/CopyConstructible.html b/doc/html/CopyConstructible.html new file mode 100644 index 0000000000..b45c76e930 --- /dev/null +++ b/doc/html/CopyConstructible.html @@ -0,0 +1,74 @@ +Concept CopyConstructible
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept CopyConstructible

CopyConstructible

Description

Copy constructible types must be able to be constructed from another + member of the type.

Notation

X
A type playing the role of copy-constructible-type in the CopyConstructible concept.
x, y
Objects of type X

Valid expressions

NameExpressionTypeSemantics

Copy construction

X(x)

X

Require copy constructor.

Models

  • int
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/DefaultConstructible.html b/doc/html/DefaultConstructible.html new file mode 100644 index 0000000000..7d1fc5a3b4 --- /dev/null +++ b/doc/html/DefaultConstructible.html @@ -0,0 +1,74 @@ +Concept DefaultConstructible
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept DefaultConstructible

DefaultConstructible

Description

DefaultConstructible objects only need to have a default + constructor.

Notation

X
A type playing the role of default-constructible-type in the DefaultConstructible concept.

Valid expressions

NameExpressionTypeSemantics

Construction

X()

X

Construct an instance of the type with default parameters.

Models

  • int
  • std::vector<double>
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/EqualityComparable.html b/doc/html/EqualityComparable.html new file mode 100644 index 0000000000..f6f0988d7d --- /dev/null +++ b/doc/html/EqualityComparable.html @@ -0,0 +1,74 @@ +Concept EqualityComparable
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept EqualityComparable

EqualityComparable

Description

Equality Comparable types must have == and + != operators.

Notation

X
A type playing the role of comparable-type in the EqualityComparable concept.
x, y
Objects of type X

Valid expressions

NameExpressionType

Equality test

x == y

Convertible to bool

Inequality test

x != y

Convertible to bool

Models

  • int
  • std::vector<int>
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/ForwardIterator.html b/doc/html/ForwardIterator.html new file mode 100644 index 0000000000..ffc4b7ce57 --- /dev/null +++ b/doc/html/ForwardIterator.html @@ -0,0 +1,88 @@ +Concept ForwardIterator
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept ForwardIterator

ForwardIterator

Description

A forward iterator is an iterator that can read through a sequence of + values. It is multi-pass (old values of the iterator can be + re-used), and can be either mutable (data pointed to by it can be + changed) or not mutable.

An iterator represents a position in a sequence. Therefore, the + iterator can point into the sequence (returning a value when dereferenced + and being incrementable), or be off-the-end (and not dereferenceable or + incrementable).

Associated types

  • value_type

    std::iterator_traits<Iter>::value_type

    The value type of the iterator

  • category

    std::iterator_traits<Iter>::iterator_category

    The category of the iterator

Notation

Iter
A type playing the role of iterator-type in the ForwardIterator concept.
i, j
Objects of type Iter
x
Object of type value_type

Type expressions

Category tag

category must be + derived from std::forward_iterator_tag. +

Valid expressions

NameExpressionTypePreconditionSemanticsPostcondition

Dereference

*i

const-if-not-mutable value_type &

i is incrementable (not + off-the-end)

  

Member access

i->{member-name} (return type is pointer-to-object type)

const-if-not-mutable value_type *

i is incrementable (not + off-the-end)

  

Preincrement

++i

Iter &

i is incrementable (not + off-the-end)

  

Postincrement

i++

Iter

i is incrementable (not + off-the-end)

Equivalent to {Iter j = i; ++i; return j;}

i is dereferenceable or + off-the-end

Complexity

+ All iterator operations must take amortized constant time. +

Invariants

Predecrement must return object

&i = &(++i)

Unique path through sequence

i == j implies ++i == ++j

Models

  • T *
  • std::hash_set<T>::iterator
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/InputIterator.html b/doc/html/InputIterator.html new file mode 100644 index 0000000000..ddfb61fa3e --- /dev/null +++ b/doc/html/InputIterator.html @@ -0,0 +1,93 @@ +Concept InputIterator
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept InputIterator

InputIterator

Description

An input iterator is an iterator that can read through a sequence of + values. It is single-pass (old values of the iterator cannot be + re-used), and read-only.

An input iterator represents a position in a sequence. Therefore, the + iterator can point into the sequence (returning a value when dereferenced + and being incrementable), or be off-the-end (and not dereferenceable or + incrementable).

Associated types

  • value_type

    std::iterator_traits<Iter>::value_type

    The value type of the iterator (not necessarily what + *i returns)

  • difference_type

    std::iterator_traits<Iter>::difference_type

    The difference type of the iterator

  • category

    std::iterator_traits<Iter>::iterator_category

    The category of the iterator

Notation

Iter
A type playing the role of iterator-type in the InputIterator concept.
i, j
Objects of type Iter
x
Object of type value_type

Type expressions

Category tag

category must be + derived from std::input_iterator_tag, a model of DefaultConstructible, and a model of CopyConstructible. +

Value type copy constructibility

value_type must be + a model of CopyConstructible. +

Difference type properties

difference_type must be + a model of SignedInteger. +

Valid expressions

NameExpressionTypePreconditionSemanticsPostcondition

Dereference

*i

Convertible to value_type

i is incrementable (not + off-the-end)

  

Preincrement

++i

Iter &

i is incrementable (not + off-the-end)

  

Postincrement

i++

i is incrementable (not + off-the-end)

Equivalent to (void)(++i)

i is dereferenceable or + off-the-end

Postincrement and dereference

*i++

Convertible to value_type

i is incrementable (not + off-the-end)

Equivalent to {value_type t = *i; ++i; return t;}

i is dereferenceable or + off-the-end

Complexity

+ All iterator operations must take amortized constant time. +

Models

  • std::istream_iterator
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/LessThanComparable.html b/doc/html/LessThanComparable.html new file mode 100644 index 0000000000..c07fc13c3c --- /dev/null +++ b/doc/html/LessThanComparable.html @@ -0,0 +1,75 @@ +Concept LessThanComparable
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept LessThanComparable

LessThanComparable

Description

LessThanComparable types must have <, + >, <=, and >= + operators.

Notation

X
A type playing the role of comparable-type in the LessThanComparable concept.
x, y
Objects of type X

Valid expressions

NameExpressionTypeSemantics

Less than

x < y

Convertible to bool

Determine if one value is less than another.

Less than or equal

x <= y

Convertible to bool

Determine if one value is less than or equal to another.

Greater than

x > y

Convertible to bool

Determine if one value is greater than another.

Greater than or equal to

x >= y

Convertible to bool

Determine if one value is greater than or equal to another.

Models

  • int
Last revised: , at GMTCopyright © 2001, 2002 Indiana University
Copyright © 2000, 2001 University of Notre Dame du Lac
Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
Copyright © 1994 Hewlett-Packard Company
diff --git a/doc/html/OutputIterator.html b/doc/html/OutputIterator.html new file mode 100644 index 0000000000..8264028088 --- /dev/null +++ b/doc/html/OutputIterator.html @@ -0,0 +1,95 @@ +Concept OutputIterator
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Concept OutputIterator

OutputIterator

Description

An output iterator is an iterator that can write a sequence of + values. It is single-pass (old values of the iterator cannot be + re-used), and write-only.

An output iterator represents a position in a (possibly infinite) + sequence. Therefore, the iterator can point into the sequence (returning + a value when dereferenced and being incrementable), or be off-the-end + (and not dereferenceable or incrementable).

Associated types

  • value_type

    std::iterator_traits<Iter>::value_type

    The stated value type of the iterator (should be + void for an output iterator that does not model some other + iterator concept).

  • difference_type

    std::iterator_traits<Iter>::difference_type

    The difference type of the iterator

  • category

    std::iterator_traits<Iter>::iterator_category

    The category of the iterator

Notation

Iter
A type playing the role of iterator-type in the OutputIterator concept.
ValueType
A type playing the role of value-type in the OutputIterator concept.
i, j
Objects of type Iter
x
Object of type ValueType

Type expressions

The type Iter must be a model of Assignable.

The type ValueType must be a model of Assignable.

The type Iter must be a model of DefaultConstructible.

The type Iter must be a model of + EqualityComparable.

Category tag

category must be + derived from std::output_iterator_tag, a model of DefaultConstructible, and a model of CopyConstructible. +

Difference type properties

difference_type must be + a model of SignedInteger. +

Valid expressions

NameExpressionTypePreconditionSemanticsPostcondition

Dereference

*i

i is incrementable (not + off-the-end)

  

Dereference and assign

*i = x

i is incrementable (not + off-the-end)

 

*i may not be written to again until it has + been incremented.

Preincrement

++i

Iter &

i is incrementable (not + off-the-end)

  

Postincrement

i++

i is incrementable (not + off-the-end)

Equivalent to (void)(++i)

i is dereferenceable or + off-the-end

Postincrement, dereference, and assign

*i++ = x

i is incrementable (not + off-the-end)

Equivalent to {*i = t; ++i;}

i is dereferenceable or + off-the-end

Complexity

+ All iterator operations must take amortized constant time. +

Models

  • std::ostream_iterator, ...
  • std::insert_iterator, ...
  • std::front_insert_iterator, ...
  • std::back_insert_iterator, ...

See also

    Last revised: , at GMTCopyright © 2001, 2002 Indiana University
    Copyright © 2000, 2001 University of Notre Dame du Lac
    Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
    Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
    Copyright © 1994 Hewlett-Packard Company
    diff --git a/doc/html/RandomAccessIterator.html b/doc/html/RandomAccessIterator.html new file mode 100644 index 0000000000..b3f9bbf235 --- /dev/null +++ b/doc/html/RandomAccessIterator.html @@ -0,0 +1,91 @@ +Concept RandomAccessIterator
    c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

    Concept RandomAccessIterator

    RandomAccessIterator

    Description

    A random access iterator is an iterator that can read through + a sequence of values. It can move in either direction through the + sequence (by any amount in constant time), and can be either mutable + (data pointed to by it can be changed) or not mutable.

    An iterator represents a position in a sequence. Therefore, + the iterator can point into the sequence (returning a value when + dereferenced and being incrementable), or be off-the-end (and not + dereferenceable or incrementable).

    Associated types

    • value_type

      std::iterator_traits<Iter>::value_type

      The value type of the iterator

    • category

      std::iterator_traits<Iter>::iterator_category

      The category of the iterator

    • difference_type

      std::iterator_traits<Iter>::difference_type

      The difference type of the iterator (measure of the number + of steps between two iterators)

    Notation

    Iter
    A type playing the role of iterator-type in the RandomAccessIterator concept.
    i, j
    Objects of type Iter
    x
    Object of type value_type
    n
    Object of type difference_type
    int_off
    Object of type int

    Type expressions

    Category tag

    category must be + derived from std::random_access_iterator_tag. +

    Valid expressions

    NameExpressionTypeSemantics

    Motion

    i += n

    Iter &

    Equivalent to applying i++n times + if n is positive, applying i---n times if n is negative, and to a null + operation if n is zero.

    Motion (with integer offset)

    i += int_off

    Iter &

    Equivalent to applying i++n times + if n is positive, applying i---n times if n is negative, and to a null + operation if n is zero.

    Subtractive motion

    i -= n

    Iter &

    Equivalent to i+=(-n)

    Subtractive motion (with integer offset)

    i -= int_off

    Iter &

    Equivalent to i+=(-n)

    Addition

    i + n

    Iter

    Equivalent to {Iter j = i; j += n; return j;}

    Addition with integer

    i + int_off

    Iter

    Equivalent to {Iter j = i; j += n; return j;}

    Addition (count first)

    n + i

    Iter

    Equivalent to i + n

    Addition with integer (count first)

    int_off + i

    Iter

    Equivalent to i + n

    Subtraction

    i - n

    Iter

    Equivalent to i + (-n)

    Subtraction with integer

    i - int_off

    Iter

    Equivalent to i + (-n)

    Distance

    i - j

    difference_type

    The number of times i must be incremented (or + decremented if the result is negative) to reach j. Not + defined if j is not reachable from + i.

    Element access

    i[n]

    const-if-not-mutable value_type &

    Equivalent to *(i + n)

    Element access with integer index

    i[int_off]

    const-if-not-mutable value_type &

    Equivalent to *(i + n)

    Complexity

    + All iterator operations must take amortized constant time. +

    Models

    • T *
    • std::vector<T>::iterator
    • std::vector<T>::const_iterator
    • std::deque<T>::iterator
    • std::deque<T>::const_iterator
    Last revised: , at GMTCopyright © 2001, 2002 Indiana University
    Copyright © 2000, 2001 University of Notre Dame du Lac
    Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
    Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
    Copyright © 1994 Hewlett-Packard Company
    diff --git a/doc/html/SignedInteger.html b/doc/html/SignedInteger.html new file mode 100644 index 0000000000..5ae6499d41 --- /dev/null +++ b/doc/html/SignedInteger.html @@ -0,0 +1,75 @@ +Concept SignedInteger
    c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

    Concept SignedInteger

    SignedInteger

    Notation

    T
    A type playing the role of integral-type in the SignedInteger concept.
    x, y, z
    Objects of type T
    a, b
    Objects of type int

    Type expressions

    Conversion to int

    T must be + convertible to int. +

    Valid expressions

    NameExpressionType

    Conversion from int

    T(a)

    T

    Preincrement

    ++x

    T &

    Predecrement

    --x

    T &

    Postincrement

    x++

    T

    Postdecrement

    x--

    T

    Sum

    x + y

    T

    Sum with int

    x + a

    T

    Sum-assignment

    x += y

    T &

    Sum-assignment with int

    x += a

    T &

    Difference

    x - y

    T

    Difference with int

    x - a

    T

    Product

    x * y

    T

    Product with int

    x * a

    T

    Product-assignment with int

    x *= a

    T &

    Product with int on left

    a * x

    T

    Quotient

    x / y

    T

    Quotient with int

    x / a

    T

    Right-shift

    x >> y

    T

    Right-shift with int

    x >> a

    T

    Right-shift-assignment with int

    x >>= a

    T &

    Less-than comparison

    x < y

    Convertible to bool

    Less-than comparison with int

    x < a

    Convertible to bool

    Less-than comparison with size_t

    x < boost::sample_value < std::size_t >()

    Convertible to bool

    Greater-than comparison

    x > y

    Convertible to bool

    Greater-than comparison with int

    x > a

    Convertible to bool

    Less-than-or-equal comparison

    x <= y

    Convertible to bool

    Less-than-or-equal comparison with int

    x <= a

    Convertible to bool

    Greater-than-or-equal comparison

    x >= y

    Convertible to bool

    Greater-than-or-equal comparison with int

    x >= a

    Convertible to bool

    Greater-than-or-equal comparison with int on left

    a >= x

    Convertible to bool

    Equality comparison

    x == y

    Convertible to bool

    Equality comparison with int

    x == a

    Convertible to bool

    See also

      Last revised: , at GMTCopyright © 2001, 2002 Indiana University
      Copyright © 2000, 2001 University of Notre Dame du Lac
      Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
      Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.
      Copyright © 1994 Hewlett-Packard Company
      diff --git a/doc/html/any.html b/doc/html/any.html index 15a93255fc..96441559a1 100644 --- a/doc/html/any.html +++ b/doc/html/any.html @@ -1,10 +1,111 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/any.html - - +Boost.Any
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Boost.Any

      Kevlin Henney

      Introduction

      There are times when a generic (in the sense of + general as opposed to + template-based programming) type is needed: + variables that are truly variable, accommodating values of many + other more specific types rather than C++'s normal strict and + static types. We can distinguish three basic kinds of generic + type:

      • Converting types that can hold one of a number of + possible value types, e.g. int and + string, and freely convert between them, for + instance interpreting 5 as "5" or + vice-versa. Such types are common in scripting and other + interpreted + languages. + boost::lexical_cast + supports such conversion functionality.

      • + Discriminated types that contain values of different types but + do not attempt conversion between them, i.e. 5 is + held strictly as an int and is not implicitly + convertible either to "5" or to + 5.0. Their indifference to interpretation but + awareness of type effectively makes them safe, generic + containers of single values, with no scope for surprises from + ambiguous conversions.

      • + Indiscriminate types that can refer to anything but are + oblivious to the actual underlying type, entrusting all forms + of access and interpretation to the programmer. This niche is + dominated by void *, which offers plenty of scope + for surprising, undefined behavior.

      The boost::any class + (based on the class of the same name described in "Valued + Conversions" by Kevlin Henney, C++ + Report 12(7), July/August 2000) is a variant value type + based on the second category. It supports copying of any value + type and safe checked extraction of that value strictly against + its type. A similar design, offering more appropriate operators, + can be used for a generalized function adaptor, + any_function, a generalized iterator adaptor, + any_iterator, and other object types that need + uniform runtime treatment but support only compile-time template + parameter conformance.

      Last revised: March 15, 2003 at 23:12:35 GMT
      diff --git a/doc/html/any.reference.html b/doc/html/any.reference.html new file mode 100644 index 0000000000..009ac016dd --- /dev/null +++ b/doc/html/any.reference.html @@ -0,0 +1,100 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      ValueType requirements

      Values are strongly informational objects for which + identity is not significant, i.e. the focus is principally on + their state content and any behavior organized around + that. Another distinguishing feature of values is their + granularity: normally fine-grained objects representing simple + concepts in the system such as quantities.

      As the emphasis of a value lies in its state not its + identity, values can be copied and typically assigned one to + another, requiring the explicit or implicit definition of a + public copy constructor and public assignment operator. Values + typically live within other scopes, i.e. within objects or + blocks, rather than on the heap. Values are therefore normally + passed around and manipulated directly as variables or through + references, but not as pointers that emphasize identity and + indirection.

      The specific requirements on value types to be used in an + any + are:

      • A ValueType is + CopyConstructible [20.1.3].
      • A ValueType is + optionally Assignable [23.1]. The strong + exception-safety guarantee is required for all forms of + assignment.
      • The destructor for a + ValueType upholds the no-throw + exception-safety guarantee.

      Header <boost/any.hpp>

      namespace boost {
      +  class bad_any_cast;
      +  class any;
      +  template<typename ValueType> ValueType any_cast(const any &);
      +  template<typename ValueType> const ValueType * any_cast(const any *);
      +  template<typename ValueType> ValueType * any_cast(any *);
      +}
      Last revised: , at GMTCopyright © 2001 Kevlin Henney
      diff --git a/doc/html/array.ack.html b/doc/html/array.ack.html new file mode 100644 index 0000000000..2a9c24ba32 --- /dev/null +++ b/doc/html/array.ack.html @@ -0,0 +1,73 @@ +Acknowledgements
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Acknowledgements

      Doug Gregor ported the documentation to the BoostBook format.

      Last revised: , at GMTCopyright © 2001 Nicolai M. Josuttis
      diff --git a/doc/html/array.html b/doc/html/array.html index 65c50f8a0a..cb7ed2c3c6 100644 --- a/doc/html/array.html +++ b/doc/html/array.html @@ -1,10 +1,103 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/array.html - - +Boost.Array
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Boost.Array

      Nicolai Josuttis

      Permission to copy, use, modify, sell and distribute this + software is granted provided this copyright notice appears in + all copies. This software is provided "as is" without express or + implied warranty, and with no claim as to its suitability for + any purpose.

      Introduction

      The C++ Standard Template Library STL as part of the C++ + Standard Library provides a framework for processing algorithms on + different kind of containers. However, ordinary arrays don't + provide the interface of STL containers (although, they provide + the iterator interface of STL containers).

      As replacement for ordinary arrays, the STL provides class + std::vector. However, + std::vector<> provides + the semantics of dynamic arrays. Thus, it manages data to be able + to change the number of elements. This results in some overhead in + case only arrays with static size are needed.

      In his book, Generic Programming and the + STL, Matthew H. Austern introduces a useful wrapper + class for ordinary arrays with static size, called + block. It is safer and has no worse performance than + ordinary arrays. In The C++ Programming + Language, 3rd edition, Bjarne Stroustrup introduces a + similar class, called c_array, which I (Nicolai Josuttis) present + slightly modified in my book The C++ Standard Library - + A Tutorial and Reference, called + carray. This is the essence of these approaches + spiced with many feedback from boost.

      After considering different names, we decided to name this + class simply array.

      Class array fulfills + most but not all of the requirements of "reversible containers" + (see Section 23.1, [lib.container.requirements] of the C++ + Standard). The reasons array is not an reversible STL container is + because: +

      • No constructors are provided.
      • Elements may have an undetermined initial value (see the section called “Design Rationale”).
      • swap() has no constant complexity.
      • size() is always constant, based on the second template argument of the type.
      • The container provides no allocator support.

      It doesn't fulfill the requirements of a "sequence" (see Section 23.1.1, [lib.sequence.reqmts] of the C++ Standard), except that: +

      Last revised: March 15, 2003 at 23:12:35 GMT
      diff --git a/doc/html/array.issues.html b/doc/html/array.issues.html new file mode 100644 index 0000000000..754f19f5fb --- /dev/null +++ b/doc/html/array.issues.html @@ -0,0 +1,81 @@ +Open Issues
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Open Issues

      • Do we want initializer list support or would the + following be OK?:

        int data[] = { 1, 2, 3, 4 }
        +boost::array<int,5> x(data); // or boost::array<int,data> x;
      • Could "{ ... }" be used portably instead of "{ + { ... } }" to initialize values? 8.5.1 (11) of the Standard seems + to allow it; however, gcc 2.95.2 prints a warning + message.
      • Any way to have determinate initial values and + initializer list support?
      • Static_casts for reverse iterator stuff?

      I'd appreciate any constructive feedback. Please note: I don't + have time to read all boost mails. Thus, to make sure that feedback arrives me, + please send me a copy of each mail regarding this class.

      Last revised: , at GMTCopyright © 2001 Nicolai M. Josuttis
      diff --git a/doc/html/array.more.info.html b/doc/html/array.more.info.html new file mode 100644 index 0000000000..a70ca333a7 --- /dev/null +++ b/doc/html/array.more.info.html @@ -0,0 +1,80 @@ +For more information...
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      For more information...

      To find more details about using ordinary arrays in C++ and + the framework of the STL, see e.g. + +

      The C++ Standard Library - A Tutorial and Reference
      +by Nicolai M. Josuttis
      +Addison Wesley Longman, 1999
      +ISBN 0-201-37926-0

      Home Page of Nicolai + Josuttis

      Last revised: , at GMTCopyright © 2001 Nicolai M. Josuttis
      diff --git a/doc/html/array.rationale.html b/doc/html/array.rationale.html new file mode 100644 index 0000000000..0177d64ea0 --- /dev/null +++ b/doc/html/array.rationale.html @@ -0,0 +1,87 @@ +Design Rationale
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Design Rationale

      There was an important design tradeoff regarding the + constructors: We could implement array as an "aggregate" (see + Section 8.5.1, [dcl.init.aggr], of the C++ Standard). This would + mean: +

      • An array can be initialized with a + brace-enclosing, comma-separated list of initializers for the + elements of the container, written in increasing subscript + order:

        boost::array<int,4> a = { { 1, 2, 3 } };

        Note that if there are fewer elements in the + initializer list, then each remaining element gets + default-initialized (thus, it has a defined value). However, + passing no initializer list means that the elements have an + indetermined initial value.

      • It has no user-declared constructors.
      • It has no private or protected non-static data members.
      • It has no base classes.
      • It has no virtual functions.

      The current implementation uses this approach. However, being + able to have indeterminate initial values is a big drawback. So, + please give me some feedback, how useful you consider this feature + to be.

      Last revised: , at GMTCopyright © 2001 Nicolai M. Josuttis
      diff --git a/doc/html/array.reference.html b/doc/html/array.reference.html new file mode 100644 index 0000000000..89fcc7d5e9 --- /dev/null +++ b/doc/html/array.reference.html @@ -0,0 +1,88 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      namespace boost {
      +  template<typename T, std::size_t N> class array;
      +  template<typename T, std::size_t N> void swap(array<T, N>&, array<T, N>&);
      +  template<typename T, std::size_t N> 
      +    bool operator==(const array<T, N>&, const array<T, N>&);
      +  template<typename T, std::size_t N> 
      +    bool operator!=(const array<T, N>&, const array<T, N>&);
      +  template<typename T, std::size_t N> 
      +    bool operator<(const array<T, N>&, const array<T, N>&);
      +  template<typename T, std::size_t N> 
      +    bool operator>(const array<T, N>&, const array<T, N>&);
      +  template<typename T, std::size_t N> 
      +    bool operator<=(const array<T, N>&, const array<T, N>&);
      +  template<typename T, std::size_t N> 
      +    bool operator>=(const array<T, N>&, const array<T, N>&);
      +}
      Last revised: , at GMTCopyright © 2001 Nicolai M. Josuttis
      diff --git a/doc/html/boostbook.documenting.html b/doc/html/boostbook.documenting.html new file mode 100644 index 0000000000..e2b756a78c --- /dev/null +++ b/doc/html/boostbook.documenting.html @@ -0,0 +1,172 @@ +Documenting libraries
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Documenting libraries

      BoostBook is an extension to DocBook, an XML format for + representing documentation. BoostBook inherits much of its + functionality and many elements from DocBook that are not + redocumented here. When writing BoostBook documentation, please + refer also to DocBook: The Definitive + Guide.

      Defining a BoostBook library

      BoostBook library documentation is contained entirely within + a <library> XML element. To create a skeletal library, we + need to create a new XML document (call it any.xml) + that contains basic information about the library. The following + BoostBook XML + example describes basic information about the Boost.Any + library:

      Example 1. A Skeletal BoostBook Library

      +<?xml version="1.0" encoding="utf-8"?>
      +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
      +  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
      +<library name="Any" dirname="any" xmlns:xi="http://www.w3.org/2001/XInclude"
      +  id="any" last-revision="$Date$">
      +  <libraryinfo>
      +    <author>
      +      <firstname>Kevlin</firstname>
      +      <surname>Henney</surname>
      +    </author>
      +    <librarypurpose>
      +      Safe, generic container for single values of different value types
      +    </librarypurpose> 
      +    <librarycategory name="category:data-structures"/>
      +  </libraryinfo>
      +</library>
      +

      The first three lines identify this document as a BoostBook + XML document. The + DOCTYPE line states that the document conforms to the BoostBook + DTD, and that the top-level element is a BoostBook + <library>.

      The <library> element actually describes the aspects + of BoostBook library documentation. The attributes for the + <library> element are:

      Attributes for the <library> element

      name
      The full name of the library, e.g., "Any"
      dirname
      The name of the directory, relative to + boost/libs, in which the library + resides. This name may be a relative path, such as + math/octonion, using "/" for the directory + separator.
      id
      A short, unique name for the library. For libraries + with simple directory names (e.g., ones that do not contain + a "/"), this should be the same as the + dirname. This id will be used to + identify libraries and, for HTML output, will be used as the + base name for the HTML file in which the library's + documentation resides, so it should use only lowercase + alphanumeric characters and underscores.
      last-revision
      Always set to $Date$, which is + expanded by CVS to include the date and time that the file + was last modified.

      Inside the <library> element we have the + <libraryinfo> element, which gives information about the + library itself. It contains the author's name (there may be more + than one <author> element), followed by the purpose of the + library and the list of categorizations. The + <librarypurpose> element should always contain a very short + (single sentence) description of the library's purpose, and should + not terminate with a period.

      The list of categories is specified by a set of + <librarycategory> elements. Each <librarycategory> + element has a name element that identifies one of the + categories. The actual list of categories is in the file + doc/src/boost.xml. +

      At this point, we can apply the BoostBook XSL stylesheets to + any.xml (to DocBook) followed by a DocBook XSL + stylesheet to generate HTML output, as described in the section called “Getting Started”.

      From HTML to BoostBook

      Most library authors are comfortable with writing HTML + documentation. Writing DocBook documentation (and, + by extension, BoostBook documentation) is quite similar to writing + HTML, except that BoostBook uses different element names from HTML + (see Table 2) and BoostBook XML is a + much more rigid format than HTML.

      One of the easiest ways to convert HTML documentation into + BoostBook documentation is to use HTML Tidy to transform + your HTML into valid XHTML, which will make sure that all elements + are properly closed, then apply the transformations in Table 2 to the body of the XHTML + document. The following command uses HTML Tidy to transform HTML + into valid XHTML:

      +  tidy -asxhtml input.html > output.xhtml

      When converting documentation from HTML to BoostBook, note + that some redundant information that has to be manually maintained + in HTML is automatically generated in BoostBook: for instance, the + library categorizations, purpose, and author list described in + the section called “Defining a BoostBook library” are used both in the + documentation for the library and to build alphabetical and + categorized lists of known libraries; similarly, tables of + contents are built automatically from the titles of sections in + the BoostBook document.

      Table 2. Converting HTML elements to BoostBook

      HTMLBoostBook

      <h1>, <h2>, etc.

      <section>, <title>; See the section called “Sectioning in BoostBook”

      <i>, <em>

      <emphasis>

      <b>

      <emphasis role="bold">

      <ol>

      <orderedlist>

      <ul>

      <itemizedlist>

      <li>

      <listitem>

      <pre>

      <programlisting>

      <code>

      <computeroutput>,<code>

      <p>

      <para>, <simpara>

      <a>

      <xref>, <link>, <ulink>;, See the section called “Linking in BoostBook”

      <table>, <tr>, <th>, <td>

      <table>, <informaltable>, <tgroup>, <thead>, <tfoot>, <tbody>, <row>, <entry>, <entrytbl>; BoostBook tables are equivalent to DocBook tables, for which there is a good tutorial here

      Sectioning in BoostBook

      "Sectioning" refers to organization of a document into separate sections, each with a title, some text, and possibly subsections. Each section is described in BoostBook via a <section> element. An introduction section may look like this:

      +<section id="any.intro">
      +  <title>Introduction</title>
      + 
      +  <para>Introduction to a library...</para>
      +
      +  <section>
      +    <title>A Subsection</title>
      +    <para>Subsection information...</para>
      +  </section>
      +</section>
      +

      The <section> element contains all information that + should logically be grouped within that section. The title of the + section is placed within the <title> element, and any + paragraphs, programs, lists, tables, or subsections can occur + within the section. The id attribute of the + <section> element gives a unique ID to each section, so that + it may later be identified for linking. It is suggested that all + IDs start with the short name of a library followed by a period, + so that IDs do not conflict between libraries.

      Last revised: March 19, 2003 at 20:23:15 GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.boostbook.html b/doc/html/boostbook.dtd.boostbook.html new file mode 100644 index 0000000000..80bd269d97 --- /dev/null +++ b/doc/html/boostbook.dtd.boostbook.html @@ -0,0 +1,84 @@ + + BoostBook element boostbook
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element boostbook

      boostbook — Defines a BoostBook book

      Synopsis

      boostbook ::= + (title, (chapter| library)*) +

      Description

      This element is the topmost level defined by + boost.xml for all Boost documentation. It will + not generally be used by developers.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.class-specialization.html b/doc/html/boostbook.dtd.class-specialization.html new file mode 100644 index 0000000000..06f733ac70 --- /dev/null +++ b/doc/html/boostbook.dtd.class-specialization.html @@ -0,0 +1,103 @@ + + BoostBook element class-specialization
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element class-specialization

      class-specialization — A specialization (partial or full) of a class template

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.class.html b/doc/html/boostbook.dtd.class.html new file mode 100644 index 0000000000..5374c173e5 --- /dev/null +++ b/doc/html/boostbook.dtd.class.html @@ -0,0 +1,136 @@ + + BoostBook element class
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element class

      class — Declares a class or class template

      Description

      C++ classes and class templates are described via the + <class> element. Each class has a name (e.g., "any") given by + the name attribute, a purpose given by the + <purpose> element, documentation, and a set of types, + functions, base classes, and data members. Here is a minimal + definition of the boost::any class:

      <namespace name="boost">
      +  <class name="any">
      +    <purpose>
      +      A class whose instances can hold instances of any type that satisfies
      +      ValueType requirements.
      +    </purpose>
      +  </class>
      +</namespace>

      Additional class documentation can be contained in a + description element following the <purpose> + element. This documentation will be typeset prior to documentation + for specific elements in the class (e.g., constructors or + methods).

      Class inheritance is described via the <inherit> + element. The <inherit> element requires an access + attribute which must be one of public, + protected, or private. The + content of the <inherited> element in C++ code that names the + class inherited, and may contain markup to link to the class. The + following description of the class + boost::bad_any_cast describes public + inheritance from the class std::bad_cast. It + also defines the <purpose> element, which contains a short + description of the use of the class.

      <class name="bad_any_cast">
      +  <inherit access="public"><classname>std::bad_cast</classname></inherit>
      +  <purpose><para>The exception thrown in the event of a failed
      +  <functionname>any_cast</functionname> of an
      +  <classname>any</classname> value.</para></purpose>
      +</class>

      Class templates are defined by <class> elements with a + <template> child element at the beginning.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.code.html b/doc/html/boostbook.dtd.code.html new file mode 100644 index 0000000000..fd01758ef2 --- /dev/null +++ b/doc/html/boostbook.dtd.code.html @@ -0,0 +1,84 @@ + + BoostBook element code
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element code

      code — Mimics the code tag in HTML

      Synopsis

      code ::= + (ANY) +

      Description

      Text within a code tag is generally typeset + in a different, monospaced font so that it stands out as code. The + code tag in BoostBook is transformed directly + into the computeroutput tag in DocBook.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.compile-fail-test.html b/doc/html/boostbook.dtd.compile-fail-test.html new file mode 100644 index 0000000000..a8dc2ac03b --- /dev/null +++ b/doc/html/boostbook.dtd.compile-fail-test.html @@ -0,0 +1,86 @@ + + BoostBook element compile-fail-test
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element compile-fail-test

      compile-fail-test — A testcase that should fail to compile

      Synopsis

      compile-fail-test ::= + (source*, lib*, requirement*, purpose, if-fails?) +

      Attributes

      NameTypeValuePurpose
      filename#REQUIREDCDATAThe name of the file associated with this element
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.compile-test.html b/doc/html/boostbook.dtd.compile-test.html new file mode 100644 index 0000000000..bc8a62fb82 --- /dev/null +++ b/doc/html/boostbook.dtd.compile-test.html @@ -0,0 +1,86 @@ + + BoostBook element compile-test
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element compile-test

      compile-test — A testcase that should compile correctly

      Synopsis

      compile-test ::= + (source*, lib*, requirement*, purpose, if-fails?) +

      Attributes

      NameTypeValuePurpose
      filename#REQUIREDCDATAThe name of the file associated with this element
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.complexity.html b/doc/html/boostbook.dtd.complexity.html new file mode 100644 index 0000000000..4c0239af31 --- /dev/null +++ b/doc/html/boostbook.dtd.complexity.html @@ -0,0 +1,81 @@ + + BoostBook element complexity
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element complexity

      complexity — The time/space/etc. complexity of a function

      Synopsis

      complexity ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.constructor.html b/doc/html/boostbook.dtd.constructor.html new file mode 100644 index 0000000000..ea72823a67 --- /dev/null +++ b/doc/html/boostbook.dtd.constructor.html @@ -0,0 +1,96 @@ + + BoostBook element constructor
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element constructor

      constructor — Declares a constructor of the enclosing class

      Description

      General documentation on functions in BoostBook is provided in + the function + element documentation.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      specifiers#IMPLIEDCDATAThe specifiers for this function, e.g., inline, static, etc.
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.copy-assignment.html b/doc/html/boostbook.dtd.copy-assignment.html new file mode 100644 index 0000000000..18fa972495 --- /dev/null +++ b/doc/html/boostbook.dtd.copy-assignment.html @@ -0,0 +1,99 @@ + + BoostBook element copy-assignment
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element copy-assignment

      copy-assignment — Declares a copy-assignment operator

      Synopsis

      copy-assignment ::= + (template?, type?, parameter*, purpose?, description?, requires?, effects?, postconditions?, returns?, throws?, complexity?, notes?, rationale?) +

      Description

      The return type of the copy-assignment operator does not need + to be specified. If left unspecified, it will default to an + unqualified reference to the enclosing class type.

      General documentation on functions in BoostBook is provided in + the function + element documentation.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      cv#IMPLIEDCDATAcv-qualifiers for this method, e.g., const volatile
      specifiers#IMPLIEDCDATAThe specifiers for this function, e.g., inline, static, etc.
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.data-member.html b/doc/html/boostbook.dtd.data-member.html new file mode 100644 index 0000000000..50346a43e9 --- /dev/null +++ b/doc/html/boostbook.dtd.data-member.html @@ -0,0 +1,84 @@ + + BoostBook element data-member
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element data-member

      data-member — Declares a data member of a class

      Synopsis

      data-member ::= + (type, purpose?, description?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.default.html b/doc/html/boostbook.dtd.default.html new file mode 100644 index 0000000000..113d63022d --- /dev/null +++ b/doc/html/boostbook.dtd.default.html @@ -0,0 +1,81 @@ + + BoostBook element default
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element default

      default — The default value of a function or template parameter

      Synopsis

      default ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.description.html b/doc/html/boostbook.dtd.description.html new file mode 100644 index 0000000000..7242c563d2 --- /dev/null +++ b/doc/html/boostbook.dtd.description.html @@ -0,0 +1,87 @@ + + BoostBook element description
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element description

      description — Detailed description of a construct

      Synopsis

      description ::= + (ANY) +

      Description

      Although the context model for this element is + ANY, detailed descriptions should contain structured + DocBook elements that occur within sections, e.g., paragraphs + (para, simpara), lists + (orderedlist, itemizedlist), + tables (informaltable, table), + etc.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.destructor.html b/doc/html/boostbook.dtd.destructor.html new file mode 100644 index 0000000000..5b309ce79e --- /dev/null +++ b/doc/html/boostbook.dtd.destructor.html @@ -0,0 +1,94 @@ + + BoostBook element destructor
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element destructor

      destructor — Declares a destructor for the enclosing class

      Synopsis

      destructor ::= + (purpose?, description?, requires?, effects?, postconditions?, returns?, throws?, complexity?, notes?, rationale?) +

      Description

      General documentation on functions in BoostBook is provided in + the function + element documentation.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      specifiers#IMPLIEDCDATAThe specifiers for this function, e.g., inline, static, etc.
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.effects.html b/doc/html/boostbook.dtd.effects.html new file mode 100644 index 0000000000..b77c3581c5 --- /dev/null +++ b/doc/html/boostbook.dtd.effects.html @@ -0,0 +1,81 @@ + + BoostBook element effects
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element effects

      effects — Declares the side effects of a function

      Synopsis

      effects ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.enum.html b/doc/html/boostbook.dtd.enum.html new file mode 100644 index 0000000000..93e64b2dd9 --- /dev/null +++ b/doc/html/boostbook.dtd.enum.html @@ -0,0 +1,84 @@ + + BoostBook element enum
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element enum

      enum — Declares an enumeration type

      Synopsis

      enum ::= + (enumvalue*, purpose?, description?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.enumvalue.html b/doc/html/boostbook.dtd.enumvalue.html new file mode 100644 index 0000000000..ec927c9a63 --- /dev/null +++ b/doc/html/boostbook.dtd.enumvalue.html @@ -0,0 +1,82 @@ + + BoostBook element enumvalue
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element enumvalue

      enumvalue — A single value of an enumeration

      Synopsis

      enumvalue ::= + (default?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.free-function-group.html b/doc/html/boostbook.dtd.free-function-group.html new file mode 100644 index 0000000000..51382a01b8 --- /dev/null +++ b/doc/html/boostbook.dtd.free-function-group.html @@ -0,0 +1,83 @@ + + BoostBook element free-function-group
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element free-function-group

      free-function-group — A set of functions that are grouped together under one name

      Synopsis

      free-function-group ::= + (function| overloaded-function)* +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.function.html b/doc/html/boostbook.dtd.function.html new file mode 100644 index 0000000000..8c42a3406e --- /dev/null +++ b/doc/html/boostbook.dtd.function.html @@ -0,0 +1,141 @@ + + BoostBook element function
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element function

      function — Declares a function

      Description

      BoostBook functions are documented by specifying the + function's interface (e.g., its C++ signature) and its + behavior. Constructors, destructors, member functions, and free + functions all use the same documentation method, although the + top-level tags differ.

      The behavior of functions in BoostBook is documenting using a + style similar to that of the C++ standard, with clauses describing + the requirements, effects, postconditions, exception behavior, and + return values of functions.

      The following example illustrates some constructors and a + destructor for boost::any. Note that one of + the constructors takes a single parameter whose name is "other" and + whose type, const any& is contained in the + <paramtype> element; any number of parameters may be specified + in this way.

      <class name="any">
      +  <constructor>
      +    <postconditions><para><this->empty()></para></postconditions>
      +  </constructor>
      +
      +  <constructor>
      +    <parameter name="other">
      +      <paramtype>const <classname>any</classname>&amp;</paramtype>
      +    </parameter>
      +
      +    <effects>
      +      <simpara> Copy constructor that copies
      +        content of <code>other</code> into the new instance,
      +        so that any content is equivalent in both type and value to the
      +        content of <code>other</code>, or empty if
      +        <code>other</code> is
      +        empty. 
      +      </simpara>
      +    </effects>
      +
      +    <throws>
      +      <simpara>May fail with a 
      +        <classname>std::bad_alloc</classname> exception or any
      +        exceptions arising from the copy constructor of the
      +        contained type.
      +      </simpara>
      +    </throws>
      +  </constructor>
      +
      +  <destructor>
      +     <effects><simpara>Releases any and all resources used in
      +     management of instance.</simpara></effects>
      +
      +     <throws><simpara>Nothing.</simpara></throws>
      +  </destructor>
      +</class>

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      specifiers#IMPLIEDCDATAThe specifiers for this function, e.g., inline, static, etc.
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.functionname.html b/doc/html/boostbook.dtd.functionname.html new file mode 100644 index 0000000000..c7e700f556 --- /dev/null +++ b/doc/html/boostbook.dtd.functionname.html @@ -0,0 +1,88 @@ + + BoostBook element functionname
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element functionname

      functionname — References a function with the given name

      Synopsis

      functionname ::= + (#PCDATA) +

      Description

      If a function (or overloaded function) with the given, + possibly-qualified name is found, this generates a link to that + function. Lookups obey currently-active using-class + and using-namespace + directives to aid in the search, along with searching within the + current scope.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.header.html b/doc/html/boostbook.dtd.header.html new file mode 100644 index 0000000000..267db4bc1a --- /dev/null +++ b/doc/html/boostbook.dtd.header.html @@ -0,0 +1,81 @@ + + BoostBook element header
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element header

      header — Declares a C++ header with the given name

      Synopsis

      header ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.if-fails.html b/doc/html/boostbook.dtd.if-fails.html new file mode 100644 index 0000000000..c9c3af87d0 --- /dev/null +++ b/doc/html/boostbook.dtd.if-fails.html @@ -0,0 +1,87 @@ + + BoostBook element if-fails
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element if-fails

      if-fails — What it means when a testcase fails

      Synopsis

      if-fails ::= + (ANY) +

      Description

      + Describes to the user the effect a certain failing testcase will + have on the usefulness of a library. This field is useful in cases + where a failed testcase does not mean that the library won't be + useful, but may mean that certain library features will not be + available. +

      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.inherit.html b/doc/html/boostbook.dtd.inherit.html new file mode 100644 index 0000000000..e8d1b8cadf --- /dev/null +++ b/doc/html/boostbook.dtd.inherit.html @@ -0,0 +1,84 @@ + + BoostBook element inherit
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element inherit

      inherit — Declares a base class of the enclosing class or struct

      Synopsis

      inherit ::= + (ANY) +

      Description

      This element contains the name of the class inherited. The + content model is free-form, as the inherited class may be an + instantiation of a template and may have markup in it (e.g., + classname tags).

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      access#REQUIREDCDATA 
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.lib.html b/doc/html/boostbook.dtd.lib.html new file mode 100644 index 0000000000..f9acdc21e5 --- /dev/null +++ b/doc/html/boostbook.dtd.lib.html @@ -0,0 +1,81 @@ + + BoostBook element lib
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element lib

      lib — A library dependency

      Synopsis

      lib ::= + (#PCDATA) +

      Description

      Declares a library dependency on the library named by the content of this element, to be emitted in a Jamfile.

      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.library-reference.html b/doc/html/boostbook.dtd.library-reference.html new file mode 100644 index 0000000000..f0c09fdb6b --- /dev/null +++ b/doc/html/boostbook.dtd.library-reference.html @@ -0,0 +1,100 @@ + + BoostBook element library-reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element library-reference

      library-reference — Declares the reference material for a library

      Synopsis

      library-reference ::= + (title?, section*, (header| library-reference)*) +

      Description

      Reference documentation for a library is contained with a + <library-reference> element. The <library-reference> + element has no attributes, and contains as children only + <header> elements.

      The <header> element defines a C++ header file. Within + each C++ header file lie the definitions of C++ constructs to be + documented. The name attribute of the <header> + element gives the name of the header, as one would specify when + including the header. For instance, the <library-reference> + for the Any library may look like + this:

      <library-reference>
      +  <header name="boost/any.hpp">
      +    <!-- C++ constructs in this header -->
      +  </header>
      +</library-reference>

      If the Any library contained + multiple headers, we would list them all as children of the + <library-reference> element.

      library-reference elements can be nested, + so that reference material can be divided into separate sections + that each contain different headers.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.library.html b/doc/html/boostbook.dtd.library.html new file mode 100644 index 0000000000..4482335e6d --- /dev/null +++ b/doc/html/boostbook.dtd.library.html @@ -0,0 +1,84 @@ + + BoostBook element library
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element library

      library — Top-level element for a library

      Synopsis

      library ::= + (libraryinfo, (title, ((section| library-reference| testsuite))+)?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      dirname#REQUIREDCDATA 
      url#IMPLIEDCDATA 
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      html-only#IMPLIEDCDATA 
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.librarycategory.html b/doc/html/boostbook.dtd.librarycategory.html new file mode 100644 index 0000000000..b21046e8ca --- /dev/null +++ b/doc/html/boostbook.dtd.librarycategory.html @@ -0,0 +1,81 @@ + + BoostBook element librarycategory
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element librarycategory

      librarycategory — Declares that the enclosing library is in this category

      Synopsis

      librarycategory ::= + (#PCDATA) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.librarycategorydef.html b/doc/html/boostbook.dtd.librarycategorydef.html new file mode 100644 index 0000000000..cc8f7c65f3 --- /dev/null +++ b/doc/html/boostbook.dtd.librarycategorydef.html @@ -0,0 +1,81 @@ + + BoostBook element librarycategorydef
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element librarycategorydef

      librarycategorydef — Defines a new library category

      Synopsis

      librarycategorydef ::= + (#PCDATA) +

      Description

      All library category definitions should be in doc/src/boost.xml, and the names of categories must be prefixed with "category:".

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.librarycategorylist.html b/doc/html/boostbook.dtd.librarycategorylist.html new file mode 100644 index 0000000000..c493605548 --- /dev/null +++ b/doc/html/boostbook.dtd.librarycategorylist.html @@ -0,0 +1,84 @@ + + BoostBook element librarycategorylist
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element librarycategorylist

      librarycategorylist — Categorized listing of libraries

      Synopsis

      librarycategorylist ::= + (librarycategorydef)* +

      Description

      This element is not intended for use by developers, but is + used by doc/src/boost.xml as a + placeholder.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.libraryinfo.html b/doc/html/boostbook.dtd.libraryinfo.html new file mode 100644 index 0000000000..09b946e4f4 --- /dev/null +++ b/doc/html/boostbook.dtd.libraryinfo.html @@ -0,0 +1,83 @@ + + BoostBook element libraryinfo
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element libraryinfo

      libraryinfo — Provides information about a library

      Synopsis

      libraryinfo ::= + (author+, copyright*, legalnotice*, librarypurpose, librarycategory*) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.librarylist.html b/doc/html/boostbook.dtd.librarylist.html new file mode 100644 index 0000000000..7b9a56e17f --- /dev/null +++ b/doc/html/boostbook.dtd.librarylist.html @@ -0,0 +1,81 @@ + + BoostBook element librarylist
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element librarylist

      librarylist — Placeholder for an alphabetical list of libraries

      Synopsis

      librarylist ::= + EMPTY +

      Description

      Developers aren't generally expected to use this element. Its existence is mainly as a placeholder in boost.xml for the alphabetical list of libraries.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.libraryname.html b/doc/html/boostbook.dtd.libraryname.html new file mode 100644 index 0000000000..0b01bc22c7 --- /dev/null +++ b/doc/html/boostbook.dtd.libraryname.html @@ -0,0 +1,81 @@ + + BoostBook element libraryname
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element libraryname

      libraryname — References a library of the given name

      Synopsis

      libraryname ::= + (#PCDATA) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.librarypurpose.html b/doc/html/boostbook.dtd.librarypurpose.html new file mode 100644 index 0000000000..3f9ed5fc90 --- /dev/null +++ b/doc/html/boostbook.dtd.librarypurpose.html @@ -0,0 +1,83 @@ + + BoostBook element librarypurpose
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element librarypurpose

      librarypurpose — Describes in one short sentence or phrase the purpose of a library

      Synopsis

      librarypurpose ::= + (#PCDATA| code| ulink| functionname| methodname| classname)* +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.link-fail-test.html b/doc/html/boostbook.dtd.link-fail-test.html new file mode 100644 index 0000000000..d2a0376a84 --- /dev/null +++ b/doc/html/boostbook.dtd.link-fail-test.html @@ -0,0 +1,86 @@ + + BoostBook element link-fail-test
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element link-fail-test

      link-fail-test — Declares a test that should compile but fail to link

      Synopsis

      link-fail-test ::= + (source*, lib*, requirement*, purpose, if-fails?) +

      Attributes

      NameTypeValuePurpose
      filename#REQUIREDCDATAThe name of the file associated with this element
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.link-test.html b/doc/html/boostbook.dtd.link-test.html new file mode 100644 index 0000000000..509f9923f4 --- /dev/null +++ b/doc/html/boostbook.dtd.link-test.html @@ -0,0 +1,86 @@ + + BoostBook element link-test
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element link-test

      link-test — Declares a test that should compile and link

      Synopsis

      link-test ::= + (source*, lib*, requirement*, purpose, if-fails?) +

      Attributes

      NameTypeValuePurpose
      filename#REQUIREDCDATAThe name of the file associated with this element
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.method-group.html b/doc/html/boostbook.dtd.method-group.html new file mode 100644 index 0000000000..8669dbcdde --- /dev/null +++ b/doc/html/boostbook.dtd.method-group.html @@ -0,0 +1,83 @@ + + BoostBook element method-group
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element method-group

      method-group — A set of methods that are grouped together under one name

      Synopsis

      method-group ::= + (method| overloaded-method)* +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.method.html b/doc/html/boostbook.dtd.method.html new file mode 100644 index 0000000000..9417fd09b3 --- /dev/null +++ b/doc/html/boostbook.dtd.method.html @@ -0,0 +1,97 @@ + + BoostBook element method
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element method

      method — Declares a method, i.e., a member function

      Description

      General documentation on functions in BoostBook is provided in + the function + element documentation.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      cv#IMPLIEDCDATAcv-qualifiers for this method, e.g., const volatile
      specifiers#IMPLIEDCDATAThe specifiers for this function, e.g., inline, static, etc.
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.namespace.html b/doc/html/boostbook.dtd.namespace.html new file mode 100644 index 0000000000..2545b54ed1 --- /dev/null +++ b/doc/html/boostbook.dtd.namespace.html @@ -0,0 +1,104 @@ + + BoostBook element namespace
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element namespace

      namespace — Declares a namespace

      Description

      BoostBook namespaces are declared via the <namespace> + element. As in C++, namespaces can be nested and contain other C++ + constructs, such as classes or functions. The name + attribute of a <namespace> element gives the namespace name + (e.g., "boost"). The Any library is + defined entirely within namespace boost by:

      <library-reference>
      +  <header name="boost/any.hpp">
      +    <namespace name="boost">  
      +      <!-- C++ constructs in the boost namespace -->
      +    </namespace>
      +  </header>
      +</library-reference>

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.notes.html b/doc/html/boostbook.dtd.notes.html new file mode 100644 index 0000000000..2eabf6117f --- /dev/null +++ b/doc/html/boostbook.dtd.notes.html @@ -0,0 +1,81 @@ + + BoostBook element notes
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element notes

      notes — Non-normative notes about a function's semantics

      Synopsis

      notes ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.overloaded-function.html b/doc/html/boostbook.dtd.overloaded-function.html new file mode 100644 index 0000000000..7f7c5189da --- /dev/null +++ b/doc/html/boostbook.dtd.overloaded-function.html @@ -0,0 +1,95 @@ + + BoostBook element overloaded-function
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element overloaded-function

      overloaded-function — An overloaded function

      Synopsis

      overloaded-function ::= + (signature*, purpose?, description?, requires?, effects?, postconditions?, returns?, throws?, complexity?, notes?, rationale?) +

      Description

      General documentation on functions in BoostBook is provided in + the function + element documentation.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.overloaded-method.html b/doc/html/boostbook.dtd.overloaded-method.html new file mode 100644 index 0000000000..868b7d1a38 --- /dev/null +++ b/doc/html/boostbook.dtd.overloaded-method.html @@ -0,0 +1,95 @@ + + BoostBook element overloaded-method
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element overloaded-method

      overloaded-method — An overloaded method

      Synopsis

      overloaded-method ::= + (signature*, purpose?, description?, requires?, effects?, postconditions?, returns?, throws?, complexity?, notes?, rationale?) +

      Description

      General documentation on functions in BoostBook is provided in + the function + element documentation.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.parameter.html b/doc/html/boostbook.dtd.parameter.html new file mode 100644 index 0000000000..e1074ad2bc --- /dev/null +++ b/doc/html/boostbook.dtd.parameter.html @@ -0,0 +1,83 @@ + + BoostBook element parameter
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element parameter

      parameter — A function parameter

      Synopsis

      parameter ::= + (paramtype, default?) +

      Attributes

      NameTypeValuePurpose
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.paramtype.html b/doc/html/boostbook.dtd.paramtype.html new file mode 100644 index 0000000000..96a63213a8 --- /dev/null +++ b/doc/html/boostbook.dtd.paramtype.html @@ -0,0 +1,81 @@ + + BoostBook element paramtype
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element paramtype

      paramtype — The type of a function parameter

      Synopsis

      paramtype ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.postconditions.html b/doc/html/boostbook.dtd.postconditions.html new file mode 100644 index 0000000000..fd605b5459 --- /dev/null +++ b/doc/html/boostbook.dtd.postconditions.html @@ -0,0 +1,81 @@ + + BoostBook element postconditions
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element postconditions

      postconditions — Conditions that must hold after the function returns

      Synopsis

      postconditions ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.precondition.html b/doc/html/boostbook.dtd.precondition.html new file mode 100644 index 0000000000..8145efe629 --- /dev/null +++ b/doc/html/boostbook.dtd.precondition.html @@ -0,0 +1,81 @@ + + BoostBook element precondition
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element precondition

      precondition — Conditions that must be met prior to executing a function

      Synopsis

      precondition ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.programlisting.html b/doc/html/boostbook.dtd.programlisting.html new file mode 100644 index 0000000000..c89fc2fdc8 --- /dev/null +++ b/doc/html/boostbook.dtd.programlisting.html @@ -0,0 +1,81 @@ + + BoostBook element programlisting
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element programlisting

      programlisting — A sample of program code

      Synopsis

      programlisting ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.purpose.html b/doc/html/boostbook.dtd.purpose.html new file mode 100644 index 0000000000..3424e7785b --- /dev/null +++ b/doc/html/boostbook.dtd.purpose.html @@ -0,0 +1,81 @@ + + BoostBook element purpose
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element purpose

      purpose — A short description of an entity's use

      Synopsis

      purpose ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.rationale.html b/doc/html/boostbook.dtd.rationale.html new file mode 100644 index 0000000000..93e6be1632 --- /dev/null +++ b/doc/html/boostbook.dtd.rationale.html @@ -0,0 +1,79 @@ + + BoostBook element rationale
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element rationale

      rationale — Describes the rationale for a particular function's design

      Synopsis

      rationale ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.requirement.html b/doc/html/boostbook.dtd.requirement.html new file mode 100644 index 0000000000..2cbee2f36a --- /dev/null +++ b/doc/html/boostbook.dtd.requirement.html @@ -0,0 +1,87 @@ + + BoostBook element requirement
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element requirement

      requirement — A requirement/property in the Jamfile for a testcase

      Synopsis

      requirement ::= + (#PCDATA) +

      Description

      A requirement is part of the dependencies of a target in a + Jamfile. The name attribute of a requirement element + gives the name of the Boost.Build feature and the content of the + requirement gives the value of that feature. A requirement such as + <includes>foo.hpp would be encoded as + <requirement + name="includes">foo.hpp</requirement>.

      Attributes

      NameTypeValuePurpose
      name#REQUIREDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.requires.html b/doc/html/boostbook.dtd.requires.html new file mode 100644 index 0000000000..c65ca7e83c --- /dev/null +++ b/doc/html/boostbook.dtd.requires.html @@ -0,0 +1,81 @@ + + BoostBook element requires
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element requires

      requires — Declares the requirements of a function

      Synopsis

      requires ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.returns.html b/doc/html/boostbook.dtd.returns.html new file mode 100644 index 0000000000..76dba4a4ec --- /dev/null +++ b/doc/html/boostbook.dtd.returns.html @@ -0,0 +1,81 @@ + + BoostBook element returns
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element returns

      returns — Description of the return value of a function

      Synopsis

      returns ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.run-fail-test.html b/doc/html/boostbook.dtd.run-fail-test.html new file mode 100644 index 0000000000..f8f4845303 --- /dev/null +++ b/doc/html/boostbook.dtd.run-fail-test.html @@ -0,0 +1,86 @@ + + BoostBook element run-fail-test
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element run-fail-test

      run-fail-test — A testcase that should compile and link, but fail on execution

      Synopsis

      run-fail-test ::= + (source*, lib*, requirement*, purpose, if-fails?) +

      Attributes

      NameTypeValuePurpose
      filename#REQUIREDCDATAThe name of the file associated with this element
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.run-test.html b/doc/html/boostbook.dtd.run-test.html new file mode 100644 index 0000000000..2266d71272 --- /dev/null +++ b/doc/html/boostbook.dtd.run-test.html @@ -0,0 +1,86 @@ + + BoostBook element run-test
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element run-test

      run-test — A testcase that should compile, link, and execute

      Synopsis

      run-test ::= + (source*, lib*, requirement*, purpose, if-fails?) +

      Attributes

      NameTypeValuePurpose
      filename#REQUIREDCDATAThe name of the file associated with this element
      name#IMPLIEDCDATAThe name of the element being declared to referenced
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.signature.html b/doc/html/boostbook.dtd.signature.html new file mode 100644 index 0000000000..943fb7eae7 --- /dev/null +++ b/doc/html/boostbook.dtd.signature.html @@ -0,0 +1,90 @@ + + BoostBook element signature
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element signature

      signature — One signature of an overloaded function or method

      Synopsis

      signature ::= + (template?, type, parameter*) +

      Description

      + A signature refers to one declaration of an overloaded function or + method. The signature itself has no name, because the name of the + overloaded function or method is used. An overloaded function or + method will have several signatures that will generally be typeset + together. +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      cv#IMPLIEDCDATAcv-qualifiers for this method, e.g., const volatile
      specifiers#IMPLIEDCDATAThe specifiers for this function, e.g., inline, static, etc.
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.snippet.html b/doc/html/boostbook.dtd.snippet.html new file mode 100644 index 0000000000..ea55344b25 --- /dev/null +++ b/doc/html/boostbook.dtd.snippet.html @@ -0,0 +1,81 @@ + + BoostBook element snippet
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element snippet

      snippet — Pulls in a code snippet from a programlisting element

      Synopsis

      snippet ::= + EMPTY +

      Attributes

      NameTypeValuePurpose
      name#REQUIREDCDATAThe name of the programlisting element to insert
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.source.html b/doc/html/boostbook.dtd.source.html new file mode 100644 index 0000000000..1b938140e7 --- /dev/null +++ b/doc/html/boostbook.dtd.source.html @@ -0,0 +1,90 @@ + + BoostBook element source
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element source

      source — Defines source code for a test

      Synopsis

      source ::= + (#PCDATA| snippet)* +

      Description

      This element will contain the source code for a testcase that + will be generated from the documentation. To reduce the amount of escaping in the text, it is recommended to use CDATA sections, which look like this: + +

      <![CDATA[
      +<your program text here: no escaping needed!>
      +]]>

      In addition to CDATA sections, code snippets can be pulled in + from programlisting elements using the snippet + element.

      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.specialization.html b/doc/html/boostbook.dtd.specialization.html new file mode 100644 index 0000000000..589b2d5f0d --- /dev/null +++ b/doc/html/boostbook.dtd.specialization.html @@ -0,0 +1,82 @@ + + BoostBook element specialization
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element specialization

      specialization — Defines the specialization arguments for a class specialization

      Synopsis

      specialization ::= + (template-arg)* +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.static-constant.html b/doc/html/boostbook.dtd.static-constant.html new file mode 100644 index 0000000000..bcc04a1c62 --- /dev/null +++ b/doc/html/boostbook.dtd.static-constant.html @@ -0,0 +1,85 @@ + + BoostBook element static-constant
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element static-constant

      static-constant — Declares a static constant, e.g., const int foo = 5;.

      Synopsis

      static-constant ::= + (type, default, purpose?, description?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.struct-specialization.html b/doc/html/boostbook.dtd.struct-specialization.html new file mode 100644 index 0000000000..791104dc8c --- /dev/null +++ b/doc/html/boostbook.dtd.struct-specialization.html @@ -0,0 +1,105 @@ + + BoostBook element struct-specialization
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element struct-specialization

      struct-specialization — A specialization (full or partial) of a struct template

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.struct.html b/doc/html/boostbook.dtd.struct.html new file mode 100644 index 0000000000..7eb6751637 --- /dev/null +++ b/doc/html/boostbook.dtd.struct.html @@ -0,0 +1,104 @@ + + BoostBook element struct
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element struct

      struct — Declares a C++ struct

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.template-arg.html b/doc/html/boostbook.dtd.template-arg.html new file mode 100644 index 0000000000..26e28fc5af --- /dev/null +++ b/doc/html/boostbook.dtd.template-arg.html @@ -0,0 +1,81 @@ + + BoostBook element template-arg
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element template-arg

      template-arg — A template argument in a specialization

      Synopsis

      template-arg ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.template-nontype-parameter.html b/doc/html/boostbook.dtd.template-nontype-parameter.html new file mode 100644 index 0000000000..48d24260a2 --- /dev/null +++ b/doc/html/boostbook.dtd.template-nontype-parameter.html @@ -0,0 +1,84 @@ + + BoostBook element template-nontype-parameter
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element template-nontype-parameter

      template-nontype-parameter — A nontype template parameter

      Synopsis

      template-nontype-parameter ::= + (type, default?, purpose?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.template-type-parameter.html b/doc/html/boostbook.dtd.template-type-parameter.html new file mode 100644 index 0000000000..fb0ae52db9 --- /dev/null +++ b/doc/html/boostbook.dtd.template-type-parameter.html @@ -0,0 +1,83 @@ + + BoostBook element template-type-parameter
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element template-type-parameter

      template-type-parameter — Declares a template type parameter

      Synopsis

      template-type-parameter ::= + (default?, purpose?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.template-varargs.html b/doc/html/boostbook.dtd.template-varargs.html new file mode 100644 index 0000000000..6f7ea71857 --- /dev/null +++ b/doc/html/boostbook.dtd.template-varargs.html @@ -0,0 +1,85 @@ + + BoostBook element template-varargs
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element template-varargs

      template-varargs — Declares a variable-length list of template parameters

      Synopsis

      template-varargs ::= + EMPTY +

      Description

      Variable-length template parameter lists are not allowed in + C++, but because they are sometimes needed in documentation they are + allowed in BoostBook. This element generally expands to "..." and + can be used anywhere any other template parameter can be + used.

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.template.html b/doc/html/boostbook.dtd.template.html new file mode 100644 index 0000000000..c8697f6617 --- /dev/null +++ b/doc/html/boostbook.dtd.template.html @@ -0,0 +1,84 @@ + + BoostBook element template
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element template

      template — Declares the template parameters of a class or function

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.testsuite.html b/doc/html/boostbook.dtd.testsuite.html new file mode 100644 index 0000000000..7d17803eee --- /dev/null +++ b/doc/html/boostbook.dtd.testsuite.html @@ -0,0 +1,87 @@ + + BoostBook element testsuite
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element testsuite

      testsuite — Describes a library testsuite

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.throws.html b/doc/html/boostbook.dtd.throws.html new file mode 100644 index 0000000000..284f4bf157 --- /dev/null +++ b/doc/html/boostbook.dtd.throws.html @@ -0,0 +1,81 @@ + + BoostBook element throws
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element throws

      throws — Description of the exceptions thrown by a function

      Synopsis

      throws ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.type.html b/doc/html/boostbook.dtd.type.html new file mode 100644 index 0000000000..034c24077c --- /dev/null +++ b/doc/html/boostbook.dtd.type.html @@ -0,0 +1,81 @@ + + BoostBook element type
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element type

      type — The type of an element or return type of a function

      Synopsis

      type ::= + (ANY) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.typedef.html b/doc/html/boostbook.dtd.typedef.html new file mode 100644 index 0000000000..34bace009a --- /dev/null +++ b/doc/html/boostbook.dtd.typedef.html @@ -0,0 +1,84 @@ + + BoostBook element typedef
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element typedef

      typedef — Declares a typedef

      Synopsis

      typedef ::= + (type, purpose?, description?) +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.union-specialization.html b/doc/html/boostbook.dtd.union-specialization.html new file mode 100644 index 0000000000..c3871b64ee --- /dev/null +++ b/doc/html/boostbook.dtd.union-specialization.html @@ -0,0 +1,105 @@ + + BoostBook element union-specialization
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element union-specialization

      union-specialization — A specialization (full or partial) of a union template

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.union.html b/doc/html/boostbook.dtd.union.html new file mode 100644 index 0000000000..58bd460b14 --- /dev/null +++ b/doc/html/boostbook.dtd.union.html @@ -0,0 +1,104 @@ + + BoostBook element union
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element union

      union — Declares a C++ union or union template

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.using-class.html b/doc/html/boostbook.dtd.using-class.html new file mode 100644 index 0000000000..d81a660154 --- /dev/null +++ b/doc/html/boostbook.dtd.using-class.html @@ -0,0 +1,81 @@ + + BoostBook element using-class
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element using-class

      using-class — Injects the method and function names of a class into the local scope

      Synopsis

      using-class ::= + EMPTY +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.dtd.using-namespace.html b/doc/html/boostbook.dtd.using-namespace.html new file mode 100644 index 0000000000..828e11d487 --- /dev/null +++ b/doc/html/boostbook.dtd.using-namespace.html @@ -0,0 +1,81 @@ + + BoostBook element using-namespace
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      + BoostBook element using-namespace

      using-namespace — Injects the declared names from a namespace into the local scope

      Synopsis

      using-namespace ::= + EMPTY +

      Attributes

      NameTypeValuePurpose
      last-revision#IMPLIEDCDATASet to $Date$ to keep "last revised" information in sync with CVS changes
      name#REQUIREDCDATAThe name of the element being declared to referenced
      id#IMPLIEDCDATAA global identifier for this element
      xml:base#IMPLIEDCDATAImplementation detail used by XIncludes
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.getting.started.html b/doc/html/boostbook.getting.started.html new file mode 100644 index 0000000000..64d2c7b13b --- /dev/null +++ b/doc/html/boostbook.getting.started.html @@ -0,0 +1,183 @@ +Getting Started
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Getting Started

      To use the Boost documentation tools, you will need an + XSLT + processor. There are many XSLT processors available, but for now + we suggest that you use xsltproc, part of libxslt. There are several + ways to get libxslt, depending on your platform:

      You will also need a recent checkout of Boost from CVS. If + you would like to limit your network bandwidth or limit delays in + building documentation, now might be a good time to download the + DocBook DTD and XSL stylesheets as described in the section called “Configuring local DocBook XSL and DTD distributions”.

      Now we can build some documentation. Change to the directory + $BOOST_ROOT/doc and run bjam --v2 to + build HTML documentation. You should see several warnings like + these while DocBook documentation is being built from BoostBook + documentation:

      Cannot find function named 'checked_delete'
      +Cannot find function named 'checked_array_delete'
      +Cannot find function named 'next'

      These warnings are emitted when the Boost documentation + tools cannot find documentation for functions, methods, or classes + that are referenced in the source, and are not harmful in any + way. Once Boost.Jam has completed its execution, HTML + documentation for Boost will be available in + $BOOST_ROOT/doc/html. You can also create HTML + documentation in a single (large!) HTML file with the command line + bjam --v2 onehtml, or Unix man pages with the command + line bjam --v2 man. The complete list of output + formats is listed in Table 1. Several output formats can + be passed to a single invocation of bjam, e.g., + bjam --v2 html man docbook would generate HTML + (multiple files), man pages, and DocBook documentation.

      Table 1. BoostBook Output Formats

      FormatDescription
      html

      HTML output (multiple files). This is the default

      onehtml

      HTML output in a single HTML file.

      man

      Unix man pages.

      pdf

      PDF. Requires Apache FOP.

      ps

      Postscript. Requires Apache FOP.

      docbookDocBook.
      foXSL Formatting Objects

      Configuring local DocBook XSL and DTD distributions

      By default, the DocBook DTD and XSL stylesheets are + accessed over a network automatically by the XSLT + processor. However, these documents tend to be large and + introduce a noticeable delay in the XSLT transformation + step. This section describes how to configure Boost.Build to use + local copies of the DocBook DTD and XSL stylesheets to improve + processing time. There are a few requirements: + +

      • Norman Walsh's DocBook XSL stylesheets, + available at the DocBook sourceforge + site. Extract the DocBook XSL stylesheets to a + directory on your hard disk (which we'll refer to as the + DOCBOOK_XSL_DIR).

      • The DocBook DTD, available as a ZIP archive at + the OASIS + DocBook site. The package is called "DocBook XML + 4.2". Extract the DocBook DTD to a directory on your hard disk + (which we'll refer to as the + DOCBOOK_DTD_DIR).

      In the directory tools/build/new is a file + named user-config.jam. Copy it to your home + directory (or edit it in-place), and add a directive telling + Boost.Build where to find the DocBook DTD and XSL stylesheets, + replacing DOCBOOK_XSL_DIR and + DOCBOOK_DTD_DIR with the paths of the DocBook XSL + stylsheets and DTD, respectively: + +

      #  BoostBook configuration
      +using boostbook : DOCBOOK_XSL_DIR
      +                : DOCBOOK_DTD_DIR
      +                ;

      Future invocations of bjam will use the + specified local copies of the DTD and XSL stylesheets in lieu of + downloading the same sources over the network.

      Configuring Apache FOP for PostScript/PDF Output

      This section describes the steps required to configure + Apache + FOP to generate PostScript and PDF output for BoostBook + documents. To begin, you will need two pieces of software: +

      Once Java is installed (we'll call Java's directory + JAVA_HOME) and Apache FOP has been extracted into a + directory (we'll call FOP's directory FOP_DIR), we + need to configure Boost.Build to use FOP. Edit your + user-config.jam or + site-config.jam and add the following, + replacing FOP_DIR with the directory where Apache + FOP is installed, and replace JAVA_HOME with the + directory where Java is installed: + +

      using fop : FOP_DIR
      +          : JAVA_HOME
      +          ;

      + + In some cases, JAVA_HOME is optional, but it often + helps to specify it.

      To test PDF generation, switch to the directory $BOOST_ROOT/doc and execute the + command bjam --v2 pdf. In the absence of any + errors, Apache FOP will be executed to transform the XSL:FO + output of DocBook into a PDF file.

      Configuring Doxygen for Documentation Extraction

      This section details the steps necessary to use Doxygen to + extract documentation and comments from source code to build a + BoostBook document (and transform it into end-user + documentation). You will need a somewhat recent version of Doxygen; 1.2.18 or newer should suffice.

      Boost.Build can be configured for Doxygen support by editing + user-config.jam or + site-config.jam to add: + +

      using doxygen : DOXYGEN ;

      DOXYGEN should be replaced with the name of + the doxygen executable (with full path + name). If the right doxygen executable can be + found via the path, this parameter can be omitted.

      Generating of documentation from source files using + Doxygen requires two steps. The first step involves identifying + the source files so that Doxygen can process them. The second + step is to specify that the output of this process, a file in + the Doxygen XML format, is input for a BoostBook document. The + following Jamfile.v2 illustrates a simple + case of generating reference documentation for the + Any library:

      project boost/any/doc ;
      +import boostbook : boostbook ; 
      +import doxygen : doxygen ;
      +
      +doxygen any.doxygen : ../../../boost/any.hpp ;
      +boostbook any : any.doxygen ;

      In this example, we generate the Doxygen XML + representation in the file any.doxygen from + the source file ../../../boost/any.hpp by + invocing Doxygen. We then use any.doxygen + as a source for the BoostBook target any, which + will generate documentation in any format the user requests. The + actual sequence of events in this transformation is:

      1. Doxygen parses the header file ../../../boost/any.hpp and outputs a single XML file any.doxygen.
      2. The XSLT processor applies the stylesheet doxygen2boostbook.xsl to transform any.doxygen into the BoostBook file any.xml.
      3. The XSLT processor applies the stylesheet docbook.xsl to transform any.xml into the DocBook XML document any.docbook.
      4. Further transformations may generate HTML, FO, PDF, etc. from any.docbook.
      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/boostbook.html b/doc/html/boostbook.html index 9ed43b9278..49d67d2bc5 100644 --- a/doc/html/boostbook.html +++ b/doc/html/boostbook.html @@ -1,10 +1,120 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boostbook.html - - +The BoostBook Documentation Format
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      The BoostBook Documentation Format

      Douglas Gregor

      Permission to copy, use, sell and distribute this software + is granted provided this copyright notice appears in all copies. + Permission to modify the code and to distribute modified code is + granted provided this copyright notice appears in all copies, + and a notice that the code was modified is included with the + copyright notice.

      This software is provided "as is" without express or + implied warranty, and with no claim as to its suitability for + any purpose.

      Introduction

      The BoostBook documentation format is an extension of DocBook, an SGML- or + XML-based format for describing documentation. BoostBook augments + DocBook with semantic markup that aids in the documentation of C++ + libraries, specifically the Boost C++ libraries, by + providing the ability to express and refer to C++ constructs such + as namespaces, classes, overloaded functions, templates, and + specializations.

      + BoostBook offers additional features more specific to its use for + documenting the Boost C++ + libraries. These features are intended to eliminate or + reduce the need for duplication of information and to aid in + documenting portions of Boost that might otherwise not be + documented. Examples of Boost-centric features include: +

      • Testsuites: + Testsuites in Boost are created by writing an appropriate + Jamfile and including that Jamfile in + status/Jamfile. If the testsuites are + documented (as + in the MultiArray library), the documentation is + maintained separately from the testcase Jamfile, leading to + duplication of information and the possibility of having the + documentation out of sync with the Jamfile. BoostBook + contains elements that describe a testsuite for both + purposes: the BoostBook stylesheets can generate + documentation for the testcases and also generate an + appropriate Jamfile to integrate the testcases with the + regression testing system.

      • Example programs: + Example programs in documentation need to be duplicated in + testcases to ensure that the examples compile and execute + correctly. Keeping the two copies in sync is a tedious and + error-prone task. For instance, the following code snippet + persisted for six months:

        +std::cout << f(5, 3) >> std::endl;
        +

        The BoostBook format allows testcases to be generated + by weaving together program fragments from example programs + in the documentation. This capability is integrated with + testsuite generation so that example programs are normal + tests in BoostBook.

      • Library + categorization: BoostBook contains primitives for + placing libraries into categories and generating categorized + and alphabetized lists of libraries.

      Last revised: , at GMT
      diff --git a/doc/html/boostbook.together.html b/doc/html/boostbook.together.html new file mode 100644 index 0000000000..897f5c34a0 --- /dev/null +++ b/doc/html/boostbook.together.html @@ -0,0 +1,111 @@ +Bringing Together a BoostBook Document
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Bringing Together a BoostBook Document

      Linking in BoostBook

      How one links to another element in BoostBook depends + greatly on the nature of the element linked and how the link + should appear. There are three general linking elements: + <xref>, <link>, and <ulink>. Additionally, there + are linking elements for referencing specific types of entities, + such as classes (<classname>), functions + (<functionname>), or libraries (<libraryname>).

      The <xref> element references elements that have an + id attribute and a title. The actual link text is + composed from title and type of the element referenced. To link to + a particular ID, create an <xref> element with the + linkend attribute set to the ID of the intended + target. For instance, this section's ID is + boostbook.linking, so we create a reference it to + with <xref linkend="boostbook.linking"/>, which + will look like this in the text: the section called “Linking in BoostBook”.

      The <link> element references an ID in the same way as + <xref>, except that <link> does not generate any text + for the link, so text must be supplied within the element. For + instance, we can again link to this chapter but this time specify + our own text with <link + linkend="boostbook.linking">like this</link>. This + markup will result in a link to this chapter that looks like this.

      The <ulink> element references a URL that is outside + of the DocBook document. The url attribute contains + the URL to link to, and the element data provides the link + text.For instance, we can link to the the Boost web site with + <ulink + url="http://www.boost.org">Boost</ulink>, which + appears in the document like this: Boost.

      The <classname>, <functionname>, + <methodname>, and <libraryname> link to classes, + functions, methods, and libraries, respectively. The text of each + element gives both the name of the element to link to and the link + text. For instance, we can link to the Function library with + <libraryname>Function</libraryname>, + which results in the following: + Function. In cases where the displayed + text is different from the actual name, the alt + attribute can be specified. For instance, the following XML + element references the boost::function + class template but displays the text function: <classname + alt="boost::function">function</classname>.

      Last revised: June 30, 2003 at 06:51:10 GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/ch01s02.html b/doc/html/ch01s02.html new file mode 100644 index 0000000000..10505311c9 --- /dev/null +++ b/doc/html/ch01s02.html @@ -0,0 +1,183 @@ +Libraries Listed by Category
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Libraries Listed by Category

      + String and text processing +

      • Format - Type-safe 'printf-like' format operations, from Samuel Krempp.
      • Regex - Regular expression library, from John Maddock.
      • Tokenizer - Break of a string or other character sequence into a series of tokens, from John Bandela.

      + Containers +

      • Array - STL compliant container wrapper for arrays of constant size, from Nicolai Josuttis.
      • Dynamic Bitset - A runtime sized version of std::bitset, from Jeremy Siek and Chuck Allison.
      • Graph - Generic graph components and algorithms, from Jeremy Siek and University of Notre Dame Team.
      • Multi Array - Multidimensional containers and adaptors for arrays of contiguous data, from Ron Garcia.
      • Property Map - Concepts defining interfaces which map key objects to value objects, from Jeremy Siek.
      • Variant - Safe, generic, stack-based discriminated union container, from Eric Friedman and Itay Maman.

      + Iterators +

      • Graph - Generic graph components and algorithms, from Jeremy Siek and University of Notre Dame Team.
      • Iterator Adaptors - Adapt a base type into a standard conforming iterator, from Dave Abrahams, Jeremy Siek, and John Potter.
      • Operators - Templates ease arithmetic classes and iterators, from Dave Abrahams and Jeremy Siek.
      • Tokenizer - Break of a string or other character sequence into a series of tokens, from John Bandela.

      + Algorithms +

      • Graph - Generic graph components and algorithms, from Jeremy Siek and University of Notre Dame Team.
      • Utility - Class noncopyable plus checked_delete, checked_array_delete, next, prior function templates, plus base-from-member idiom, from Dave Abrahams and others .

      + Function objects and higher-order programming +

      • Bind - Generalized binders for function/object/pointers and member functions, from Peter Dimov.
      • Compose - Functional composition adapters for the STL, from Nicolai Josuttis.
      • Function - Function object wrappers for deferred calls or callbacks, from Douglas Gregor.
      • Functional - Enhanced function object adaptors, from Mark Rodgers.
      • Lambda - Define small unnamed function objects at the actual call site, and more, from Jaakko Järvi and Gary Powell.
      • Mem_fn - Generalized binders for member functions, from Peter Dimov.
      • Ref - A utility library for passing references to generic functions, from Jaakko Järvi, Peter Dimov, Douglas Gregor, and Dave Abrahams.
      • Signals - Managed signals & slots callback implementation, from Douglas Gregor.

      + Generic programming +

      • Call Traits - Defines types for passing parameters, from John Maddock and Howard Hinnant.
      • Concept Check - Tools for generic programming, from Jeremy Siek.
      • Operators - Templates ease arithmetic classes and iterators, from Dave Abrahams and Jeremy Siek.
      • Property Map - Concepts defining interfaces which map key objects to value objects, from Jeremy Siek.
      • Static Assert - Static assertions (compile time assertions), from John Maddock.
      • Type Traits - Templates for fundamental properties of types, from John Maddock, Steve Cleary, and others .

      + Template metaprogramming +

      • MPL - Template metaprogramming framework of compile-time algorithms, sequences and metafunction classes, from Aleksey Gurtovoy.
      • Static Assert - Static assertions (compile time assertions), from John Maddock.
      • Type Traits - Templates for fundamental properties of types, from John Maddock, Steve Cleary, and others .

      + Preprocessor metaprogramming +

      • Preprocessor - Preprocessor metaprogramming tools including repetition and recursion, from Vesa Karvonen and Paul Mensonides.

      + Concurrent programming +

      • Threads - Portable C++ multi-threading, from William Kempf.

      + Math and numerics +

      • Integer - Headers to ease dealing with integral types, from various authors.
      • Interval - Extends the usual arithmetic functions to mathematical intervals, from Guillaume Melquiond, Hervé Brönnimann, and Sylvain Pion.
      • Math - Several contributions in the domain of mathematics, from various authors.
      • Math/Common Factor - Greatest common divisor and least common multiple, from Daryle Walker.
      • Math/Octonion - Octonions, from Hubert Holin.
      • Math/Quaternion - Quaternions, from Hubert Holin.
      • Math/Special Functions - Mathematical special functions such as atanh, sinc, and sinhc, from Hubert Holin.
      • Multi Array - Multidimensional containers and adaptors for arrays of contiguous data, from Ron Garcia.
      • Operators - Templates ease arithmetic classes and iterators, from Dave Abrahams and Jeremy Siek.
      • Random - A complete system for random number generation, from Jens Maurer.
      • Rational - A rational number class, from Paul Moore.
      • uBLAS - Basic linear algebra for dense, packed and sparse matrices, from Joerg Walter and Mathias Koch.

      + Correctness and testing +

      • Concept Check - Tools for generic programming, from Jeremy Siek.
      • Static Assert - Static assertions (compile time assertions), from John Maddock.
      • Test - Support for simple program testing, full unit testing, and for program execution monitoring, from Gennadiy Rozental.

      + Data structures +

      • Any - + Safe, generic container for single values of different value types + , from Kevlin Henney.
      • Compressed Pair - Empty member optimization, from John Maddock and Howard Hinnant.
      • Optional - Discriminated-union wrapper for optional values, from Fernando Cacciola.
      • Tuple - Ease definition of functions returning multiple values, and more, from Jaakko Järvi.
      • Variant - Safe, generic, stack-based discriminated union container, from Eric Friedman and Itay Maman.

      + Input/Output +

      • Format - Type-safe 'printf-like' format operations, from Samuel Krempp.
      • I/O State Savers - Save I/O state to prevent jumbled data, from Daryle Walker.

      + Inter-language support +

      • Python - Reflects C++ classes and functions into Python, from Dave Abrahams.

      + Memory +

      • Pool - Memory pool management, from Steve Cleary.
      • Smart Pointer - Five smart pointer class templates, from Greg Colvin, Beman Dawes, Peter Dimov, and Darin Adler.
      • Utility - Class noncopyable plus checked_delete, checked_array_delete, next, prior function templates, plus base-from-member idiom, from Dave Abrahams and others .

      + Parsing +

      • Spirit - LL parser framework represents parsers directly as EBNF grammars in inlined C++, from Joel de Guzman and team .

      + Miscellaneous +

      • CRC - Cyclic Redundancy Code, from Daryle Walker.
      • Compressed Pair - Empty member optimization, from John Maddock and Howard Hinnant.
      • Conversion - Numeric, polymorphic, and lexical casts, from Dave Abrahams and Kevlin Henney.
      • Date-Time - Date-Time library, from Jeff Garland.
      • Filesystem - Portable paths, iteration over directories, and other useful filesystem operations, from Beman Dawes.
      • Optional - Discriminated-union wrapper for optional values, from Fernando Cacciola.
      • Timer - Event timer, progress timer, and progress display classes, from Beman Dawes.
      • Utility - Class noncopyable plus checked_delete, checked_array_delete, next, prior function templates, plus base-from-member idiom, from Dave Abrahams and others .

      + Broken compiler workarounds +

      • Compatibility - Help for non-conforming standard libraries, from Ralf Grosse-Kunstleve and Jens Maurer.
      • Config - Helps boost library developers adapt to compiler idiosyncrasies; not intended for library users, from John Maddock, Beman Dawes, and Vesa Karvonen.
      Last revised: , at GMT
      diff --git a/doc/html/ch02s02.html b/doc/html/ch02s02.html new file mode 100644 index 0000000000..fa1a822e31 --- /dev/null +++ b/doc/html/ch02s02.html @@ -0,0 +1,171 @@ +Examples
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Examples

      The following code demonstrates the syntax for using + implicit conversions to and copying of any objects:

      +#include <list>
      +#include <boost/any.hpp>
      +
      +using boost::any_cast;
      +typedef std::list<boost::any> many;
      +
      +void append_int(many & values, int value)
      +{
      +    boost::any to_append = value;
      +    values.push_back(to_append);
      +}
      +
      +void append_string(many & values, const std::string & value)
      +{
      +    values.push_back(value);
      +}
      +
      +void append_char_ptr(many & values, const char * value)
      +{
      +    values.push_back(value);
      +}
      +
      +void append_any(many & values, const boost::any & value)
      +{
      +    values.push_back(value);
      +}
      +
      +void append_nothing(many & values)
      +{
      +    values.push_back(boost::any());
      +}
      +

      The following predicates follow on from the previous + definitions and demonstrate the use of queries on any + objects:

      +bool is_empty(const boost::any & operand)
      +{
      +    return operand.empty();
      +}
      +
      +bool is_int(const boost::any & operand)
      +{
      +    return operand.type() == typeid(int);
      +}
      +
      +bool is_char_ptr(const boost::any & operand)
      +{
      +    try
      +    {
      +        any_cast<const char *>(operand);
      +        return true;
      +    }
      +    catch(const boost::bad_any_cast &)
      +    {
      +        return false;
      +    }
      +}
      +
      +bool is_string(const boost::any & operand)
      +{
      +    return any_cast<std::string>(&operand);
      +}
      +
      +void count_all(many & values, std::ostream & out)
      +{
      +    out << "#empty == "
      +        << std::count_if(values.begin(), values.end(), is_empty) << std::endl;
      +    out << "#int == "
      +        << std::count_if(values.begin(), values.end(), is_int) << std::endl;
      +    out << "#const char * == "
      +        << std::count_if(values.begin(), values.end(), is_char_ptr) << std::endl;
      +    out << "#string == "
      +        << std::count_if(values.begin(), values.end(), is_string) << std::endl;
      +}
      +

      The following type, patterned after the OMG's Property Service, defines name-value pairs for arbitrary value types:

      +struct property
      +{
      +    property();
      +    property(const std::string &, const boost::any &);
      +
      +    std::string name;
      +    boost::any value;
      +};
      +
      +typedef std::list<property> properties;
      +

      The following base class demonstrates one approach to + runtime polymorphism based callbacks that also require arbitrary + argument types. The absence of virtual member templates requires + that different solutions have different trade-offs in terms of + efficiency, safety, and generality. Using a checked variant type + offers one approach:

      +class consumer
      +{
      +public:
      +    virtual void notify(const any &) = 0;
      +    ...
      +};
      +
      Last revised: , at GMTCopyright © 2001 Kevlin Henney
      diff --git a/doc/html/ch02s04.html b/doc/html/ch02s04.html new file mode 100644 index 0000000000..e8b206768a --- /dev/null +++ b/doc/html/ch02s04.html @@ -0,0 +1,73 @@ +Acknowledgements
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Acknowledgements

      Doug Gregor ported the documentation to the BoostBook format.

      Last revised: , at GMTCopyright © 2001 Kevlin Henney
      diff --git a/doc/html/ch06s02.html b/doc/html/ch06s02.html new file mode 100644 index 0000000000..7a7084d588 --- /dev/null +++ b/doc/html/ch06s02.html @@ -0,0 +1,649 @@ +Tutorial
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Tutorial

      How to Read this Tutorial

      This tutorial is not meant to be read linearly. Its top-level +structure roughly separates different concepts in the library +(e.g., handling calling multiple slots, passing values to and from +slots) and in each of these concepts the basic ideas are presented +first and then more complex uses of the library are described +later. Each of the sections is marked Beginner, +Intermediate, or Advanced to help guide the +reader. The Beginner sections include information that all +library users should know; one can make good use of the Signals +library after having read only the Beginner sections. The +Intermediate sections build on the Beginner +sections with slightly more complex uses of the library. Finally, +the Advanced sections detail very advanced uses of the +Signals library, that often require a solid working knowledge of +the Beginner and Intermediate topics; most users +will not need to read the Advanced sections.

      Compatibility Note

      Boost.Signals has two syntactical forms: the preferred form and +the compatibility form. The preferred form fits more closely with the +C++ language and reduces the number of separate template parameters +that need to be considered, often improving readability; however, the +preferred form is not supported on all platforms due to compiler +bugs. The compatible form will work on all compilers supported by +Boost.Signals. Consult the table below to determine which syntactic +form to use for your compiler. Users of Boost.Function, please note +that the preferred syntactic form in Signals is equivalent to that of +Function's preferred syntactic form.

      If your compiler does not appear in this list, please try the +preferred syntax and report your results to the Boost list so that +we can keep this table up-to-date.

      Preferred syntaxPortable syntax
      • GNU C++ 2.95.x, 3.0.x, 3.1.x

      • Comeau C++ 4.2.45.2

      • SGI MIPSpro 7.3.0

      • Intel C++ 5.0, 6.0

      • Compaq's cxx 6.2

      • Microsoft Visual C++ 7.1

      • Any compiler supporting the preferred syntax

      • Microsoft Visual C++ 6.0, 7.0

      • Borland C++ 5.5.1

      • Sun WorkShop 6 update 2 C++ 5.3

      • Metrowerks CodeWarrior 8.1

      Hello, World! (Beginner)

      The following example writes "Hello, World!" using signals and +slots. First, we create a signal sig, a signal that +takes no arguments and has a void return value. Next, we connect +the hello function object to the signal using the +connect method. Finally, use the signal +sig like a function to call the slots, which in turns +invokes HelloWorld::operator() to print "Hello, +World!".

      Preferred syntaxPortable syntax
      +struct HelloWorld 
      +{
      +  void operator()() const 
      +  { 
      +    std::cout << "Hello, World!" << std::endl;
      +  } 
      +};
      +
      +// ...
      +
      +// Signal with no arguments and a void return value
      +boost::signal<void ()> sig;
      +
      +// Connect a HelloWorld slot
      +HelloWorld hello;
      +sig.connect(hello);
      +
      +// Call all of the slots
      +sig();
      +
      +struct HelloWorld 
      +{
      +  void operator()() const 
      +  { 
      +    std::cout << "Hello, World!" << std::endl;
      +  } 
      +};
      +
      +// ...
      +
      +// Signal with no arguments and a void return value
      +boost::signal0<void> sig;
      +
      +// Connect a HelloWorld slot
      +HelloWorld hello;
      +sig.connect(hello);
      +
      +// Call all of the slots
      +sig();
      +

      Calling multiple slots

      Connecting multiple slots (Beginner)

      Calling a single slot from a signal isn't very interesting, so +we can make the Hello, World program more interesting by splitting +the work of printing "Hello, World!" into two completely separate +slots. The first slot will print "Hello" and may look like +this:

      +struct Hello 
      +{
      +  void operator()() const
      +  {
      +    std::cout << "Hello";
      +  }
      +};
      +

      The second slot will print ", World!" and a newline, to complete +the program. The second slot may look like this:

      +struct World
      +{
      +  void operator()() const
      +  {
      +    std::cout << ", World!" << std::endl;
      +  }
      +};
      +

      Like in our previous example, we can create a signal +sig that takes no arguments and has a +void return value. This time, we connect both a +hello and a world slot to the same +signal, and when we call the signal both slots will be called.

      Preferred syntaxPortable syntax
      boost::signal<void ()> sig;
      +
      +sig.connect(Hello());
      +sig.connect(World());
      +
      +sig();
      +
      boost::signal0<void> sig;
      +
      +sig.connect(Hello());
      +sig.connect(World());
      +
      +sig();
      +

      Now, if you compile and run this program, you might see +something strange. It is possible that the output will look like +this:

      +  , World!
      +Hello
      +

      The underlying reason is that the ordering of signals isn't +guaranteed. The signal is free to call either the +Hello slot or the World slot first, but +every slot will be called unless something bad (e.g., an exception) +occurs. Read on to learn how to control the ordering so that +"Hello, World!" always prints as expected.

      Ordering slot call groups (Intermediate)

      Slots are free to have side effects, and that can mean that some +slots will have to be called before others. The Boost.Signals +library allows slots to be placed into groups that are ordered in +some way. For our Hello, World program, we want "Hello" to be +printed before ", World!", so we put "Hello" into a group that must +be executed before the group that ", World!" is in. To do this, we +can supply an extra parameter at the beginning of the +connect call that specifies the group. Group values +are, by default, ints, and are ordered by the integer +< relation. Here's how we construct Hello, World:

      Preferred syntaxPortable syntax
      boost::signal<void ()> sig;
      +sig.connect(0, Hello());
      +sig.connect(1, World());
      +sig();
      +
      boost::signal0<void> sig;
      +sig.connect(0, Hello());
      +sig.connect(1, World());
      +sig();
      +

      This program will correctly print "Hello, World!", because the +Hello object is in group 0, which precedes group 1 +where the World object resides.

      The group parameter is, in fact, optional. We omitted it in the +first Hello, World example because it was unnecessary when all of +the slots are independent. So what happens if we mix calls to +connect that use the group parameter and those that don't? The +"unnamed" slots (i.e., those that have been connected without +specifying a group name) go into a separate group that is special +in that it follows all other groups. So if we add a new slot to our +example like this:

      +struct GoodMorning
      +{
      +  void operator()() const
      +  {
      +    std::cout << "... and good morning!" << std::endl;
      +  }
      +};
      +
      +sig.connect(GoodMorning());
      +

      ... we will get the result we wanted:

      +Hello, World!
      +... and good morning!
      +

      The last interesting point with groups of slots is the behavior +when multiple slots are connected in the same group. Within groups, +calls to slots are unordered: if we connect slots A +and B to the same signal with the same group name, +either A or B will be called first (but +both will be called). This is the same behavior we saw before with +the second version of Hello, World, where the slots could be called +in the wrong order, mangling the output.

      Passing values to and from slots

      Slot Arguments (Beginner)

      Signals can propagate arguments to each of the slots they call. +For instance, a signal that propagates mouse motion events might +want to pass along the new mouse coordinates and whether the mouse +buttons are pressed.

      As an example, we'll create a signal that passes two +float arguments to its slots. Then we'll create a few +slots that print the results of various arithmetic operations on +these values.

      +void print_sum(float x, float y)
      +{
      +  std::cout << "The sum is " << x+y << std::endl;
      +}
      +
      +void print_product(float x, float y)
      +{
      +  std::cout << "The product is " << x*y << std::endl;
      +}
      +
      +void print_difference(float x, float y)
      +{
      +  std::cout << "The difference is " << x-y << std::endl;
      +}
      +
      +void print_quotient(float x, float y)
      +{
      +  std::cout << "The quotient is " << x/y << std::endl;
      +}
      +
      Preferred syntaxPortable syntax
      boost::signal<void (float, float)> sig;
      +
      +sig.connect(&print_sum);
      +sig.connect(&print_product);
      +sig.connect(&print_difference);
      +sig.connect(&print_quotient);
      +
      +sig(5, 3);
      +
      boost::signal2<void, float, float> sig;
      +
      +sig.connect(&print_sum);
      +sig.connect(&print_product);
      +sig.connect(&print_difference);
      +sig.connect(&print_quotient);
      +
      +sig(5, 3);
      +

      This program will print out something like the following, +although the ordering of the lines may differ:

      +The sum is 8
      +The difference is 2
      +The product is 15
      +The quotient is 1.66667
      +

      So any values that are given to sig when it is +called like a function are passed to each of the slots. We have to +declare the types of these values up front when we create the +signal. The type boost::signal<void (float, +float)> means that the signal has a void +return value and takes two float values. Any slot +connected to sig must therefore be able to take two +float values.

      Signal Return Values (Advanced)

      Just as slots can receive arguments, they can also return +values. These values can then be returned back to the caller of the +signal through a combiner. The combiner is a mechanism +that can take the results of calling slots (there many be no +results or a hundred; we don't know until the program runs) and +coalesces them into a single result to be returned to the caller. +The single result is often a simple function of the results of the +slot calls: the result of the last slot call, the maximum value +returned by any slot, or a container of all of the results are some +possibilities.

      We can modify our previous arithmetic operations example +slightly so that the slots all return the results of computing the +product, quotient, sum, or difference. Then the signal itself can +return a value based on these results to be printed:

      Preferred syntaxPortable syntax
      +float compute_product(float x, float y) { return x*y; }
      +float compute_quotient(float x, float y) { return x/y; }
      +float compute_sum(float x, float y) { return x+y; }
      +float compute_difference(float x, float y) { return x-y; }
      +
      +boost::signal<float (float x, float y)> sig;
      +
      +sig.connect(&compute_product);
      +sig.connect(&compute_quotient);
      +sig.connect(&compute_sum);
      +sig.connect(&compute_difference);
      +
      +std::cout << sig(5, 3) << std::endl;
      +
      +float compute_product(float x, float y) { return x*y; }
      +float compute_quotient(float x, float y) { return x/y; }
      +float compute_sum(float x, float y) { return x+y; }
      +float compute_difference(float x, float y) { return x-y; }
      +
      +boost::signal2<float, float, float> sig;
      +
      +sig.connect(&compute_product);
      +sig.connect(&compute_quotient);
      +sig.connect(&compute_sum);
      +sig.connect(&compute_difference);
      +
      +std::cout << sig(5, 3) << std::endl;
      +

      This example program will output either 8, +1.6667, 15, or 2, depending +on the order that the signals are called. This is because the +default behavior of a signal that has a return type +(float, the first template argument given to the +boost::signal class template) is to call all slots and +then return the result returned by the last slot called. This +behavior is admittedly silly for this example, because slots have +no side effects and the result is essentially randomly chosen from +the slots.

      A more interesting signal result would be the maximum of the +values returned by any slot. To do this, we create a custom +combiner that looks like this:

      +template<typename T>
      +struct maximum
      +{
      +  typedef T result_type;
      +
      +  template<typename InputIterator>
      +  T operator()(InputIterator first, InputIterator last) const
      +  {
      +    // If there are no slots to call, just return the
      +    // default-constructed value
      +    if (first == last)
      +      return T();
      +
      +    T max_value = *first++;
      +    while (first != last) {
      +      if (max_value < *first)
      +        max_value = *first;
      +      ++first;
      +    }
      +  
      +    return max_value;
      +  }
      +};
      +

      The maximum class template acts as a function +object. Its result type is given by its template parameter, and +this is the type it expects to be computing the maximum based on +(e.g., maximum<float> would find the maximum +float in a sequence of floats). When a +maximum object is invoked, it is given an input +iterator sequence [first, last) that includes the +results of calling all of the slots. maximum uses this +input iterator sequence to calculate the maximum element, and +returns that maximum value.

      We actually use this new function object type by installing it +as a combiner for our signal. The combiner template argument +follows the signal's calling signature:

      Preferred syntaxPortable syntax
      boost::signal<float (float x, float y), 
      +              maximum<float> > sig;
      +
      boost::signal2<float, float, float, 
      +               maximum<float> > sig;
      +

      Now we can connect slots that perform arithmetic functions and +use the signal:

      +sig.connect(&compute_quotient);
      +sig.connect(&compute_product);
      +sig.connect(&compute_sum);
      +sig.connect(&compute_difference);
      +
      +std::cout << sig(5, 3) << std::endl;
      +

      The output of this program will be 15, because +regardless of the order in which the slots are called, the product +of 5 and 3 will be larger than the quotient, sum, or +difference.

      In other cases we might want to return all of the values +computed by the slots together, in one large data structure. This +is easily done with a different combiner:

      +template<typename Container>
      +struct aggregate_values
      +{
      +  typedef Container result_type;
      +
      +  template<typename InputIterator>
      +  Container operator()(InputIterator first, InputIterator last) const
      +  {
      +    return Container(first, last);
      +  }
      +};
      +

      +Again, we can create a signal with this new combiner: +

      Preferred syntaxPortable syntax
      boost::signal<float (float, float), 
      +              aggregate_values<std::vector<float> > > sig;
      +
      +sig.connect(&compute_quotient);
      +sig.connect(&compute_product);
      +sig.connect(&compute_sum);
      +sig.connect(&compute_difference);
      +
      +std::vector<float> results = sig(5, 3);
      +std::copy(results.begin(), results.end(), 
      +          std::ostream_iterator<float>(cout, " "));
      +
      boost::signal2<float, float, float,
      +               aggregate_values<std::vector<float> > > sig;
      +
      +sig.connect(&compute_quotient);
      +sig.connect(&compute_product);
      +sig.connect(&compute_sum);
      +sig.connect(&compute_difference);
      +
      +std::vector<float> results = sig(5, 3);
      +std::copy(results.begin(), results.end(), 
      +          std::ostream_iterator<float>(cout, " "));
      +

      The output of this program will contain 15, 8, 1.6667, and 2 +(but not necessarily in that order). It is interesting here that +the first template argument for the signal class, +float, is not actually the return type of the signal. +Instead, it is the return type used by the connected slots and will +also be the value_type of the input iterators passed +to the combiner. The combiner itself is a function object and its +result_type member type becomes the return type of the +signal.

      The input iterators passed to the combiner transform dereference +operations into slot calls. Combiners therefore have the option to +invoke only some slots until some particular criterion is met. For +instance, in a distributed computing system, the combiner may ask +each remote system whether it will handle the request. Only one +remote system needs to handle a particular request, so after a +remote system accepts the work we do not want to ask any other +remote systems to perform the same task. Such a combiner need only +check the value returned when dereferencing the iterator, and +return when the value is acceptable. The following combiner returns +the first non-NULL pointer to a FulfilledRequest data +structure, without asking any later slots to fulfill the +request:

      +struct DistributeRequest {
      +  typedef FulfilledRequest* result_type;
      +
      +  template<typename InputIterator>
      +  result_type operator()(InputIterator first, InputIterator last) const
      +  {
      +    while (first != last) {
      +      if (result_type fulfilled = *first)
      +        return fulfilled;
      +      ++first;
      +    }
      +    return 0;
      +  }
      +};
      +

      Connection Management

      Disconnecting Slots (Beginner)

      Slots aren't expected to exist indefinately after they are +connected. Often slots are only used to receive a few events and +are then disconnected, and the programmer needs control to decide +when a slot should no longer be connected.

      The entry point for managing connections explicitly is the +boost::signals::connection class. The +connection class uniquely represents the connection +between a particular signal and a particular slot. The +connected() method checks if the signal and slot are +still connected, and the disconnect() method +disconnects the signal and slot if they are connected before it is +called. Each call to the signal's connect() method +returns a connection object, which can be used to determine if the +connection still exists or to disconnect the signal and slot.

      +boost::signals::connection c = sig.connect(HelloWorld());
      +if (c.connected()) {
      +// c is still connected to the signal
      +  sig(); // Prints "Hello, World!"
      +}
      +
      +c.disconnect(); // Disconnect the HelloWorld object
      +assert(!c.connected()); c isn't connected any more
      +
      +sig(); // Does nothing: there are no connected slots
      Scoped connections (Intermediate)

      The boost::signals::scoped_connection class +references a signal/slot connection that will be disconnected when +the scoped_connection class goes out of scope. This +ability is useful when a connection need only be temporary, +e.g.,

      +{
      +  boost::signals::scoped_connection c = sig.connect(ShortLived());
      +  sig(); // will call ShortLived function object
      +}
      +sig(); // ShortLived function object no longer connected to sig
      Automatic connection management (Intermediate)

      Boost.Signals can automatically track the lifetime of objects +involved in signal/slot connections, including automatic +disconnection of slots when objects involved in the slot call are +destroyed. For instance, consider a simple news delivery service, +where clients connect to a news provider that then sends news to +all connected clients as information arrives. The news delivery +service may be constructed like this:

      Preferred syntaxPortable syntax
      +class NewsItem { /* ... */ };
      +
      +boost::signal<void (const NewsItem& latestNews)> deliverNews;
      +
      +class NewsItem { /* ... */ };
      +
      +boost::signal1<void, const NewsItem&> deliverNews;
      +

      Clients that wish to receive news updates need only connect a +function object that can receive news items to the +deliverNews signal. For instance, we may have a +special message area in our application specifically for news, +e.g.,:

      +struct NewsMessageArea : public MessageArea
      +{
      +public:
      +  // ...
      +
      +  void displayNews(const NewsItem& news) const
      +  {
      +    messageText = news.text();
      +    update();
      +  }
      +};
      +
      +// ...
      +NewsMessageArea newsMessageArea = new NewsMessageArea(/* ... */);
      +// ...
      +deliverNews.connect(boost::bind(&NewsMessageArea::displayNews, 
      +                                newsMessageArea, _1));
      +

      However, what if the user closes the news message area, +destroying the newsMessageArea object that +deliverNews knows about? Most likely, a segmentation +fault will occur. However, with Boost.Signals one need only make +NewsMessageAreatrackable, and the slot +involving newsMessageArea will be disconnected when +newsMessageArea is destroyed. The +NewsMessageArea class is made trackable by deriving +publicly from the boost::signals::trackable class, +e.g.:

      +struct NewsMessageArea : public MessageArea, public boost::signals::trackable
      +{
      +  // ...
      +};
      +

      At this time there is a significant limitation to the use of +trackable objects in making slot connections: function +objects built using Boost.Bind are understood, such that pointers +or references to trackable objects passed to +boost::bind will be found and tracked.

      Warning: User-defined function objects and function +objects from other libraries (e.g., Boost.Function or Boost.Lambda) +do not implement the required interfaces for trackable +object detection, and will silently ignore any bound trackable +objects. Future versions of the Boost libraries will address +this limitation.

      When can disconnections occur? (Intermediate)

      Signal/slot disconnections occur when any of these conditions +occur:

      • The connection is explicitly disconnected via the connection's +disconnect method directly, or indirectly via the +signal's disconnect method or +scoped_connection's destructor.

      • A trackable object bound to the slot is +destroyed.

      • The signal is destroyed.

      These events can occur at any time without disrupting a signal's +calling sequence. If a signal/slot connection is disconnected at +any time during a signal's calling sequence, the calling sequence +will still continue but will not invoke the disconnected slot. +Additionally, a signal may be destroyed while it is in a calling +sequence, and which case it will complete its slot call sequence +but may not be accessed directly.

      Signals may be invoked recursively (e.g., a signal A calls a +slot B that invokes signal A...). The disconnection behavior does +not change in the recursive case, except that the slot calling +sequence includes slot calls for all nested invocations of the +signal.

      Passing slots (Intermediate)

      Slots in the Boost.Signals library are created from arbitrary +function objects, and therefore have no fixed type. However, it is +commonplace to require that slots be passed through interfaces that +cannot be templates. Slots can be passed via the +slot_type for each particular signal type and any +function object compatible with the signature of the signal can be +passed to a slot_type parameter. For instance:

      Preferred syntaxPortable syntax
      +class Button 
      +{
      +  typedef boost::signal<void (int x, int y)> OnClick;
      +
      +public:
      +  void doOnClick(const OnClick::slot_type& slot);
      +
      +private:
      +  OnClick onClick;
      +};
      +
      +void Button::doOnClick(const OnClick::slot_type& slot)
      +{
      +  onClick.connect(slot);
      +}
      +
      +void printCoordinates(long x, long y)
      +{
      +  std::cout << "(" << x << ", " << y << ")\n";
      +}
      +
      +void f(Button& button)
      +{
      +  button.doOnClick(&printCoordinates);
      +}
      +
      +class Button 
      +{
      +  typedef boost::signal2<void, int x, int y> OnClick;
      +
      +public:
      +  void doOnClick(const OnClick::slot_type& slot);
      +
      +private:
      +  OnClick onClick;
      +};
      +
      +void Button::doOnClick(const OnClick::slot_type& slot)
      +{
      +  onClick.connect(slot);
      +}
      +
      +void printCoordinates(long x, long y)
      +{
      +  std::cout << "(" << x << ", " << y << ")\n";
      +}
      +
      +void f(Button& button)
      +{
      +  button.doOnClick(&printCoordinates);
      +}
      +

      The doOnClick method is now functionally equivalent +to the connect method of the onClick +signal, but the details of the doOnClick method can be +hidden in an implementation detail file.

      Linking against the Signals library

      Part of the Boost.Signals library is compiled into a binary + library that must be linked into your application to use Signals. To + build this library, execute the command bjam in + either the top-level Boost directory or in + libs/signals/build. On Unix, the directory + libs/signals/build/bin-stage will then contain + libraries named, e.g., libboost_signals.a that can be + linked in your program with -lboost_signals.

      On Windows, with Microsoft Visual C++ or Borland C++, the + linking process is nearly automatic. As with the + Regex library, the libraries in + libs\signals\build\bin-stage will have mangled names + and will be automatically be including in the link process. To link + against the Signals library binary dynamically (e.g., using the + Signals DLL), define BOOST_SIGNALS_DYN_LINK when + building your application; to link statically, define + BOOST_SIGNALS_STATIC_LINK.

      Last revised: December 19, 2003 at 03:32:09 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/ch06s04.html b/doc/html/ch06s04.html new file mode 100644 index 0000000000..2d367a137e --- /dev/null +++ b/doc/html/ch06s04.html @@ -0,0 +1,97 @@ +Frequently Asked Questions
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Frequently Asked Questions

      1.

      Don't noncopyable signal semantics mean that a class + with a signal member will be noncopyable as well?

      No. The compiler will not be able to generate a copy + constructor or copy assignment operator for your class if it + has a signal as a member, but you are free to write your own + copy constructor and/or copy assignment operator. Just don't + try to copy the signal.

      2.

      Is Boost.Signals thread-safe?

      No. Using Boost.Signals in a multithreaded concept is + very dangerous, and it is very likely that the results will be + less than satisfying. Boost.Signals will support thread safety + in the future.

      3.

      How do I get Boost.Signals to work with Qt?

      When building with Qt, the Moc keywords + signals and slots are defined using + preprocessor macros, causing programs using Boost.Signals and + Qt together to fail to compile. Although this is a problem + with Qt and not Boost.Signals, a user can use the two systems + together by defining the BOOST_SIGNALS_NAMESPACE + macro to some other identifier (e.g., signalslib) + when building and using the Boost.Signals library. Then the + namespace of the Boost.Signals library will be + boost::BOOST_SIGNALS_NAMESPACE instead of + boost::signals. To retain the original namespace + name in translation units that do not interact with Qt, you + can use a namespace alias:

      +  namespace boost {
      +    namespace signals = BOOST_SIGNALS_NAMESPACE;
      +  }
      +
      Last revised: March 12, 2003 at 23:27:23 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/ch06s05.html b/doc/html/ch06s05.html new file mode 100644 index 0000000000..60b4d176c6 --- /dev/null +++ b/doc/html/ch06s05.html @@ -0,0 +1,173 @@ +Design Overview
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Design Overview

      Type Erasure

      "Type erasure", where static type information is eliminated + by the use of dynamically dispatched interfaces, is used + extensively within the Boost.Signals library to reduce the amount + of code generated by template instantiation. Each signal must + manage a list of slots and their associated connections, along + with a std::map to map from group identifiers to + their associated connections. However, instantiating this map for + every token type, and perhaps within each translation unit (for + some popular template instantiation strategies) increase compile + time overhead and space overhead.

      To combat this so-called "template bloat", we use + Boost.Function and Boost.Any to store unknown types and + operations. Then, all of the code for handling the list of slots + and the mapping from slot identifiers to connections is factored + into the class signal_base + that deals exclusively with the any and + function objects, hiding the + actual implementations using the well-known pimpl idiom. The + actual signalN class templates + deal only with code that will change depending on the number of + arguments or which is inherently template-dependent (such as + connection).

      connection class

      The connection class is + central to the behavior of the Boost.Signals library. It is the + only entity within the Boost.Signals system that has knowledge of + all objects that are associated by a given connection. To be + specific, the connection class + itself is merely a thin wrapper over a + shared_ptr to a + basic_connection object.

      connection objects are + stored by all participants in the Signals system: each + trackable object contains a + list of connection objects + describing all connections it is a part of; similarly, all signals + contain a set of pairs that define a slot. The pairs consist of a + slot function object (generally a Boost.Function object) and a + connection object (that will + disconnect on destruction). Finally, the mapping from slot groups + to slots is based on the key value in a + std::multimap (the stored data + in the std::multimap is the + slot pair).

      Slot Call Iterator

      The slot call iterator is conceptually a stack of iterator + adaptors that modify the behavior of the underlying iterator + through the list of slots. The following table describes the type + and behavior of each iterator adaptor required. Note that this is + only a conceptual model: the implementation collapses all these + layers into a single iterator adaptor because several popular + compilers failed to compile the implementation of the conceptual + model.

      Iterator AdaptorPurpose

      Slot List Iterator

      An iterator through the list of slots + connected to a signal. The value_type of this + iterator will be + std::pair<any, + connection>, where the + any contains an + instance of the slot function type.

      Filter Iterator Adaptor

      This filtering iterator adaptor filters out + slots that have been disconnected, so we never see a + disconnected slot in later stages.

      Projection Iterator Adaptor

      The projection iterator adaptor returns a + reference to the first member of the pair that constitutes + a connected slot (e.g., just the + boost::any object that + holds the slot function).

      Transform Iterator Adaptor

      This transform iterator adaptor performs an + any_cast to + extract a reference to the slot function with the + appropriate slot function type.

      Transform Iterator Adaptor

      This transform iterator adaptor calls the + function object returned by dereferencing the underlying + iterator with the set of arguments given to the signal + itself, and returns the result of that slot + call.

      Input Caching Iterator Adaptor

      This iterator adaptor caches the result of + dereferencing the underlying iterator. Therefore, + dereferencing this iterator multiple times will only + result in the underlying iterator being dereferenced once; + thus, a slot can only be called once but its result can be + used multiple times.

      Slot Call Iterator

      Iterates over calls to each slot.

      visit_each function template

      The visit_each + function template is a mechanism for discovering objects that are + stored within another object. Function template + visit_each takes three + arguments: an object to explore, a visitor function object that is + invoked with each subobject, and the int 0.

      The third parameter is merely a temporary solution to the + widespread lack of proper function template partial ordering. The + primary visit_each + function template specifies this third parameter type to be + long, whereas any user specializations must specify + their third parameter to be of type int. Thus, even + though a broken compiler cannot tell the ordering between, e.g., a + match against a parameter T and a parameter + A<T>, it can determine that the conversion from + the integer 0 to int is better than the conversion to + long. The ordering determined by this conversion thus + achieves partial ordering of the function templates in a limited, + but successful, way. The following example illustrates the use of + this technique:

      +template<typename> class A {};
      +template<typename T> void foo(T, long);
      +template<typename T> void foo(A<T>, int);
      +A<T> at;
      +foo(at, 0);
      +

      In this example, we assume that our compiler can not tell + that A<T> is a better match than + T, and therefore assume that the function templates + cannot be ordered based on that parameter. Then the conversion + from 0 to int is better than the conversion from 0 to + long, and the second function template is + chosen.

      Last revised: March 12, 2003 at 23:27:22 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/ch06s06.html b/doc/html/ch06s06.html new file mode 100644 index 0000000000..b5bfb1c45d --- /dev/null +++ b/doc/html/ch06s06.html @@ -0,0 +1,340 @@ +Design Rationale
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Design Rationale

      Choice of Slot Definitions

      The definition of a slot differs amongst signals and slots + libraries. Within Boost.Signals, a slot is defined in a very loose + manner: it can be any function object that is callable given + parameters of the types specified by the signal, and whose return + value is convertible to the result type expected by the + signal. However, alternative definitions have associated pros and + cons that were considered prior to the construction of + Boost.Signals.

      • Slots derive from a specific base + class: generally a scheme such as this will require + all user-defined slots to derive from some library-specified + Slot abstract class that defines a virtual + function calling the slot. Adaptors can be used to convert a + definition such as this to a definition similar to that used + by Boost.Signals, but the use of a large number of small + adaptor classes containing virtual functions has been found to + cause an unacceptable increase in the size of executables + (polymorphic class types require more code than + non-polymorphic types).

        This approach does have the benefit of simplicity of + implementation and user interface, from an object-oriented + perspective.

      • Slots constructed from a set of + primitives: in this scheme the slot can have a + limited set of types (often derived from a common abstract + base class) that are constructed from some library-defined set + of primitives that often include conversions from free + function pointers and member function pointers, and a limited + set of binding capabilities. Such an approach is reasonably + simple and cover most common cases, but it does not allow a + large degree of flexibility in slot construction. Libraries + for function object composition have become quite advanced and + it is out of the scope of a signals and slots library to + encorporate such enhancements. Thus Boost.Signals does not + include argument binding or function object composition + primitives, but instead provides a hook (via the + visit_each + mechanism) that allows existing binder/composition libraries + to provide the necessary information to Signals.

      Users not satisfied with the slot definition choice may opt + to replace the default slot function type with an alternative that + meets their specific needs.

      User-level Connection Management

      Users need to have fine control over the connection of + signals to slots and their eventual disconnection. The approach + taken by Boost.Signals is to return a + connection object that enables + connected/disconnected query, manual disconnection, and an + automatic disconnection on destruction mode. Some other possible + interfaces include:

      • Pass slot to + disconnect: in this interface model, the + disconnection of a slot connected with + sig.connect(slot) is + performed via + sig.disconnect(slot). Internally, + a linear search using slot comparison is performed and the + slot, if found, is removed from the list. Unfortunately, + querying connectedness will generally also end up as + linear-time operations. This model also fails for + implementation reasons when slots become more complex than + simple function pointers, member function pointers and a + limited set of compositions and argument binders: to match the + slot given in the call to + disconnect with an + existing slot we would need to be able to compare arbitrary + function objects, which is not feasible.

      • Pass a token to + disconnect: this approach identifies slots with a + token that is easily comparable (e.g., a string), enabling + slots to be arbitrary function objects. While this approach is + essentially equivalent to the approach taken by Boost.Signals, + it is possibly more error-prone for several reasons:

        • Connections and disconnections must be paired, so + the problem becomes similar to the problems incurred when + pairing new and delete for + dynamic memory allocation. While errors of this sort would + not be catastrophic for a signals and slots + implementation, their detection is generally + nontrivial.

        • Tokens must be unique, otherwise two slots will have + the same name and will be indistinguishable. In + environments where many connections will be made + dynamically, name generation becomes an additional task + for the user. Uniqueness of tokens also results in an + additional failure mode when attempting to connect a slot + using a token that has already been used.

        • More parameterization would be required, because the + token type must be user-defined. Additional + parameterization steepens the learning curver and + overcomplicates a simple interface.

        This type of interface is supported in Boost.Signals + via the slot grouping mechanism. It augments the + connection object-based + connection management scheme.

      Combiner Interface

      The Combiner interface was chosen to mimic a call to an + algorithm in the C++ standard library. It is felt that by viewing + slot call results as merely a sequence of values accessed by input + iterators, the combiner interface would be most natural to a + proficient C++ programmer. Competing interface design generally + required the combiners to be constructed to conform to an + interface that would be customized for (and limited to) the + Signals library. While these interfaces are generally enable more + straighforward implementation of the signals & slots + libraries, the combiners are unfortunately not reusable (either in + other signals & slots libraries or within other generic + algorithms), and the learning curve is steepened slightly to learn + the specific combiner interface.

      The Signals formulation of combiners is based on the + combiner using the "pull" mode of communication, instead of the + more complex "push" mechanism. With a "pull" mechanism, the + combiner's state can be kept on the stack and in the program + counter, because whenever new data is required (i.e., calling the + next slot to retrieve its return value), there is a simple + interface to retrieve that data immediately and without returning + from the combiner's code. Contrast this with the "push" mechanism, + where the combiner must keep all state in class members because + the combiner's routines will be invoked for each signal + called. Compare, for example, a combiner that returns the maximum + element from calling the slots. If the maximum element ever + exceeds 100, no more slots are to be called.

      Pull

      Push

      +struct pull_max {
      +  typedef int result_type;
      +
      +  template<typename InputIterator>
      +  result_type operator()(InputIterator first,
      +                         InputIterator last)
      +  {
      +    if (first == last)
      +      throw std::runtime_error("Empty!");
      +
      +    int max_value = *first++;
      +    while(first != last && *first <= 100) {
      +      if (*first > max_value)
      +        max_value = *first;
      +      ++first;
      +    }
      +
      +    return max_value;
      +  }
      +};
      +
      +struct push_max {
      +  typedef int result_type;
      +
      +  push_max() : max_value(), got_first(false) {}
      +
      +  // returns false when we want to stop
      +  bool operator()(int result) {
      +    if (result > 100)
      +      return false;
      +
      +    if (!got_first) {
      +      got_first = true;
      +      max_value = result;
      +      return true;
      +    }
      +
      +    if (result > max_value)
      +      max_value = result;
      +
      +    return true;
      +  }
      +
      +  int get_value() const 
      +  { 
      +    if (!got_first)
      +      throw std::runtime_error("Empty!");
      +    return max_value; 
      +  }
      +
      +private:
      +  int  max_value; 
      +  bool got_first;
      +};
      +

      There are several points to note in these examples. The + "pull" version is a reusable function object that is based on an + input iterator sequence with an integer value_type, + and is very straightforward in design. The "push" model, on the + other hand, relies on an interface specific to the caller and is + not generally reusable. It also requires extra state values to + determine, for instance, if any elements have been + received. Though code quality and ease-of-use is generally + subjective, the "pull" model is clearly shorter and more reusable + and will often be construed as easier to write and understand, + even outside the context of a signals & slots library.

      The cost of the "pull" combiner interface is paid in the + implementation of the Signals library itself. To correctly handle + slot disconnections during calls (e.g., when the dereference + operator is invoked), one must construct the iterator to skip over + disconnected slots. Additionally, the iterator must carry with it + the set of arguments to pass to each slot (although a reference to + a structure containing those arguments suffices), and must cache + the result of calling the slot so that multiple dereferences don't + result in multiple calls. This apparently requires a large degree + of overhead, though if one considers the entire process of + invoking slots one sees that the overhead is nearly equivalent to + that in the "push" model, but we have inverted the control + structures to make iteration and dereference complex (instead of + making combiner state-finding complex).

      Connection Interfaces: += operator

      Boost.Signals supports a connection syntax with the form + sig.connect(slot), but a + more terse syntax sig += slot has been suggested (and + has been used by other signals & slots implementations). There + are several reasons as to why this syntax has been + rejected:

      • It's unnecessary: the + connection syntax supplied by Boost.Signals is no less + powerful that that supplied by the += + operator. The savings in typing (connect() + vs. +=) is essentially negligible. Furthermore, + one could argue that calling connect() is more + readable than an overload of +=.

      • Ambiguous return type: + there is an ambiguity concerning the return value of the + += operation: should it be a reference to the + signal itself, to enable sig += slot1 += slot2, + or should it return a + connection for the + newly-created signal/slot connection?

      • Gateway to operators -=, + +: when one has added a connection operator + +=, it seems natural to have a disconnection + operator -=. However, this presents problems when + the library allows arbitrary function objects to implicitly + become slots, because slots are no longer comparable.

        The second obvious addition when one has + operator+= would be to add a + + operator that supports addition of multiple slots, followed by + assignment to a signal. However, this would require + implementing + such that it can accept any two + function objects, which is technically infeasible.

      trackable rationale

      The trackable + class is the primary user interface to automatic connection + lifetime management, and its design affects users directly. Two + issues stick out most: the odd copying behavior of + trackable, and the limitation requiring users to + derive from trackable to create types that can + participate in automatic connection management.

      trackable copying behavior

      The copying behavior of + trackable is essentially + that trackable subobjects + are never copied; instead, the copy operation is merely a + no-op. To understand this, we look at the nature of a + signal-slot connection and note that the connection is based on + the entities that are being connected; when one of the entities + is destroyed, the connection is destroyed. Therefore, when a + trackable subobject is + copied, we cannot copy the connections because the connections + don't refer to the target entity - they refer to the source + entity. This reason is dual to the reason signals are + noncopyable: the slots connected to them are connected to that + particular signal, not the data contained in the signal.

      Why derivation from trackable?

      For trackable to work + properly, there are two constraints:

      • trackable must + have storage space to keep track of all connections made to + this object.

      • trackable must be + notified when the object is being destructed so that it can + disconnect its connections.

      Clearly, deriving from + trackable meets these two + guidelines. We have not yet found a superior solution.

      Comparison with other Signal/Slot implementations

      libsigc++

      libsigc++ is a C++ + signals & slots library that originally started as part of + an initiative to wrap the C interfaces to GTK libraries in C++, and has + grown to be a separate library maintained by Karl Nelson. There + are many similarities between libsigc++ and Boost.Signals, and + indeed Boost.Signals was strongly influenced by Karl Nelson and + libsigc++. A cursory inspection of each library will find a + similar syntax for the construction of signals and in the use of + connections and automatic connection lifetime management. There + are some major differences in design that separate these + libraries:

      • Slot definitions: + slots in libsigc++ are created using a set of primitives + defined by the library. These primitives allow binding of + objects (as part of the library), explicit adaptation from + the argument and return types of the signal to the argument + and return types of the slot (libsigc++ is, by default, more + strict about types than Boost.Signals). A discussion of this + approach with a comparison against the approach taken by + Boost.Signals is given in Choice of Slot Definitions.

      • Combiner/Marshaller + interface: the equivalent to Boost.Signals + combiners in libsigc++ are the marshallers. Marshallers are + similar to the "push" interface described in Combiner + Interface, and a proper treatment of the topic is given + there.

      .NET delegates

      Microsoft + has introduced the .NET Framework and an associated set of + languages and language extensions, one of which is the + delgate. Delegates are similar to signals and slots, but they + are more limited than most C++ signals and slots implemetations + in that they:

      • Require exact type matches between a delegate and what + it is calling.

      • Do not allow return types.

      • Must call a method with this already + bound.

      Last revised: March 12, 2003 at 23:27:23 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.any.html b/doc/html/class.boost.any.html new file mode 100644 index 0000000000..f71ecd9f68 --- /dev/null +++ b/doc/html/class.boost.any.html @@ -0,0 +1,161 @@ +Class any
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class any

      boost::any — A class whose instances can hold instances of any + type that satisfies ValueType + requirements.

      Synopsis

      +class any {
      +public:
      +  // construct/copy/destruct
      +  any();
      +  any(const any &);
      +  template<typename ValueType> any(const ValueType &);
      +  any & operator=(const any &);
      +  template<typename ValueType> any & operator=(const ValueType &);
      +  ~any();
      +
      +  // modifiers
      +  any & swap(any &);
      +
      +  // queries
      +  bool empty() const;
      +  const std::type_info & type() const;
      +};

      Description

      any construct/copy/destruct

      1. any();

        Postconditions: + + this->empty()

      2. any(const any & other);

        Effects: + + Copy constructor that copies content of + other into new instance, so that any content + is equivalent in both type and value to the content of + other, or empty if other is + empty.
        Throws: + + May fail with a + std::bad_alloc + exception or any exceptions arising from the copy + constructor of the contained type.

      3. template<typename ValueType> any(const ValueType & value);

        Effects: + + Makes a copy of value, so + that the initial content of the new instance is equivalent + in both type and value to + value.
        Throws: + + std::bad_alloc + or any exceptions arising from the copy constructor of the + contained type.

      4. any & operator=(const any & rhs);

        Effects: + + Copies content of rhs into + current instance, discarding previous content, so that the + new content is equivalent in both type and value to the + content of rhs, or empty if + rhs.empty().
        Throws: + + std::bad_alloc + or any exceptions arising from the copy constructor of the + contained type. Assignment satisfies the strong guarantee + of exception safety.

      5. template<typename ValueType> any & operator=(const ValueType & rhs);

        Effects: + + Makes a copy of rhs, + discarding previous content, so that the new content of is + equivalent in both type and value to + rhs.
        Throws: + + std::bad_alloc + or any exceptions arising from the copy constructor of the + contained type. Assignment satisfies the strong guarantee + of exception safety.

      6. ~any();

        Effects: + + Releases any and all resources used in + management of instance.
        Throws: + + Nothing.

      any modifiers

      1. any & swap(any & rhs);

        Effects: + + Exchange of the contents of + *this and + rhs.
        Returns: + + *this
        Throws: + + Nothing.

      any queries

      1. bool empty() const;

        Returns: + + true if instance is + empty, otherwise false.
        Throws: + + Will not throw.

      2. const std::type_info & type() const;

        Returns: + + the typeid of the + contained value if instance is non-empty, otherwise + typeid(void).
        Notes: + + Useful for querying against types known + either at compile time or only at + runtime.

      Last revised: , at GMTCopyright © 2001 Kevlin Henney
      diff --git a/doc/html/class.boost.apply_visitor_delayed_t.html b/doc/html/class.boost.apply_visitor_delayed_t.html new file mode 100644 index 0000000000..2d4ab690f1 --- /dev/null +++ b/doc/html/class.boost.apply_visitor_delayed_t.html @@ -0,0 +1,99 @@ +Class template apply_visitor_delayed_t
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template apply_visitor_delayed_t

      boost::apply_visitor_delayed_t — Adapts a visitor for use as a function object.

      Synopsis

      template<typename Visitor> 
      +class apply_visitor_delayed_t {
      +public:
      +  // types
      +  typedef typename Visitor::result_type result_type;
      +
      +  // construct/copy/destruct
      +  explicit apply_visitor_delayed_t(Visitor &);
      +
      +  // function object interface
      +  template<typename Variant> result_type operator()(Variant &);
      +  template<typename Variant1, typename Variant2> 
      +    result_type operator()(Variant1 &, Variant2 &);
      +};

      Description

      Adapts the function given at construction for use as a + function object. This is useful, for example, when one needs to + operate on each element of a sequence of variant objects using a + standard library algorithm such as + std::for_each.

      See the "visitor-only" form of + apply_visitor for a simple + way to create apply_visitor_delayed_t objects.

      apply_visitor_delayed_t construct/copy/destruct

      1. explicit apply_visitor_delayed_t(Visitor & visitor);

        Effects: + + Constructs the function object with the given + visitor.

      apply_visitor_delayed_t function object interface

      1. template<typename Variant> result_type operator()(Variant & operand);
        +template<typename Variant1, typename Variant2> 
        +  result_type operator()(Variant1 & operand1, Variant2 & operand2);

        Invokes + apply_visitor on the + stored visitor using the given operands.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.array.html b/doc/html/class.boost.array.html new file mode 100644 index 0000000000..6a7a1d3435 --- /dev/null +++ b/doc/html/class.boost.array.html @@ -0,0 +1,229 @@ +Class template array
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template array

      boost::array — STL compliant container wrapper for arrays of constant size

      Synopsis

      template<typename T, std::size_t N> 
      +class array {
      +public:
      +  // types
      +  typedef T                                     value_type;            
      +  typedef T*                                    iterator;              
      +  typedef const T*                              const_iterator;        
      +  typedef std::reverse_iterator<iterator>       reverse_iterator;      
      +  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
      +  typedef T&                                    reference;             
      +  typedef const T&                              const_reference;       
      +  typedef std::size_t                           size_type;             
      +  typedef std::ptrdiff_t                        difference_type;       
      +
      +  // static constants
      +  static const size_type static_size = N;
      +
      +  // construct/copy/destruct
      +  template<typename U> array& operator=(const array<U, N>&);
      +
      +  // iterator support
      +  iterator begin();
      +  const_iterator begin() const;
      +  iterator end();
      +  const_iterator end() const;
      +
      +  // reverse iterator support
      +  reverse_iterator rbegin();
      +  const_reverse_iterator rbegin() const;
      +  reverse_iterator rend();
      +  const_reverse_iterator rend() const;
      +
      +  // capacity
      +  size_type size();
      +  bool empty();
      +  size_type max_size();
      +
      +  // element access
      +  reference operator[](size_type);
      +  const_reference operator[](size_type) const;
      +  reference at(size_type);
      +  const_reference at(size_type) const;
      +  reference front();
      +  const_reference front() const;
      +  reference back();
      +  const_reference back() const;
      +  const T* data() const;
      +
      +  // modifiers
      +  void swap(array<T, N>&);
      +  void assign(const T&);
      +
      +  T elems[N];
      +};
      +
      +// specialized algorithms
      +template<typename T, std::size_t N> void swap(array<T, N>&, array<T, N>&);
      +
      +// comparisons
      +template<typename T, std::size_t N> 
      +  bool operator==(const array<T, N>&, const array<T, N>&);
      +template<typename T, std::size_t N> 
      +  bool operator!=(const array<T, N>&, const array<T, N>&);
      +template<typename T, std::size_t N> 
      +  bool operator<(const array<T, N>&, const array<T, N>&);
      +template<typename T, std::size_t N> 
      +  bool operator>(const array<T, N>&, const array<T, N>&);
      +template<typename T, std::size_t N> 
      +  bool operator<=(const array<T, N>&, const array<T, N>&);
      +template<typename T, std::size_t N> 
      +  bool operator>=(const array<T, N>&, const array<T, N>&);

      Description

      array construct/copy/destruct

      1. template<typename U> array& operator=(const array<U, N>& other);

        Effects: + + std::copy(rhs.begin(),rhs.end(), begin())

      array iterator support

      1. iterator begin();
        +const_iterator begin() const;

        Returns: + + iterator for the first element
        Throws: + + will not throw

      2. iterator end();
        +const_iterator end() const;

        Returns: + + iterator for position after the last element
        Throws: + + will not throw

      array reverse iterator support

      1. reverse_iterator rbegin();
        +const_reverse_iterator rbegin() const;

        Returns: + + reverse iterator for the first element of reverse iteration

      2. reverse_iterator rend();
        +const_reverse_iterator rend() const;

        Returns: + + reverse iterator for position after the last element in reverse iteration

      array capacity

      1. size_type size();

        Returns: + + N

      2. bool empty();

        Returns: + + N==0
        Throws: + + will not throw

      3. size_type max_size();

        Returns: + + N
        Throws: + + will not throw

      array element access

      1. reference operator[](size_type i);
        +const_reference operator[](size_type i) const;

        Requires: + + i < N
        Returns: + + element with index i
        Throws: + + will not throw.

      2. reference at(size_type i);
        +const_reference at(size_type i) const;

        Returns: + + element with index i
        Throws: + + std::range_error if i >= N

      3. reference front();
        +const_reference front() const;

        Requires: + + N > 0
        Returns: + + the first element
        Throws: + + will not throw

      4. reference back();
        +const_reference back() const;

        Requires: + + N > 0
        Returns: + + the last element
        Throws: + + will not throw

      5. const T* data() const;

        Returns: + + elems
        Throws: + + will not throw

      array modifiers

      1. void swap(array<T, N>& other);

        Effects: + + std::swap_ranges(begin(), end(), other.begin())
        Complexity: + + linear in N

      2. void assign(const T& value);

        Effects: + + std::fill_n(begin(), N, value)

      array specialized algorithms

      1. template<typename T, std::size_t N> void swap(array<T, N>& x, array<T, N>& y);

        Effects: + + x.swap(y)
        Throws: + + will not throw.

      array comparisons

      1. template<typename T, std::size_t N> 
        +  bool operator==(const array<T, N>& x, const array<T, N>& y);

        Returns: + + std::equal(x.begin(), x.end(), y.begin())

      2. template<typename T, std::size_t N> 
        +  bool operator!=(const array<T, N>& x, const array<T, N>& y);

        Returns: + + !(x == y)

      3. template<typename T, std::size_t N> 
        +  bool operator<(const array<T, N>& x, const array<T, N>& y);

        Returns: + + std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end())

      4. template<typename T, std::size_t N> 
        +  bool operator>(const array<T, N>& x, const array<T, N>& y);

        Returns: + + y < x

      5. template<typename T, std::size_t N> 
        +  bool operator<=(const array<T, N>& x, const array<T, N>& y);

        Returns: + + !(y < x)

      6. template<typename T, std::size_t N> 
        +  bool operator>=(const array<T, N>& x, const array<T, N>& y);

        Returns: + + !(x < y)

      Last revised: , at GMTCopyright © 2001 Nicolai M. Josuttis
      diff --git a/doc/html/class.boost.bad_any_cast.html b/doc/html/class.boost.bad_any_cast.html new file mode 100644 index 0000000000..bce8d75929 --- /dev/null +++ b/doc/html/class.boost.bad_any_cast.html @@ -0,0 +1,79 @@ +Class bad_any_cast
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class bad_any_cast

      boost::bad_any_cast — The exception thrown in the event of a failed + any_cast of an + any value.

      Synopsis

      +class bad_any_cast : public std::bad_cast {
      +public:
      +  virtual const char * what() const;
      +};

      Description

      virtual const char * what() const;
      Last revised: , at GMTCopyright © 2001 Kevlin Henney
      diff --git a/doc/html/class.boost.bad_function_call.html b/doc/html/class.boost.bad_function_call.html new file mode 100644 index 0000000000..8b4d1335f2 --- /dev/null +++ b/doc/html/class.boost.bad_function_call.html @@ -0,0 +1,80 @@ +Class bad_function_call
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class bad_function_call

      boost::bad_function_call — An exception type thrown when an instance of a function object is empty when invoked.

      Synopsis

      +class bad_function_call : public std::runtime_error {
      +public:
      +  // construct/copy/destruct
      +  bad_function_call();
      +};

      Description

      bad_function_call construct/copy/destruct

      1. bad_function_call();

        Effects: + + Constructs a bad_function_call exception object.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.bad_get.html b/doc/html/class.boost.bad_get.html new file mode 100644 index 0000000000..010f04c018 --- /dev/null +++ b/doc/html/class.boost.bad_get.html @@ -0,0 +1,79 @@ +Class bad_get
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class bad_get

      boost::bad_get — The exception thrown in the event of a failed application of + boost::get on the given + operand value.

      Synopsis

      +class bad_get : public std::exception {
      +public:
      +  virtual const	char * what() const;
      +};

      Description

      virtual const	char * what() const;
      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.bad_visit.html b/doc/html/class.boost.bad_visit.html new file mode 100644 index 0000000000..3606a92323 --- /dev/null +++ b/doc/html/class.boost.bad_visit.html @@ -0,0 +1,78 @@ +Class bad_visit
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class bad_visit

      boost::bad_visit — The exception thrown in the event of a visitor + unable to handle the visited value.

      Synopsis

      +class bad_visit : public std::exception {
      +public:
      +  virtual const char * what() const;
      +};

      Description

      virtual const char * what() const;
      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.function.html b/doc/html/class.boost.function.html new file mode 100644 index 0000000000..728e372c6f --- /dev/null +++ b/doc/html/class.boost.function.html @@ -0,0 +1,217 @@ +Class template function
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template function

      boost::function — A generalized function pointer that can be used for + callbacks or wrapping function objects.

      Synopsis

      template<typename Signature,   // Function type R (T1, T2, ..., TN)
      +         typename Allocator = std::allocator<void> > 
      +class function : public functionN<R, T1, T2, ..., TN, Allocator> {
      +public:
      +  // types
      +  typedef R         result_type;         
      +  typedef Allocator allocator_type;      
      +  typedef T1        argument_type;         // If N == 1
      +  typedef T1        first_argument_type;   // If N == 2
      +  typedef T2        second_argument_type;  // If N == 2
      +  typedef T1        arg1_type;           
      +  typedef T2        arg2_type;           
      +     .
      +     .
      +     .
      +  typedef TN        argN_type;           
      +
      +  // static constants
      +  static const int arity = N;
      +
      +  // Lambda library support
      +  template<typename Args> 
      +  struct sig {
      +    // types
      +    typedef result_type type;
      +  };
      +
      +  // construct/copy/destruct
      +  function();
      +  function(const functionN&);
      +  function(const function&);
      +  template<typename F> function(F);
      +  function& operator=(const functionN&);
      +  function& operator=(const function&);
      +  ~function();
      +
      +  // modifiers
      +  void swap(const function&);
      +  void clear();
      +
      +  // capacity
      +  bool empty() const;
      +  operator safe_bool() const;
      +  bool operator!() const;
      +
      +  // invocation
      +  result_type operator()(arg1_type, arg2_type, ..., argN_type) const;
      +};
      +
      +// specialized algorithms
      +template<typename Signature, typename Allocator> 
      +  void swap(function<Signature, Allocator>&, function<Signature, Allocator>&);
      +
      +// undefined operators
      +template<typename Signature1, typename Allocator1, typename Signature2, 
      +         typename Allocator2> 
      +  void operator==(const function<Signature1, Allocator1>&, 
      +                  const function<Signature2, Allocator2>&);
      +template<typename Signature1, typename Allocator1, typename Signature2, 
      +         typename Allocator2> 
      +  void operator!=(const function<Signature1, Allocator1>&, 
      +                  const function<Signature2, Allocator2>&);

      Description

      Class template function is a thin + wrapper around the numbered class templates function0, function1, etc. It accepts a + function type with N arguments and will will derive from + functionN instantiated with the arguments + it receives.

      The semantics of all operations in class template + function are equivalent to that of the + underlying functionN object, although + additional member functions are required to allow proper copy + construction and copy assignment of function objects.

      function construct/copy/destruct

      1. function();

        Postconditions: + + this->empty()
        Throws: + + Will not throw.

      2. function(const functionN& f);

        Postconditions: + + Contains a copy of the f's target, if it has one, or is empty if f.empty().
        Throws: + + Will not throw unless copying the target of f throws.

      3. function(const function& f);

        Postconditions: + + Contains a copy of the f's target, if it has one, or is empty if f.empty().
        Throws: + + Will not throw unless copying the target of f throws.

      4. template<typename F> function(F f);

        Requires: + + F is a function object Callable from this.
        Postconditions: + + *this targets a copy of f if f is nonempty, or this->empty() if f is empty.
        Throws: + + Will not throw when f is a stateless function object.

      5. function& operator=(const functionN& f);

        Postconditions: + + *this targets a copy of f's target, if it has one, or is empty if f.empty()
        Throws: + + Will not throw when the target of f is a stateless function object or a reference to the function object.

      6. function& operator=(const function& f);

        Postconditions: + + *this targets a copy of f's target, if it has one, or is empty if f.empty()
        Throws: + + Will not throw when the target of f is a stateless function object or a reference to the function object.

      7. ~function();

        Effects: + + If !this->empty(), destroys the target of this.

      function modifiers

      1. void swap(const function& f);

        Effects: + + Interchanges the targets of *this and f.
        Throws: + + Will not throw.

      2. void clear();

        Postconditions: + + this->empty()
        Throws: + + Will not throw.

      function capacity

      1. bool empty() const;

        Returns: + + true if this has a target, and false otherwise.
        Throws: + + Will not throw.

      2. operator safe_bool() const;

        Returns: + + A safe_bool that evaluates false in a boolean context when this->empty(), and true otherwise.
        Throws: + + Will not throw.

      3. bool operator!() const;

        Returns: + + this->empty()
        Throws: + + Will not throw.

      function invocation

      1. result_type operator()(arg1_type a1, arg2_type a2, ... , argN_type aN) const;

        Effects: + + f(a1, a2, ..., aN), where f is the target of *this.
        Returns: + + if R is void, nothing is returned; otherwise, the return value of the call to f is returned.
        Throws: + + bad_function_call if !this->empty(). Otherwise, may through any exception thrown by the target function f.

      function specialized algorithms

      1. template<typename Signature, typename Allocator> 
        +  void swap(function<Signature, Allocator>& f1, 
        +            function<Signature, Allocator>& f2);

        Effects: + + f1.swap(f2)
        Throws: + + Will not throw.

      function undefined operators

      1. template<typename Signature1, typename Allocator1, typename Signature2, 
        +         typename Allocator2> 
        +  void operator==(const function<Signature1, Allocator1>& f1, 
        +                  const function<Signature2, Allocator2>& f2);

        Notes: + + This function must be left undefined.
        Rationale: + + The safe_bool conversion opens a loophole whereby two function instances can be compared via ==. This undefined void operator == closes the loophole and ensures a compile-time or link-time error.

      2. template<typename Signature1, typename Allocator1, typename Signature2, 
        +         typename Allocator2> 
        +  void operator!=(const function<Signature1, Allocator1>& f1, 
        +                  const function<Signature2, Allocator2>& f2);

        Notes: + + This function must be left undefined.
        Rationale: + + The safe_bool conversion opens a loophole whereby two function instances can be compared via !=. This undefined void operator != closes the loophole and ensures a compile-time or link-time error.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.functionN.html b/doc/html/class.boost.functionN.html new file mode 100644 index 0000000000..f2251b0649 --- /dev/null +++ b/doc/html/class.boost.functionN.html @@ -0,0 +1,202 @@ +Class template functionN
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template functionN

      boost::functionN — A set of generalized function pointers that can be used for callbacks or wrapping function objects.

      Synopsis

      template<typename R, typename T1, typename T2, ..., typename TN, 
      +         typename Allocator = std::allocator<void> > 
      +class functionN : public function_base {
      +public:
      +  // types
      +  typedef R         result_type;         
      +  typedef Allocator allocator_type;      
      +  typedef T1        argument_type;         // If N == 1
      +  typedef T1        first_argument_type;   // If N == 2
      +  typedef T2        second_argument_type;  // If N == 2
      +  typedef T1        arg1_type;           
      +  typedef T2        arg2_type;           
      +     .
      +     .
      +     .
      +  typedef TN        argN_type;           
      +
      +  // static constants
      +  static const int arity = N;
      +
      +  // Lambda library support
      +  template<typename Args> 
      +  struct sig {
      +    // types
      +    typedef result_type type;
      +  };
      +
      +  // construct/copy/destruct
      +  functionN();
      +  functionN(const functionN&);
      +  template<typename F> functionN(F);
      +  functionN& operator=(const functionN&);
      +  ~functionN();
      +
      +  // modifiers
      +  void swap(const functionN&);
      +  void clear();
      +
      +  // capacity
      +  bool empty() const;
      +  operator safe_bool() const;
      +  bool operator!() const;
      +
      +  // invocation
      +  result_type operator()(arg1_type, arg2_type, ..., argN_type) const;
      +};
      +
      +// specialized algorithms
      +template<typename T1, typename T2, ..., typename TN, typename Allocator> 
      +  void swap(functionN<T1, T2, ..., TN, Allocator>&, 
      +            functionN<T1, T2, ..., TN, Allocator>&);
      +
      +// undefined operators
      +template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
      +         typename U1, typename U2, ..., typename UN, typename Allocator2> 
      +  void operator==(const functionN<T1, T2, ..., TN, Allocator1>&, 
      +                  const functionN<U1, U2, ..., UN, Allocator2>&);
      +template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
      +         typename U1, typename U2, ..., typename UN, typename Allocator2> 
      +  void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&, 
      +                  const functionN<U1, U2, ..., UN, Allocator2>&);

      Description

      Class template functionN is + actually a family of related classes function0, function1, etc., up to some + implementation-defined maximum. In this context, N + refers to the number of parameters.

      functionN construct/copy/destruct

      1. functionN();

        Postconditions: + + this->empty()
        Throws: + + Will not throw.

      2. functionN(const functionN& f);

        Postconditions: + + Contains a copy of the f's target, if it has one, or is empty if f.empty().
        Throws: + + Will not throw unless copying the target of f throws.

      3. template<typename F> functionN(F f);

        Requires: + + F is a function object Callable from this.
        Postconditions: + + *this targets a copy of f if f is nonempty, or this->empty() if f is empty.
        Throws: + + Will not throw when f is a stateless function object.

      4. functionN& operator=(const functionN& f);

        Postconditions: + + *this targets a copy of f's target, if it has one, or is empty if f.empty().
        Throws: + + Will not throw when the target of f is a stateless function object or a reference to the function object.

      5. ~functionN();

        Effects: + + If !this->empty(), destroys the target of this.

      functionN modifiers

      1. void swap(const functionN& f);

        Effects: + + Interchanges the targets of *this and f.
        Throws: + + Will not throw.

      2. void clear();

        Postconditions: + + this->empty()
        Throws: + + Will not throw.

      functionN capacity

      1. bool empty() const;

        Returns: + + true if this has a target, and false otherwise.
        Throws: + + Will not throw.

      2. operator safe_bool() const;

        Returns: + + A safe_bool that evaluates false in a boolean context when this->empty(), and true otherwise.
        Throws: + + Will not throw.

      3. bool operator!() const;

        Returns: + + this->empty()
        Throws: + + Will not throw.

      functionN invocation

      1. result_type operator()(arg1_type a1, arg2_type a2, ... , argN_type aN) const;

        Effects: + + f(a1, a2, ..., aN), where f is the target of *this.
        Returns: + + if R is void, nothing is returned; otherwise, the return value of the call to f is returned.
        Throws: + + bad_function_call if !this->empty(). Otherwise, may through any exception thrown by the target function f.

      functionN specialized algorithms

      1. template<typename T1, typename T2, ..., typename TN, typename Allocator> 
        +  void swap(functionN<T1, T2, ..., TN, Allocator>& f1, 
        +            functionN<T1, T2, ..., TN, Allocator>& f2);

        Effects: + + f1.swap(f2)
        Throws: + + Will not throw.

      functionN undefined operators

      1. template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
        +         typename U1, typename U2, ..., typename UN, typename Allocator2> 
        +  void operator==(const functionN<T1, T2, ..., TN, Allocator1>& f1, 
        +                  const functionN<U1, U2, ..., UN, Allocator2>& f2);

        Notes: + + This function must be left undefined.
        Rationale: + + The safe_bool conversion opens a loophole whereby two function instances can be compared via ==. This undefined void operator == closes the loophole and ensures a compile-time or link-time error.

      2. template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
        +         typename U1, typename U2, ..., typename UN, typename Allocator2> 
        +  void operator!=(const functionN<T1, T2, ..., TN, Allocator1>& f1, 
        +                  const functionN<U1, U2, ..., UN, Allocator2>& f2);

        Notes: + + This function must be left undefined.
        Rationale: + + The safe_bool conversion opens a loophole whereby two function instances can be compared via !=. This undefined void operator != closes the loophole and ensures a compile-time or link-time error.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.function_base.html b/doc/html/class.boost.function_base.html new file mode 100644 index 0000000000..6b6bfec28f --- /dev/null +++ b/doc/html/class.boost.function_base.html @@ -0,0 +1,85 @@ +Class function_base
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class function_base

      boost::function_base — The common base class for all Boost.Function + objects. Objects of type function_base may not be created + directly.

      Synopsis

      +class function_base {
      +public:
      +
      +  // capacity
      +  bool empty() const;
      +};

      Description

      function_base capacity

      1. bool empty() const;

        Returns: + + true if this has a target, and false otherwise.
        Throws: + + Will not throw.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.is_recursive_wrapper.html b/doc/html/class.boost.is_recursive_wrapper.html new file mode 100644 index 0000000000..6dec1235b9 --- /dev/null +++ b/doc/html/class.boost.is_recursive_wrapper.html @@ -0,0 +1,86 @@ +Class template is_recursive_wrapper
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template is_recursive_wrapper

      boost::is_recursive_wrapper — Determines whether the specified type is a specialization of + recursive_wrapper.

      Synopsis

      template<typename T> 
      +class is_recursive_wrapper {
      +public:
      +  // types
      +  typedef unspecified type;
      +
      +  // static constants
      +  static const bool value = unspecified;
      +};

      Description

      Value is true iff T is a specialization of + recursive_wrapper.

      Note: + is_recursive_wrapper is a model of + MPL's + IntegralConstant concept.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.is_reference_wrapper.html b/doc/html/class.boost.is_reference_wrapper.html new file mode 100644 index 0000000000..cfaa8c4702 --- /dev/null +++ b/doc/html/class.boost.is_reference_wrapper.html @@ -0,0 +1,81 @@ +Class template is_reference_wrapper
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template is_reference_wrapper

      boost::is_reference_wrapper — Determine if a type T is an instantiation of reference_wrapper.

      Synopsis

      template<typename T> 
      +class is_reference_wrapper {
      +public:
      +  // static constants
      +  static const bool value = unspecified;
      +};

      Description

      The value static + constant will be true iff the + type T is a specialization of + reference_wrapper.

      Last revised: , at GMTCopyright © 1999, 2000 Jaakko Järvi
      Copyright © 2001, 2002 Peter Dimov
      Copyright © 2002 David Abrahams
      diff --git a/doc/html/class.boost.last_value.html b/doc/html/class.boost.last_value.html new file mode 100644 index 0000000000..b1a261b859 --- /dev/null +++ b/doc/html/class.boost.last_value.html @@ -0,0 +1,90 @@ +Class template last_value
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template last_value

      boost::last_value — Evaluate an InputIterator sequence and return the + last value in the sequence.

      Synopsis

      template<typename T> 
      +class last_value {
      +public:
      +  // types
      +  typedef T result_type;
      +
      +  // invocation
      +  template<typename InputIterator> 
      +    result_type operator()(InputIterator, InputIterator) const;
      +};

      Description

      last_value invocation

      1. template<typename InputIterator> 
        +  result_type operator()(InputIterator first, InputIterator last) const;

        Requires: + + first != last
        Effects: + + Dereferences every iterator in the sequence [first, last).
        Returns: + + The result of dereferencing the iterator last-1.

      Specializations

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.make_recursive_variant.html b/doc/html/class.boost.make_recursive_variant.html new file mode 100644 index 0000000000..daf312a915 --- /dev/null +++ b/doc/html/class.boost.make_recursive_variant.html @@ -0,0 +1,105 @@ +Class template make_recursive_variant
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template make_recursive_variant

      boost::make_recursive_variant — Simplifies declaration of recursive variant types.

      Synopsis

      template<typename T1, typename T2 = unspecified, ..., 
      +         typename TN = unspecified> 
      +class make_recursive_variant {
      +public:
      +  // types
      +  typedef boost::variant< unspecified > type;
      +};

      Description

      type has behavior equivalent in every respect to + some variant< U1, U2, ..., UN >, where each type + Ui is the result of the + corresponding type Ti undergone a + transformation function. The following pseudo-code specifies the + behavior of this transformation (call it substitute): + +

      • If Ti is + boost::recursive_variant_ then: + variant< U1, U2, ..., UN >;
      • Else if Ti is of the + form X * then: + substitute(X) *;
      • Else if Ti is of the + form X & then: + substitute(X) &;
      • Else if Ti is of the + form R (*)( X1, X2, ..., XN ) then: + substitute(R) (*)( substitute(X1), substitute(X2), ..., substitute(XN) );
      • Else if Ti is of the + form F < X1, X2, ..., XN > then: + F< substitute(X1), substitute(X2), ..., substitute(XN) >;
      • Else: Ti.

      Note that cv-qualifiers are preserved and that the actual + process is generally a bit more complicated. However, the above does + convey the essential idea as well as describe the extent of the + substititions.

      Use of make_recursive_variant is demonstrated in + the section called “Recursive types with make_recursive_variant”.

      Portability: Due to standard + conformance issues in several compilers, + make_recursive_variant is not universally supported. On + these compilers the library indicates its lack of support via the + definition of the preprocessor symbol + BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.make_recursive_variant_over.html b/doc/html/class.boost.make_recursive_variant_over.html new file mode 100644 index 0000000000..89ba3ec2ff --- /dev/null +++ b/doc/html/class.boost.make_recursive_variant_over.html @@ -0,0 +1,89 @@ +Class template make_recursive_variant_over
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template make_recursive_variant_over

      boost::make_recursive_variant_over — Exposes a recursive variant whose bounded types + are the elements of the given type sequence.

      Synopsis

      template<typename Sequence> 
      +class make_recursive_variant_over {
      +public:
      +  // types
      +  typedef variant< unspecified > type;
      +};

      Description

      type has behavior equivalent in every respect to + make_recursive_variant< Sequence[0], Sequence[1], ... >::type + (where Sequence[i] denotes the + i-th element of Sequence), except + that no upper limit is imposed on the number of types.

      Notes:

      • Sequence must meet the requirements of + MPL's Sequence + concept.
      • Due to standard conformance problems in several compilers, + make_recursive_variant_over may not be supported on + your compiler. See + BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT + for more information.
      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.make_variant_over.html b/doc/html/class.boost.make_variant_over.html new file mode 100644 index 0000000000..4336016ef4 --- /dev/null +++ b/doc/html/class.boost.make_variant_over.html @@ -0,0 +1,89 @@ +Class template make_variant_over
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template make_variant_over

      boost::make_variant_over — Exposes a variant whose bounded types are the + elements of the given type sequence.

      Synopsis

      template<typename Sequence> 
      +class make_variant_over {
      +public:
      +  // types
      +  typedef variant< unspecified > type;
      +};

      Description

      type has behavior equivalent in every respect to + variant< Sequence[0], Sequence[1], ... > + (where Sequence[i] denotes the + i-th element of Sequence), except + that no upper limit is imposed on the number of types.

      Notes:

      • Sequence must meet the requirements of + MPL's Sequence + concept.
      • Due to standard conformance problems in several compilers, + make_variant_over may not be supported on your + compiler. See + BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT + for more information.
      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.recursive_wrapper.html b/doc/html/class.boost.recursive_wrapper.html new file mode 100644 index 0000000000..eca92d6953 --- /dev/null +++ b/doc/html/class.boost.recursive_wrapper.html @@ -0,0 +1,154 @@ +Class template recursive_wrapper
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template recursive_wrapper

      boost::recursive_wrapper — Solves circular dependencies, enabling recursive types.

      Synopsis

      template<typename T> 
      +class recursive_wrapper {
      +public:
      +  // types
      +  typedef T type;
      +
      +  // construct/copy/destruct
      +  recursive_wrapper();
      +  recursive_wrapper(const recursive_wrapper &);
      +  recursive_wrapper(const T &);
      +  ~recursive_wrapper();
      +
      +  // modifiers
      +  void swap(recursive_wrapper &);
      +  recursive_wrapper & operator=(const recursive_wrapper &);
      +  recursive_wrapper & operator=(const T &);
      +
      +  // queries
      +  T & get();
      +  const T & get() const;
      +  T * get_pointer();
      +  const T * get_pointer() const;
      +};

      Description

      The recursive_wrapper class template has an + interface similar to a simple value container, but its content is + allocated dynamically. This allows recursive_wrapper to + hold types T whose member data leads to a circular + dependency (e.g., a data member of T has a data member + of type T).

      The application of recursive_wrapper is easiest + understood in context. See + the section called “Recursive types with recursive_wrapper” for a + demonstration of a common use of the class template.

      Notes:

      • Any type specified as the template argument to + recursive_wrapper must be capable of construction via + operator new. Thus, for instance, references are not + supported.

      recursive_wrapper construct/copy/destruct

      1. recursive_wrapper();

        Initializes *this by default construction of + T.

        Requires: + + T must fulfill the requirements of the + DefaultConstructible [20.1.4] + concept.
        Throws: + + May fail with any exceptions arising from the default + constructor of T or, in the event of + insufficient memory, with std::bad_alloc.

      2. recursive_wrapper(const recursive_wrapper & other);

        Copies the content of other into + *this.

        Throws: + + May fail with any exceptions arising from the + copy constructor of T or, in the event of + insufficient memory, with std::bad_alloc.

      3. recursive_wrapper(const T & operand);

        Copies operand into + *this.

        Throws: + + May fail with any exceptions arising from the + copy constructor of T or, in the event of + insufficient memory, with std::bad_alloc.

      4. ~recursive_wrapper();

        Deletes the content of *this.

        Throws: + + Will not throw.

      recursive_wrapper modifiers

      1. void swap(recursive_wrapper & other);

        Exchanges contents of *this and + other.

        Throws: + + Will not throw.

      2. recursive_wrapper & operator=(const recursive_wrapper & rhs);

        Assigns the content of rhs to the content of + *this.

        Requires: + + T must fulfill the requirements of + the Assignable + concept.
        Throws: + + May fail with any exceptions arising from the assignment + operator of T.

      3. recursive_wrapper & operator=(const T & rhs);

        Assigns rhs into the content of + *this.

        Requires: + + T must fulfill the requirements of the + Assignable + concept.
        Throws: + + May fail with any exceptions arising from the assignment + operator of T.

      recursive_wrapper queries

      1. T & get();
        +const T & get() const;

        Returns a reference to the content of + *this.

        Throws: + + Will not throw.

      2. T * get_pointer();
        +const T * get_pointer() const;

        Returns a pointer to the content of + *this.

        Throws: + + Will not throw.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.reference_wrapper.html b/doc/html/class.boost.reference_wrapper.html new file mode 100644 index 0000000000..eed23cac4d --- /dev/null +++ b/doc/html/class.boost.reference_wrapper.html @@ -0,0 +1,126 @@ +Class template reference_wrapper
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template reference_wrapper

      boost::reference_wrapper — + Contains a reference to an object of type + T. +

      Synopsis

      template<typename T> 
      +class reference_wrapper {
      +public:
      +  // types
      +  typedef T type;
      +
      +  // construct/copy/destruct
      +  explicit reference_wrapper(T&);
      +
      +  // access
      +  operator T&() const;
      +  T& get() const;
      +  T* get_pointer() const;
      +};
      +
      +// constructors
      +reference_wrapper<T> ref(T&);
      +reference_wrapper<T const> cref(T const&);

      Description

      reference_wrapper + is primarily used to "feed" references to function templates + (algorithms) that take their parameter by value. It provides + an implicit conversion to + T&, which usually allows + the function templates to work on references + unmodified.

      reference_wrapper construct/copy/destruct

      1. explicit reference_wrapper(T& t);

        Effects: + + Constructs a + reference_wrapper + object that stores a reference to + t.
        Throws: + + Does not throw.

      reference_wrapper access

      1. operator T&() const;

        Returns: + + The stored reference.
        Throws: + + Does not throw.

      2. T& get() const;

        Returns: + + The stored reference.
        Throws: + + Does not throw.

      3. T* get_pointer() const;

        Returns: + + A pointer to the object referenced by the stored reference.
        Throws: + + Does not throw.

      reference_wrapper constructors

      1. reference_wrapper<T> ref(T& t);

        Returns: + + reference_wrapper<T>(t)
        Throws: + + Does not throw.

      2. reference_wrapper<T const> cref(T const& t);

        Returns: + + reference_wrapper<T const>(t)
        Throws: + + Does not throw.

      Last revised: , at GMTCopyright © 1999, 2000 Jaakko Järvi
      Copyright © 2001, 2002 Peter Dimov
      Copyright © 2002 David Abrahams
      diff --git a/doc/html/class.boost.signal.html b/doc/html/class.boost.signal.html new file mode 100644 index 0000000000..7bdbf2d8d0 --- /dev/null +++ b/doc/html/class.boost.signal.html @@ -0,0 +1,94 @@ +Class template signal
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template signal

      boost::signal — Safe multicast callback.

      Synopsis

      template<typename Signature,   // Function type R (T1, T2, ..., TN)
      +         typename Allocator = std::allocator<void>, 
      +         typename Combiner = last_value<R>, 
      +         typename Group = int, 
      +         typename GroupCompare = std::less<Group>, 
      +         typename SlotFunction = function<Signature> > 
      +class signal : public signalN<R, T1, T2, ..., TN, Combiner, Group, GroupCompare, SlotFunction>
      +{
      +public:
      +  // construct/copy/destruct
      +  signal(const combiner_type& = combiner_type(), 
      +         const group_compare_type& = group_compare_type());
      +};

      Description

      Class template signal is a thin + wrapper around the numbered class templates signal0, signal1, etc. It accepts a function + type with N arguments instead of N separate arguments, and + derives from the appropriate signalN + instantiation.

      All functionality of this class template is in its base + class signalN.

      signal construct/copy/destruct

      1. signal(const combiner_type& combiner = combiner_type(), 
        +       const group_compare_type& compare = group_compare_type());

        Effects: + + Initializes the base class with the given combiner + and comparison objects.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.signalN.html b/doc/html/class.boost.signalN.html new file mode 100644 index 0000000000..62449db5c3 --- /dev/null +++ b/doc/html/class.boost.signalN.html @@ -0,0 +1,243 @@ +Class template signalN
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template signalN

      boost::signalN — Set of safe multicast callback types.

      Synopsis

      template<typename R, typename T1, typename T2, ..., typename TN, 
      +         typename Combiner = last_value<R>, typename Group = int, 
      +         typename GroupCompare = std::less<Group>, 
      +         typename SlotFunction = functionN<R, T1, T2, ..., TN> > 
      +class signalN : public signals::trackable,
      +                private noncopyable   // Exposition only
      +{
      +public:
      +  // types
      +  typedef typename Combiner::result_type result_type;         
      +  typedef Combiner                       combiner_type;       
      +  typedef Group                          group_type;          
      +  typedef GroupCompare                   group_compare_type;  
      +  typedef SlotFunction                   slot_function_type;  
      +  typedef slot<SlotFunction>             slot_type;           
      +  typedef unspecified                    slot_result_type;    
      +  typedef unspecified                    slot_call_iterator;  
      +  typedef T1                             argument_type;         // If N == 1
      +  typedef T1                             first_argument_type;   // If N == 2
      +  typedef T2                             second_argument_type;  // If N == 2
      +  typedef T1                             arg1_type;           
      +  typedef T2                             arg2_type;           
      +     .
      +     .
      +     .
      +  typedef TN                             argN_type;           
      +
      +  // static constants
      +  static const int arity = N;
      +
      +  // construct/copy/destruct
      +  signalN(const combiner_type& = combiner_type(), 
      +          const group_compare_type& = group_compare_type());
      +  ~signalN();
      +
      +  // connection management
      +  signals::connection connect(const slot_type&);
      +  signals::connection connect(const group_type&, const slot_type&);
      +  void disconnect(const group_type&);
      +  void disconnect_all_slots();
      +  bool empty() const;
      +  std::size_t num_slots() const;
      +
      +  // invocation
      +  result_type operator()(arg1_type, arg2_type, ..., argN_type);
      +  result_type operator()(arg1_type, arg2_type, ..., argN_type) const;
      +};

      Description

      The class template signalN covers + several related classes signal0, signal1, signal2, etc., + where the number suffix describes the number of function + parameters the signal and its connected slots will + take. Instead of enumerating all classes, a single pattern + signalN will be described, where N + represents the number of function parameters.

      signalN construct/copy/destruct

      1. signalN(const combiner_type& combiner = combiner_type(), 
        +        const group_compare_type& compare = group_compare_type());

        Effects: + + Initializes the signal to contain no slots, copies the given combiner into internal storage, and stores the given group comparison function object to compare groups.
        Postconditions: + + this->empty()

      2. ~signalN();

        Effects: + + Disconnects all slots connected to *this.

      signalN connection management

      1. signals::connection connect(const slot_type& slot);
        +signals::connection connect(const group_type& group, const slot_type& slot);

        Effects: + + Connects the signal this to the incoming slot. If + the slot is inactive, i.e., any of the trackable objects + bound by the slot call have been destroyed, then the call to + connect is a no-op. If the second version of + connect is invoked, the + slot is associated with the given group.
        Returns: + + A + signals::connection + object that references the newly-created connection between + the signal and the slot; if the slot is inactive, returns a + disconnected connection.
        Throws: + + This routine meets the strong exception guarantee, + where any exception thrown will cause the slot to not be + connected to the signal.
        Complexity: + + O(lg n) where n is the number of + slots known to the signal.
        Notes: + + It is unspecified whether connecting a slot while the + signal is calling will result in the slot being called + immediately.

      2. void disconnect(const group_type& group);

        Effects: + + Any slots in the given group are disconnected.
        Throws: + + Will not throw unless a user destructor throws. If a + user destructor throws, not all slots in this group may be + disconnected.
        Complexity: + + O(lg n) + k where n is the number of slots known + to the signal and k is the number of slots in the + group.

      3. void disconnect_all_slots();

        Effects: + + Disconnects all slots connected to the signal.
        Postconditions: + + this->empty().
        Throws: + + If disconnecting a slot causes an exception to be + thrown, not all slots may be disconnected.
        Complexity: + + Linear in the number of slots known to the + signal.
        Notes: + + May be called at any time within the lifetime of the + signal, including during calls to the signal's slots.

      4. bool empty() const;

        Returns: + + true if no slots + are connected to the signal, and + false otherwise.
        Throws: + + Will not throw.
        Complexity: + + Linear in the number of slots known to the + signal.
        Rationale: + + Slots can disconnect at any point in time, + including while those same slots are being invoked. It is + therefore possible that the implementation must search + through a list of disconnected slots to determine if any + slots are still connected.

      5. std::size_t num_slots() const;

        Returns: + + The number of slots connected to the signal
        Throws: + + Will not throw.
        Complexity: + + Linear in the number of slots known to the + signal.
        Rationale: + + Slots can disconnect at any point in time, + including while those same slots are being invoked. It is + therefore possible that the implementation must search + through a list of disconnected slots to determine how many + slots are still connected.

      signalN invocation

      1. result_type operator()(arg1_type a1, arg2_type a2, ... , argN_type aN);
        +result_type operator()(arg1_type a1, arg2_type a2, ... , argN_type aN) const;

        Effects: + + Invokes the combiner with a + slot_call_iterator range + [first, last) corresponding to the sequence of calls to the + slots connected to signal + *this. Dereferencing an + iterator in this range causes a slot call with the given set + of parameters (a1, a2, ..., + aN), the result of which is returned from + the iterator dereference operation.
        Returns: + + The result returned by the combiner.
        Throws: + + If an exception is thrown by a slot call, or if the + combiner does not dereference any slot past some given slot, + all slots after that slot in the internal list of connected + slots will not be invoked.
        Notes: + + Only the slots associated with iterators that are + actually dereferenced will be invoked. Multiple dereferences + of the same iterator will not result in multiple slot + invocations, because the return value of the slot will be + cached.

        The const version of + the function call operator will invoke the combiner as + const, whereas the + non-const version will + invoke the combiner as + non-const.

        Ordering between members of a given group or between + ungrouped slots is unspecified.

        Calling the function call operator may invoke undefined + behavior if no slots are connected to the signal, depending + on the combiner used. The default combiner is well-defined + for zero slots when the return type is void but is undefined + when the return type is any other type (because there is no + way to synthesize a return value).

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.signals.connection.html b/doc/html/class.boost.signals.connection.html new file mode 100644 index 0000000000..f565870a18 --- /dev/null +++ b/doc/html/class.boost.signals.connection.html @@ -0,0 +1,162 @@ +Class connection
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class connection

      boost::signals::connection — Query/disconnect a signal-slot connection.

      Synopsis

      +class connection {
      +public:
      +  // construct/copy/destruct
      +  connection();
      +  connection(const connection&);
      +  connection& operator=(const connection&);
      +
      +  // connection management
      +  void disconnect() const;
      +  bool connected() const;
      +
      +  // modifiers
      +  void swap(const connection&);
      +
      +  // comparisons
      +  bool operator==(const connection&) const;
      +  bool operator<(const connection&) const;
      +};
      +
      +// specialized algorithms
      +void swap(connection&, connection&);

      Description

      The connection class represents + a connection between a Signal and a Slot. It is a + lightweight object that has the ability to query whether the + signal and slot are currently connected, and to disconnect + the signal and slot. It is always safe to query or + disconnect a connection.

      connection construct/copy/destruct

      1. connection();

        Effects: + + Sets the currently represented connection to the + NULL connection.
        Postconditions: + + !this->connected().
        Throws: + + Will not throw.

      2. connection(const connection& other);

        Effects: + + this references + the connection referenced by + other.
        Throws: + + Will not throw.

      3. connection& operator=(const connection& other);

        Effects: + + this references + the connection referenced by + other.
        Throws: + + Will not throw.

      connection connection management

      1. void disconnect() const;

        Effects: + + If + this->connected(), + disconnects the signal and slot referenced by this; + otherwise, this operation is a no-op.
        Postconditions: + + !this->connected().

      2. bool connected() const;

        Returns: + + true if this + references a non-NULL connection that is still active + (connected), and false + otherwise.
        Throws: + + Will not throw.

      connection modifiers

      1. void swap(const connection& other);

        Effects: + + Swaps the connections referenced in + this and + other.
        Throws: + + Will not throw.

      connection comparisons

      1. bool operator==(const connection& other) const;

        Returns: + + true if + this and + other reference the same + connection or both reference the NULL connection, and + false + otherwise.
        Throws: + + Will not throw.

      2. bool operator<(const connection& other) const;

        Returns: + + true if the + connection referenced by + this precedes the + connection referenced by + other based on some + unspecified ordering, and + false + otherwise.
        Throws: + + Will not throw.

      connection specialized algorithms

      1. void swap(connection& x, connection& y);

        Effects: + + x.swap(y)
        Throws: + + Will not throw.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.signals.scoped_connection.html b/doc/html/class.boost.signals.scoped_connection.html new file mode 100644 index 0000000000..ffd2364bad --- /dev/null +++ b/doc/html/class.boost.signals.scoped_connection.html @@ -0,0 +1,108 @@ +Class scoped_connection
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class scoped_connection

      boost::signals::scoped_connection — Limits a signal-slot connection lifetime to a particular scope.

      Synopsis

      +class scoped_connection : private noncopyable   // Exposition only
      +{
      +public:
      +  // construct/copy/destruct
      +  scoped_connection(const connection&);
      +  ~scoped_connection();
      +
      +  // connection management
      +  void disconnect() const;
      +  bool connected() const;
      +};

      Description

      scoped_connection construct/copy/destruct

      1. scoped_connection(const connection& other);

        Effects: + + this references + the connection referenced by + other.
        Throws: + + Will not throw.

      2. ~scoped_connection();

        Effects: + + If + this->connected(), + disconnects the signal-slot connection.

      scoped_connection connection management

      1. void disconnect() const;

        Effects: + + If + this->connected(), + disconnects the signal and slot referenced by this; + otherwise, this operation is a no-op.
        Postconditions: + + !this->connected().

      2. bool connected() const;

        Returns: + + true if this + references a non-NULL connection that is still active + (connected), and false + otherwise.
        Throws: + + Will not throw.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.signals.trackable.html b/doc/html/class.boost.signals.trackable.html new file mode 100644 index 0000000000..e6ed4cd662 --- /dev/null +++ b/doc/html/class.boost.signals.trackable.html @@ -0,0 +1,116 @@ +Class trackable
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class trackable

      boost::signals::trackable — Enables safe use of multicast callbacks.

      Synopsis

      +class trackable {
      +public:
      +  // construct/copy/destruct
      +  trackable();
      +  trackable(const trackable&);
      +  trackable& operator=(const trackable&);
      +  ~trackable();
      +};

      Description

      The trackable class provides automatic + disconnection of signals and slots when objects bound in + slots (via pointer or reference) are destroyed. The + trackable class may only be used as a public + base class for some other class; when used as such, that + class may be bound to function objects used as part of + slots. The manner in which a trackable object + tracks the set of signal-slot connections it is a part of is + unspecified.

      The actual use of trackable is contingent + on the presence of appropriate + visit_each overloads for any + type that may contain pointers or references to trackable + objects.

      trackable construct/copy/destruct

      1. trackable();

        Effects: + + Sets the list of connected slots to empty.
        Throws: + + Will not throw.

      2. trackable(const trackable& other);

        Effects: + + Sets the list of connected slots to empty.
        Throws: + + Will not throw.
        Rationale: + + Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.

      3. trackable& operator=(const trackable& other);

        Effects: + + Sets the list of connected slots to empty.
        Returns: + + *this
        Throws: + + Will not throw.
        Rationale: + + Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.

      4. ~trackable();

        Effects: + + Disconnects all signal/slot connections that + contain a pointer or reference to this trackable object that + can be found by + visit_each.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.slot.html b/doc/html/class.boost.slot.html new file mode 100644 index 0000000000..a2a90bcb4a --- /dev/null +++ b/doc/html/class.boost.slot.html @@ -0,0 +1,89 @@ +Class template slot
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template slot

      boost::slot — Pass slots as function arguments.

      Synopsis

      template<typename SlotFunction> 
      +class slot {
      +public:
      +  // construct/copy/destruct
      +  template<typename Slot> slot(Slot);
      +};

      Description

      slot construct/copy/destruct

      1. template<typename Slot> slot(Slot target);

        Effects: + + Invokes + visit_each + (unqualified) to discover pointers and references to + signals::trackable + objects in target.

        Initializes this to + contain the incoming slot + target, which may be any + function object with which a + SlotFunction can be + constructed.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/class.boost.static_visitor.html b/doc/html/class.boost.static_visitor.html new file mode 100644 index 0000000000..b9f4a94349 --- /dev/null +++ b/doc/html/class.boost.static_visitor.html @@ -0,0 +1,84 @@ +Class template static_visitor
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template static_visitor

      boost::static_visitor — Convenient base type for static visitors.

      Synopsis

      template<typename ResultType> 
      +class static_visitor {
      +public:
      +  // types
      +  typedef ResultType result_type;  // Exposes result_type member as required by StaticVisitor concept.
      +};

      Description

      Denotes the intent of the deriving class as meeting the + requirements of a static visitor of some type. Also exposes the + inner type result_type as required by the + StaticVisitor + concept.

      Notes: + static_visitor is intended for use as a base type only + and is therefore noninstantiable.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.unwrap_recursive_wrapper.html b/doc/html/class.boost.unwrap_recursive_wrapper.html new file mode 100644 index 0000000000..f5133d1d64 --- /dev/null +++ b/doc/html/class.boost.unwrap_recursive_wrapper.html @@ -0,0 +1,82 @@ +Class template unwrap_recursive_wrapper
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template unwrap_recursive_wrapper

      boost::unwrap_recursive_wrapper — Unwraps the specified argument if given a specialization of + recursive_wrapper.

      Synopsis

      template<typename T> 
      +class unwrap_recursive_wrapper {
      +public:
      +  // types
      +  typedef unspecified type;
      +};

      Description

      type is equivalent to T::type if + T is a specialization of + recursive_wrapper. Otherwise, + type is equivalent to T.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.unwrap_reference.html b/doc/html/class.boost.unwrap_reference.html new file mode 100644 index 0000000000..4a2dc460bf --- /dev/null +++ b/doc/html/class.boost.unwrap_reference.html @@ -0,0 +1,82 @@ +Class template unwrap_reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template unwrap_reference

      boost::unwrap_reference — Find the type in a reference_wrapper.

      Synopsis

      template<typename T> 
      +class unwrap_reference {
      +public:
      +  // types
      +  typedef unspecified T;
      +};

      Description

      The typedef type is + T::type if + T is a + reference_wrapper, + T otherwise.

      Last revised: , at GMTCopyright © 1999, 2000 Jaakko Järvi
      Copyright © 2001, 2002 Peter Dimov
      Copyright © 2002 David Abrahams
      diff --git a/doc/html/class.boost.variant.html b/doc/html/class.boost.variant.html new file mode 100644 index 0000000000..b908d79a26 --- /dev/null +++ b/doc/html/class.boost.variant.html @@ -0,0 +1,325 @@ +Class template variant
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template variant

      boost::variant — Safe, generic, stack-based discriminated union container.

      Synopsis

      template<typename T1, typename T2 = unspecified, ..., 
      +         typename TN = unspecified> 
      +class variant {
      +public:
      +  // types
      +  typedef unspecified types;
      +
      +  // construct/copy/destruct
      +  variant();
      +  variant(const variant &);
      +  template<typename T> variant(T &);
      +  template<typename T> variant(const T &);
      +  template<typename U1, typename U2, ..., typename UN> 
      +    variant(variant<U1, U2, ..., UN> &);
      +  template<typename U1, typename U2, ..., typename UN> 
      +    variant(const variant<U1, U2, ..., UN> &);
      +  ~variant();
      +
      +  // modifiers
      +  void swap(variant &);
      +  variant & operator=(const variant &);
      +  template<typename T> variant & operator=(const T &);
      +
      +  // queries
      +  int which() const;
      +  bool empty() const;
      +  const std::type_info & type() const;
      +
      +  // relational
      +  bool operator==(const variant &) const;
      +  template<typename U> void operator==(const U &) const;
      +  bool operator<(const variant &) const;
      +  template<typename U> void operator<(const U &) const;
      +};

      Description

      The variant class template (inspired by Andrei + Alexandrescu's class of the same name + [Ale01A]) is an efficient, + recursive-capable, + bounded discriminated union value type capable of containing any value + type (either POD or non-POD). It supports construction from any type + convertible to one of its bounded types or from a source + variant whose bounded types are each convertible to one + of the destination variant's bounded types. As well, + through apply_visitor, + variant supports compile-time checked, type-safe + visitation; and through get, + variant supports run-time checked, type-safe value + retrieval.

      Notes:

      • The bounded types of the variant are exposed + via the nested typedef types, which is an + MPL-compatible Sequence containing the + set of types that must be handled by any + visitor to + the variant.
      • All members of variant satisfy at least the + basic guarantee of exception-safety. That is, all operations on + a variant remain defined even after previous + operations have failed.
      • Each type specified as a template argument to + variant must meet the requirements of the + BoundedType + concept.
      • Each type specified as a template argument to + variant must be distinct after removal of qualifiers. + Thus, for instance, both variant<int, int> and + variant<int, const int> have undefined + behavior.
      • Conforming implementations of variant must + allow at least ten types as template arguments. The exact number + of allowed arguments is exposed by the preprocessor macro + BOOST_VARIANT_LIMIT_TYPES. + (See make_variant_over for a + means to specify the bounded types of a variant by + the elements of an MPL or compatible + Sequence, thus overcoming this limitation.)

      variant construct/copy/destruct

      1. variant();

        Requires: + + The first bounded type of the variant (i.e., + T1) must fulfill the requirements of the + DefaultConstructible [20.1.4] + concept.
        Postconditions: + + Content of *this is the default value of the + first bounded type (i.e, T1).
        Throws: + + May fail with any exceptions arising from the default + constructor of T1.

      2. variant(const variant & other);

        Postconditions: + + Content of *this is a copy of the content of + other.
        Throws: + + May fail with any exceptions arising from the + copy constructor of other's contained type.

      3. template<typename T> variant(T & operand);

        Requires: + + T must be unambiguously convertible to one of + the bounded types (i.e., T1, T2, + etc.).
        Postconditions: + + Content of *this is the best conversion of + operand to one of the bounded types, as determined + by standard overload resolution rules.
        Throws: + + May fail with any exceptions arising from the conversion of + operand to one of the bounded types.

      4. template<typename T> variant(const T & operand);

        Notes: + + Same semantics as previous constructor, but allows + construction from temporaries.

      5. template<typename U1, typename U2, ..., typename UN> 
        +  variant(variant<U1, U2, ..., UN> & operand);

        Requires: + + Every one of U1, + U2, ..., UN must have an unambiguous + conversion to one of the bounded types (i.e., T1, + T2, ..., TN).
        Postconditions: + + If variant<U1, U2, ..., UN> is itself + one of the bounded types, then content of *this is a + copy of operand. Otherwise, content of + *this is the best conversion of the content of + operand to one of the bounded types, as determined + by standard overload resolution rules.
        Throws: + + If variant<U1, U2, ..., UN> is itself + one of the bounded types, then may fail with any exceptions arising + from the copy constructor of + variant<U1, U2, ..., UN>. Otherwise, may fail + with any exceptions arising from the conversion of the content of + operand to one of the bounded types.

      6. template<typename U1, typename U2, ..., typename UN> 
        +  variant(const variant<U1, U2, ..., UN> & operand);

        Notes: + + Same semantics as previous constructor, but allows + construction from temporaries.

      7. ~variant();

        Effects: + + Destroys the content of *this.
        Throws: + + Will not throw.

      variant modifiers

      1. void swap(variant & other);

        Requires: + + Every bounded type must fulfill the requirements of the + Assignable + concept.
        Effects: + + Interchanges the content of *this and + other.
        Throws: + + If the contained type of other is the same as + the contained type of *this, then may fail with any + exceptions arising from the swap of the contents of + *this and other. Otherwise, may fail + with any exceptions arising from either of the copy constructors + of the contained types. Also, in the event of insufficient + memory, may fail with std::bad_alloc + (why?).

      2. variant & operator=(const variant & rhs);

        Requires: + + Every bounded type must fulfill the requirements of the + Assignable + concept.
        Effects: + + If the contained type of rhs is the same as + the contained type of *this, then assigns the + content of rhs into the content of + *this. Otherwise, makes the content of + *this a copy of the content of rhs, + destroying the previous content of *this.
        Throws: + + If the contained type of rhs is the same as + the contained type of *this, then may fail with any + exceptions arising from the assignment of the content of + rhs into the content *this. Otherwise, + may fail with any exceptions arising from the copy constructor + of the contained type of rhs. Also, in the event of + insufficient memory, may fail with std::bad_alloc + (why?).

      3. template<typename T> variant & operator=(const T & rhs);

        Requires: + +

        • T must be unambiguously convertible to + one of the bounded types (i.e., T1, + T2, etc.).
        • Every bounded type must fulfill the requirements of the + Assignable + concept.

        Effects: + + If the contained type of *this is + T, then assigns rhs into the content + of *this. Otherwise, makes the content of + *this the best conversion of rhs to + one of the bounded types, as determined by standard overload + resolution rules, destroying the previous content of + *this.
        Throws: + + If the contained type of *this is + T, then may fail with any exceptions arising from + the assignment of rhs into the content + *this. Otherwise, may fail with any exceptions + arising from the conversion of rhs to one of the + bounded types. Also, in the event of insufficient memory, may + fail with std::bad_alloc + (why?).

      variant queries

      1. int which() const;

        Returns: + + The zero-based index into the set of bounded types + of the contained type of *this. (For instance, if + called on a variant<int, std::string> object + containing a std::string, which() + would return 1.)
        Throws: + + Will not throw.

      2. bool empty() const;

        Returns: + + false: variant always contains + exactly one of its bounded types. (See + the section called “"Never-Empty" Guarantee” + for more information.)
        Rationale: + + Facilitates generic compatibility with + boost::any.
        Throws: + + Will not throw.

      3. const std::type_info & type() const;

        Returns: + + typeid(x), where x is the the + content of *this.
        Throws: + + Will not throw.

      variant relational

      1. bool operator==(const variant & rhs) const;
        +template<typename U> void operator==(const U & ) const;

        Notes: + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error.
        Requires: + + Every bounded type of the variant must + fulfill the requirements of the + EqualityComparable + concept.
        Returns: + + true iff which() == rhs.which()andcontent_this == content_rhs, where + content_this is the content of *this + and content_rhs is the content of + rhs.
        Throws: + + If which() == rhs.which() then may fail with + any exceptions arising from operator==(T,T), where + T is the contained type of + *this.

      2. bool operator<(const variant & rhs) const;
        +template<typename U> void operator<(const U & ) const;

        Notes: + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error.
        Requires: + + Every bounded type of the variant must + fulfill the requirements of the + LessThanComparable + concept.
        Returns: + + If which() == rhs.which() then: + content_this < content_rhs, where + content_this is the content of *this + and content_rhs is the content of rhs. + Otherwise: which() < rhs.which().
        Throws: + + If which() == rhs.which() then may fail with + any exceptions arising from operator<(T,T), + where T is the contained type of + *this.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/class.boost.visitor_ptr_t.html b/doc/html/class.boost.visitor_ptr_t.html new file mode 100644 index 0000000000..812855e9c5 --- /dev/null +++ b/doc/html/class.boost.visitor_ptr_t.html @@ -0,0 +1,99 @@ +Class template visitor_ptr_t
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class template visitor_ptr_t

      boost::visitor_ptr_t — Adapts a function pointer for use as a static visitor.

      Synopsis

      template<typename T, typename R> 
      +class visitor_ptr_t : public static_visitor<R> {
      +public:
      +  // construct/copy/destruct
      +  explicit visitor_ptr_t(R (*)(T));
      +
      +  // static visitor interfaces
      +  R operator()(unspecified-forwarding-type);
      +  template<typename U> void operator()(const U&);
      +};

      Description

      Adapts the function given at construction for use as a + static visitor + of type T with result type R.

      visitor_ptr_t construct/copy/destruct

      1. explicit visitor_ptr_t(R (*)(T) );

        Effects: + + Constructs the visitor with the given function.

      visitor_ptr_t static visitor interfaces

      1. R operator()(unspecified-forwarding-type operand);
        +template<typename U> void operator()(const U& );

        Effects: + + If passed a value or reference of type + T, it invokes the function given at + construction, appropriately forwarding + operand.
        Returns: + + Returns the result of the function invocation.
        Throws: + + The overload taking a value or reference of type + T throws if the invoked function throws. + The overload taking all other values always + throws bad_visit.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/function.faq.html b/doc/html/function.faq.html new file mode 100644 index 0000000000..f8d0d54d99 --- /dev/null +++ b/doc/html/function.faq.html @@ -0,0 +1,146 @@ +Frequently Asked Questions
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Frequently Asked Questions

      1.

      Why can't I compare + boost::function objects with + operator== or + operator!=?

      Comparison between boost::function + objects cannot be implemented "well", and therefore will not be + implemented. The typical semantics requested for f == + g given boost::function objects + f and g are:

      • If f and g + store function objects of the same type, use that type's + operator== to compare + them.
      • If f and g + store function objects of different types, return + false.

      The problem occurs when the type of the function objects + stored by both f and g doesn't have an + operator==: we would like the expression f == + g to fail to compile, as occurs with, e.g., the standard + containers. However, this is not implementable for + boost::function because it necessarily + "erases" some type information after it has been assigned a + function object, so it cannot try to call + operator== later: it must either find a way to call + operator== now, or it will never be able to call it + later. Note, for instance, what happens if you try to put a + float value into a + boost::function object: you will get an + error at the assignment operator or constructor, not in + operator(), because the function-call expression + must be bound in the constructor or assignment operator.

      The most promising approach is to find a method of + determining if operator== can be called for a + particular type, and then supporting it only when it is + available; in other situations, an exception would be + thrown. However, to date there is no known way to detect if an + arbitrary operator expression f == g is suitably + defined. The best solution known has the following undesirable + qualities:

      1. Fails at compile-time for objects where + operator== is not accessible (e.g., because it is + private).
      2. Fails at compile-time if calling + operator== is ambiguous.
      3. Appears to be correct if the + operator== declaration is correct, even though + operator== may not compile.

      All of these problems translate into failures in the + boost::function constructors or + assignment operator, even if the user never invokes + operator==. We can't do that to users.

      The other option is to place the burden on users that want + to use operator==, e.g., by providing an + is_equality_comparable trait they may + specialize. This is a workable solution, but is dangerous in + practice, because forgetting to specialize the trait will result + in unexpected exceptions being thrown from + boost::function's + operator==. This essentially negates the usefulness + of operator== in the context in which it is most + desired: multitarget callbacks. The + Signals library has a way around + this.

      2.

      I see void pointers; is this [mess] type safe?

      Yes, boost::function is type +safe even though it uses void pointers and pointers to functions +returning void and taking no arguments. Essentially, all type +information is encoded in the functions that manage and invoke +function pointers and function objects. Only these functions are +instantiated with the exact type that is pointed to by the void +pointer or pointer to void function. The reason that both are required +is that one may cast between void pointers and object pointers safely +or between different types of function pointers (provided you don't +invoke a function pointer with the wrong type).

      3.

      Why are there workarounds for void returns? C++ allows them!

      Void returns are permitted by the C++ standard, as in this code snippet: +

      void f();
      +void g() { return f(); }

      This is a valid usage of boost::function because void returns are not used. With void returns, we would attempting to compile ill-formed code similar to: +

      int f();
      +void g() { return f(); }

      In essence, not using void returns allows +boost::function to swallow a return value. This is +consistent with allowing the user to assign and invoke functions and +function objects with parameters that don't exactly match.

      4.

      Why (function) cloning?

      In November and December of 2000, the issue of cloning + vs. reference counting was debated at length and it was decided + that cloning gave more predictable semantics. I won't rehash the + discussion here, but if it cloning is incorrect for a particular + application a reference-counting allocator could be used.

      Last revised: October 12, 2003 at 16:02:26 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/function.history.html b/doc/html/function.history.html new file mode 100644 index 0000000000..e123101568 --- /dev/null +++ b/doc/html/function.history.html @@ -0,0 +1,122 @@ +History & Compatibility Notes
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      History & Compatibility Notes

      • Version 1.30.0:

      • Version 1.29.0: + Boost.Function has been partially redesigned to minimize the + interface and make it cleaner. Several seldom- or never-used + features of the older Boost.Function have been deprecated and will + be removed in the near future. Here is a list of features that have + been deprecated, the likely impact of the deprecations, and how to + adjust your code: + +

        • The boost::function class template syntax has + changed. The old syntax, e.g., boost::function<int, float, + double, std::string>, has been changed to a more natural + syntax boost::function<int (float, double, + std::string)>, where all return and argument types are + encoded in a single function type parameter. Any other template + parameters (e.g., the Allocator) follow this single + parameter.

          The resolution to this change depends on the + abilities of your compiler: if your compiler supports template + partial specialization and can parse function types (most do), modify + your code to use the newer + syntax (preferable) or directly use one of the + functionN classes whose syntax has not + changed. If your compiler does not support template partial + specialization or function types, you must take the latter option and + use the numbered Boost.Function classes. This option merely requires + changing types such as boost::function<void, int, int> + to boost::function2<void, int, int> (adding the number of + function arguments to the end of the class name).

          Support for the old syntax with the + boost::function class template will persist for a short + while, but will eventually be removed so that we can provide better + error messages and link compatibility.

        • The invocation + policy template parameter (Policy) has been deprecated + and will be removed. There is no direct equivalent to this rarely + used feature.

        • The mixin template parameter + (Mixin) has been deprecated and will be removed. There + is not direct equivalent to this rarely used feature.

        • The + set methods have been deprecated and will be + removed. Use the assignment operator instead.

      Last revised: March 12, 2003 at 23:27:22 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/function.html b/doc/html/function.html index 3661baccd8..de292336c3 100644 --- a/doc/html/function.html +++ b/doc/html/function.html @@ -1,10 +1,87 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/function.html - - +Boost.Function
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Boost.Function

      Douglas Gregor

      Use, modification and distribution is subject to 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)

      Introduction

      The Boost.Function library contains a family of class templates +that are function object wrappers. The notion is similar to a +generalized callback. It shares features with function pointers in +that both define a call interface (e.g., a function taking two integer +arguments and returning a floating-point value) through which some +implementation can be called, and the implementation that is invoked +may change throughout the course of the program.

      Generally, any place in which a function pointer would be used +to defer a call or make a callback, Boost.Function can be used instead +to allow the user greater flexibility in the implementation of the +target. Targets can be any 'compatible' function object (or function +pointer), meaning that the arguments to the interface designated by +Boost.Function can be converted to the arguments of the target +function object.

      Last revised: October 01, 2003 at 04:10:37 GMT
      diff --git a/doc/html/function.misc.html b/doc/html/function.misc.html new file mode 100644 index 0000000000..bbda1304a9 --- /dev/null +++ b/doc/html/function.misc.html @@ -0,0 +1,83 @@ +Miscellaneous Notes
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Miscellaneous Notes

      Boost.Function vs. Function Pointers

      Boost.Function has several advantages over function pointers, namely: + +

      • Boost.Function allows arbitrary compatible function objects to be targets (instead of requiring an exact function signature).

      • Boost.Function may be used with argument-binding and other function object construction libraries.

      • Boost.Function has predictible behavior when an empty function object is called.

      And, of course, function pointers have several advantages over Boost.Function: + +

      • Function pointers are smaller (the size of one pointer instead of three)

      • Function pointers are faster (Boost.Function may require two calls through function pointers)

      • Function pointers are backward-compatible with C libraries.

      • More readable error messages.

      Performance

      Function object wrapper size

      Function object wrappers will be the size of two function pointers plus one function pointer or data pointer (whichever is larger). On common 32-bit platforms, this amounts to 12 bytes per wrapper. Additionally, the function object target will be allocated on the heap.

      Copying efficiency

      Copying function object wrappers may require allocating memory for a copy of the function object target. The default allocator may be replaced with a faster custom allocator or one may choose to allow the function object wrappers to only store function object targets by reference (using ref) if the cost of this cloning becomes prohibitive.

      Invocation efficiency

      With a properly inlining compiler, an invocation of a function object requires one call through a function pointer. If the call is to a free function pointer, an additional call must be made to that function pointer (unless the compiler has very powerful interprocedural analysis).

      Combatting virtual function "bloat"

      The use of virtual functions tends to cause 'code bloat' on many compilers. When a class contains a virtual function, it is necessary to emit an additional function that classifies the type of the object. It has been our experience that these auxiliary functions increase the size of the executable significantly when many boost::function objects are used.

      In Boost.Function, an alternative but equivalent approach was taken using free functions instead of virtual functions. The Boost.Function object essentially holds two pointers to make a valid target call: a void pointer to the function object it contains and a void pointer to an "invoker" that can call the function object, given the function pointer. This invoker function performs the argument and return value conversions Boost.Function provides. A third pointer points to a free function called the "manager", which handles the cloning and destruction of function objects. The scheme is typesafe because the only functions that actually handle the function object, the invoker and the manager, are instantiated given the type of the function object, so they can safely cast the incoming void pointer (the function object pointer) to the appropriate type.

      Acknowledgements

      Many people were involved in the construction of this + library. William Kempf, Jesse Jones and Karl Nelson were all + extremely helpful in isolating an interface and scope for the + library. John Maddock managed the formal review, and many + reviewers gave excellent comments on interface, implementation, + and documentation. Peter Dimov led us to the function + declarator-based syntax.

      Last revised: March 12, 2003 at 23:27:22 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/function.reference.html b/doc/html/function.reference.html new file mode 100644 index 0000000000..39538b84df --- /dev/null +++ b/doc/html/function.reference.html @@ -0,0 +1,141 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      Definitions

      • A function object f is + compatible if for the given set of argument + types Arg1, + Arg2, ..., + ArgN and a + return type ResultType, the + appropriate following function is well-formed: +

        // if ResultType is not void
        +  ResultType foo(Arg1 arg1, Arg2 arg2, ..., ArgN argN)
        +  {
        +    return f(arg1, arg2, ..., argN);
        +  }
        +
        +  // if ResultType is void
        +  ResultType foo(Arg1 arg1, Arg2 arg2, ..., ArgN argN)
        +  {
        +    f(arg1, arg2, ..., argN);
        +  }
        +

        A special provision is made for pointers to member + functions. Though they are not function objects, Boost.Function + will adapt them internally to function objects. This requires + that a pointer to member function of the form R + (X::*mf)(Arg1, Arg2, ..., ArgN) + cv-quals be adapted to a + function object with the following function call operator + overloads: +

        template<typename P>
        +  R operator()(cv-quals P& x, Arg1 arg1, Arg2 arg2, ..., ArgN argN) const
        +  {
        +    return (*x).*mf(arg1, arg2, ..., argN);
        +  }
        +
      • A function object f of + type F is + stateless if it is a function pointer or if + boost::is_stateless<T> + is true. The construction of or copy to a Boost.Function object + from a stateless function object will not cause exceptions to be + thrown and will not allocate any storage. +

      namespace boost {
      +  class bad_function_call;
      +  class function_base;
      +  template<typename R, typename T1, typename T2, ..., typename TN, 
      +           typename Allocator = std::allocator<void> > 
      +    class functionN;
      +  template<typename T1, typename T2, ..., typename TN, typename Allocator> 
      +    void swap(functionN<T1, T2, ..., TN, Allocator>&, 
      +              functionN<T1, T2, ..., TN, Allocator>&);
      +  template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
      +           typename U1, typename U2, ..., typename UN, typename Allocator2> 
      +    void operator==(const functionN<T1, T2, ..., TN, Allocator1>&, 
      +                    const functionN<U1, U2, ..., UN, Allocator2>&);
      +  template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
      +           typename U1, typename U2, ..., typename UN, typename Allocator2> 
      +    void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&, 
      +                    const functionN<U1, U2, ..., UN, Allocator2>&);
      +  template<typename Signature, typename Allocator = std::allocator<void> > 
      +    class function;
      +  template<typename Signature, typename Allocator> 
      +    void swap(function<Signature, Allocator>&, 
      +              function<Signature, Allocator>&);
      +  template<typename Signature1, typename Allocator1, typename Signature2, 
      +           typename Allocator2> 
      +    void operator==(const function<Signature1, Allocator1>&, 
      +                    const function<Signature2, Allocator2>&);
      +  template<typename Signature1, typename Allocator1, typename Signature2, 
      +           typename Allocator2> 
      +    void operator!=(const function<Signature1, Allocator1>&, 
      +                    const function<Signature2, Allocator2>&);
      +}
      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/function.testsuite.html b/doc/html/function.testsuite.html new file mode 100644 index 0000000000..8702f99b83 --- /dev/null +++ b/doc/html/function.testsuite.html @@ -0,0 +1,73 @@ +Testsuite
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Testsuite

      Acceptance tests

      TestTypeDescriptionIf failing...

      function_test.cpp

      run

      Test the capabilities of the boost::function class template.

      The boost::function class template may not be usable on your compiler. However, the library may still be usable via the boost::functionN class templates.

      function_n_test.cpp

      run

      Test the capabilities of the boost::functionN class templates.

       

      allocator_test.cpp

      run

      Test the use of custom allocators.

      Allocators are ignored by the implementation.

      stateless_test.cpp

      run

      Test the optimization of stateless function objects in the Boost.Function library.

      The exception-safety and performance guarantees given for stateless function objects may not be met by the implementation.

      lambda_test.cpp

      run

      Test the interaction between Boost.Function and Boost.Lambda.

      Either Boost.Lambda does not work on the platform, or Boost.Function cannot safely be applied without the use of boost::unlambda.

      function_30.cpp

      compile

      Test the generation of a Boost.Function function object adaptor accepting 30 arguments.

      The Boost.Function library may work for function object adaptors of up to 10 parameters, but will be unable to generate adaptors for an arbitrary number of parameters. Failure often indicates an error in the compiler's preprocessor.

      function_arith_cxx98.cpp

      run

      Test the first tutorial example.

       

      function_arith_portable.cpp

      run

      Test the first tutorial example.

       

      sum_avg_cxx98.cpp

      run

      Test the second tutorial example.

       

      sum_avg_portable.cpp

      run

      Test the second tutorial example.

       

      mem_fun_cxx98.cpp

      run

      Test member function example from tutorial.

       

      mem_fun_portable.cpp

      run

      Test member function example from tutorial.

       

      std_bind_cxx98.cpp

      run

      Test standard binders example from tutorial.

       

      std_bind_portable.cpp

      run

      Test standard binders example from tutorial.

       

      function_ref_cxx98.cpp

      run

      Test boost::ref example from tutorial.

       

      function_ref_portable.cpp

      run

      Test boost::ref example from tutorial.

       

      Negative tests

      TestTypeDescriptionIf failing...

      function_test_fail1.cpp

      compile-fail

      Test the (incorrect!) use of comparisons between Boost.Function function objects.

      Intuitive (but incorrect!) code may compile and will give meaningless results.

      function_test_fail2.cpp

      compile-fail

      Test the use of an incompatible function object with Boost.Function

      Incorrect code may compile (with potentially unexpected results).

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/function.tutorial.html b/doc/html/function.tutorial.html new file mode 100644 index 0000000000..ce747bb7ce --- /dev/null +++ b/doc/html/function.tutorial.html @@ -0,0 +1,183 @@ +Tutorial
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Tutorial

      Boost.Function has two syntactical forms: the preferred form +and the portable form. The preferred form fits more closely with the +C++ language and reduces the number of separate template parameters +that need to be considered, often improving readability; however, the +preferred form is not supported on all platforms due to compiler +bugs. The compatible form will work on all compilers supported by +Boost.Function. Consult the table below to determine which syntactic +form to use for your compiler. + +

      Preferred syntaxPortable syntax
      • GNU C++ 2.95.x, 3.0.x, 3.1.x
      • Comeau C++ 4.2.45.2
      • SGI MIPSpro 7.3.0
      • Intel C++ 5.0, 6.0
      • Compaq's cxx 6.2
      • Microsoft Visual C++ 7.1
      • Any compiler supporting the preferred syntax
      • Microsoft Visual C++ 6.0, 7.0
      • Borland C++ 5.5.1
      • Sun WorkShop 6 update 2 C++ 5.3
      • Metrowerks CodeWarrior 8.1

      If your compiler does not appear in this list, please try the preferred syntax and report your results to the Boost list so that we can keep this table up-to-date.

      Basic Usage

      A function wrapper is defined simply +by instantiating the function class +template with the desired return type and argument types, formulated +as a C++ function type. Any number of arguments may be supplied, up to +some implementation-defined limit (10 is the default maximum). The +following declares a function object wrapper +f that takes two +int parameters and returns a +float: + +

      Preferred syntaxPortable syntax
      boost::function<float (int x, int y)> f;
      boost::function2<float, int, int> f;

      By default, function object wrappers are empty, so we can create a +function object to assign to f: + +

      struct int_div { 
      +  float operator()(int x, int y) const { return ((float)x)/y; }; 
      +};
      f = int_div();

      Now we can use f to execute +the underlying function object +int_div: + +

      std::cout << f(5, 3) << std::endl;

      We are free to assign any compatible function object to +f. If +int_div had been declared to take two +long operands, the implicit +conversions would have been applied to the arguments without any user +interference. The only limit on the types of arguments is that they be +CopyConstructible, so we can even use references and arrays: + +

      Preferred syntax
      boost::function<void (int values[], int n, int& sum, float& avg)> sum_avg;
      Portable syntax
      boost::function4<void, int*, int, int&, float&> sum_avg;
      void do_sum_avg(int values[], int n, int& sum, float& avg)
      +{
      +  sum = 0;
      +  for (int i = 0; i < n; i++)
      +    sum += values[i];
      +  avg = (float)sum / n;
      +}
      sum_avg = &do_sum_avg;

      Invoking a function object wrapper that does not actually +contain a function object is a precondition violation, much like +trying to call through a null function pointer, and will throw a bad_function_call exception). We can check for an +empty function object wrapper by using it in a boolean context (it evaluates true if the wrapper is not empty) or compare it against 0. For instance: +

      if (f)
      +  std::cout << f(5, 3) << std::endl;
      +else
      +  std::cout << "f has no target, so it is unsafe to call" << std::endl;

      Alternatively, +empty() +method will return whether or not the wrapper is empty.

      Finally, we can clear out a function target by assigning it to 0 or by calling the clear() member function, e.g., +

      f = 0;

      Free functions

      Free function pointers can be considered singleton function objects with const function call operators, and can therefore be directly used with the function object wrappers: +

      float mul_ints(int x, int y) { return ((float)x) * y; }
      f = &mul_ints;

      Note that the & isn't really necessary unless you happen to be using Microsoft Visual C++ version 6.

      Member functions

      In many systems, callbacks often call to member functions of a +particular object. This is often referred to as "argument binding", +and is beyond the scope of Boost.Function. The use of member functions +directly, however, is supported, so the following code is valid: + +

      struct X {
      +  int foo(int);
      +};
      Preferred syntaxPortable syntax
      boost::function<int (X*, int)> f;
      +
      +f = &X::foo;
      +  
      +X x;
      +f(&x, 5);
      boost::function2<int, X*, int> f;
      +
      +f = &X::foo;
      +  
      +X x;
      +f(&x, 5);

      Several libraries exist that support argument binding. Three such libraries are summarized below: +

      • Bind. This library allows binding of + arguments for any function object. It is lightweight and very + portable.

      • The C++ Standard library. Using + std::bind1st and + std::mem_fun together one can bind + the object of a pointer-to-member function for use with + Boost.Function: + +

        Preferred syntaxPortable syntax
        boost::function<int (int)> f;
        +  X x;
        +  f = std::bind1st(
        +        std::mem_fun(&X::foo), &x);
        +  f(5); // Call x.foo(5)
        boost::function1<int, int> f;
        +  X x;
        +  f = std::bind1st(
        +        std::mem_fun(&X::foo), &x);
        +  f(5); // Call x.foo(5)
      • The Lambda library. This library provides a powerful composition mechanism to construct function objects that uses very natural C++ syntax. Lambda requires a compiler that is reasonably conformant to the C++ standard.

      References to Functions

      In some cases it is + expensive (or semantically incorrect) to have Boost.Function clone a + function object. In such cases, it is possible to request that + Boost.Function keep only a reference to the actual function + object. This is done using the ref + and cref functions to wrap a + reference to a function object: + +

      Preferred syntaxPortable syntax
        stateful_type a_function_object;
      +  boost::function<int (int)> f;
      +  f = boost::ref(a_function_object);
      +
      +  boost::function<int (int)> f2(f);
        stateful_type a_function_object;
      +  boost::function1<int, int> f;
      +  f = boost::ref(a_function_object);
      +
      +  boost::function1<int, int> f2(f);

      Here, f will not make a copy +of a_function_object, nor will +f2 when it is targeted to +f's reference to +a_function_object. Additionally, when +using references to function objects, Boost.Function will not throw +exceptions during assignment or construction. +

      Last revised: December 19, 2003 at 03:33:25 GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/id2354683-bb.html b/doc/html/id2354683-bb.html new file mode 100644 index 0000000000..253ef4e004 --- /dev/null +++ b/doc/html/id2354683-bb.html @@ -0,0 +1,85 @@ +Class last_value<void>
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Class last_value<void>

      boost::last_value<void> — Evaluate an InputIterator sequence.

      Synopsis

      +class last_value<void> {
      +public:
      +  // types
      +  typedef unspecified result_type;
      +
      +  // invocation
      +  template<typename InputIterator> 
      +    result_type operator()(InputIterator, InputIterator) const;
      +};

      Description

      last_value invocation

      1. template<typename InputIterator> 
        +  result_type operator()(InputIterator first, InputIterator last) const;

        Effects: + + Dereferences every iterator in the sequence [first, last).

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/id2383300-bb.html b/doc/html/id2383300-bb.html new file mode 100644 index 0000000000..811d1003c4 --- /dev/null +++ b/doc/html/id2383300-bb.html @@ -0,0 +1,95 @@ +Function any_cast
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function any_cast

      boost::any_cast — Custom keyword cast for extracting a value + of a given type from an + any.

      Synopsis

      +template<typename ValueType> ValueType any_cast(const any & operand);
      +template<typename ValueType> const ValueType * any_cast(const any * operand);
      +template<typename ValueType> ValueType * any_cast(any * operand);

      Description

      Returns: + + If passed a pointer, it returns a + similarly qualified pointer to the value content if + successful, otherwise null is returned. If passed a value or + reference, it returns a copy of the value content if + successful.
      Throws: + + Overloads taking an + any pointer do not + throw; the overload taking an + any value or reference + throws bad_any_cast if + unsuccessful.
      Rationale: + + The value/reference version returns a + copy because the C++ keyword casts return + copies.

      Last revised: , at GMTCopyright © 2001 Kevlin Henney
      diff --git a/doc/html/id2493238-bb.html b/doc/html/id2493238-bb.html new file mode 100644 index 0000000000..583175b24c --- /dev/null +++ b/doc/html/id2493238-bb.html @@ -0,0 +1,120 @@ +Function get
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function get

      boost::get — Retrieves a value of a specified type from a given + variant.

      Synopsis

      +template<typename U, typename T1, typename T2, ..., typename TN> 
      +  U * get(variant<T1, T2, ..., TN> * operand);
      +template<typename U, typename T1, typename T2, ..., typename TN> 
      +  const U * get(const variant<T1, T2, ..., TN> * operand);
      +template<typename U, typename T1, typename T2, ..., typename TN> 
      +  U & get(variant<T1, T2, ..., TN> & operand);
      +template<typename U, typename T1, typename T2, ..., typename TN> 
      +  const U & get(const variant<T1, T2, ..., TN> & operand);

      Description

      The get function allows run-time checked, + type-safe retrieval of the content of the given + variant. The function succeeds + only if the content is of the specified type U, with + failure indicated as described below.

      Warning: After either + operand or its content is destroyed (e.g., when the + given variant is assigned a + value of different type), the returned reference is invalidated. + Thus, significant care and caution must be extended when handling + the returned reference.

      Notes: + + As part of its guarantee of type-safety, get + enforces const-correctness. Thus, the specified type + U must be const-qualified whenever + operand or its content is likewise + const-qualified. The converse, however, is not required: + that is, the specified type U may be + const-qualified even when operand and its + content are not.
      Returns: + + If passed a pointer, get returns a pointer to + the value content if it is of the specified type U; + otherwise, a null pointer is returned. If passed a reference, + get returns a reference to the value content if it is of + the specified type U; otherwise, an exception is thrown + (see below).
      Throws: + + Overloads taking a + variant pointer will not + throw; the overloads taking a + variant reference throw + bad_get if the content is not of + the specified type U.
      Rationale: + + While visitation via + apply_visitor + is generally prefered due to its greater safety, get may + may be more convenient in some cases due to its straightforward + usage.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/id2518553-bb.html b/doc/html/id2518553-bb.html new file mode 100644 index 0000000000..435cce888c --- /dev/null +++ b/doc/html/id2518553-bb.html @@ -0,0 +1,81 @@ +Function template swap
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function template swap

      boost::swap —

      Synopsis

      +template<typename T1, typename T2, ..., typename TN> 
      +  void swap(variant<T1, T2, ..., TN> & lhs, variant<T1, T2, ..., TN> & rhs);

      Description

      Effects: + + Swaps lhs with rhs by application + of variant::swap.
      Throws: + + May fail with any exception arising from + variant::swap.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/id2524211-bb.html b/doc/html/id2524211-bb.html new file mode 100644 index 0000000000..90e075fb05 --- /dev/null +++ b/doc/html/id2524211-bb.html @@ -0,0 +1,86 @@ +Function template operator<<
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function template operator<<

      boost::operator<< — Provides streaming output for variant types.

      Synopsis

      +template<typename ElemType, typename Traits, typename T1, typename T2, ..., 
      +         typename TN> 
      +  std::basic_ostream<ElemType,Traits> & 
      +  operator<<(std::basic_ostream<ElemType,Traits> & out, 
      +             const variant<T1, T2, ..., TN> & rhs);

      Description

      Requires: + + Every bounded type of the variant must + fulfill the requirements of the + OutputStreamable + concept.
      Effects: + + Calls out << x, where x is + the content of rhs.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/id2532119-bb.html b/doc/html/id2532119-bb.html new file mode 100644 index 0000000000..9cae3af0d4 --- /dev/null +++ b/doc/html/id2532119-bb.html @@ -0,0 +1,98 @@ +Function template visit_each
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function template visit_each

      boost::visit_each — Allow limited exploration of class members.

      Synopsis

      +template<typename Visitor, typename T> 
      +  void visit_each(const Visitor& visitor, const T& t, int );

      Description

      The visit_each mechanism + allows a visitor to be applied to every subobject in a given + object. It is used by the Signals library to discover + signals::trackable objects within a + function object, but other uses may surface if used + universally (e.g., conservative garbage collection). To fit + within the visit_each framework, + a visit_each overload must be + supplied for each object type.

      Effects: + + visitor(t), and for + every subobject x of + t: +

      • If x is a reference, visit_each(visitor, ref(x), 0)

      • Otherwise, visit_each(visitor, x, 0)


      Notes: + + The third parameter is + long for the fallback version + of visit_each and the argument + supplied to this third paramter must always be 0. The third + parameter is an artifact of the widespread lack of proper + function template ordering, and will be removed in the future.

      Library authors will be expected to add additional + overloads that specialize the T argument for their classes, so + that subobjects can be visited.

      Calls to visit_each are required to be unqualified, to + enable argument-dependent lookup.

      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/id2544445-bb.html b/doc/html/id2544445-bb.html new file mode 100644 index 0000000000..7ee9b384bd --- /dev/null +++ b/doc/html/id2544445-bb.html @@ -0,0 +1,85 @@ +Function template visitor_ptr
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function template visitor_ptr

      boost::visitor_ptr — Returns a visitor object that adapts function pointers for + use as a static visitor.

      Synopsis

      +template<typename R, typename T> visitor_ptr_t<T,R> visitor_ptr(R (*)(T) );

      Description

      Constructs and returns a + visitor_ptr_t adaptor over the + given function.

      Returns: + + Returns a visitor_ptr_t + visitor object that, when applied, invokes the given + function.
      Throws: + + Will not throw. (Note, however, that the returned + visitor object may + throw when applied.)

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/id2557051-bb.html b/doc/html/id2557051-bb.html new file mode 100644 index 0000000000..7ea61b82df --- /dev/null +++ b/doc/html/id2557051-bb.html @@ -0,0 +1,124 @@ +Function apply_visitor
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Function apply_visitor

      boost::apply_visitor — Allows compile-time checked type-safe application of the + given visitor to the content of the given variant, ensuring that all + types are handled by the visitor.

      Synopsis

      +template<typename Visitor, typename Variant> 
      +  typename Visitor::result_type 
      +  apply_visitor(Visitor & visitor, Variant & operand);
      +template<typename Visitor, typename Variant> 
      +  typename Visitor::result_type 
      +  apply_visitor(const Visitor & visitor, Variant & operand);
      +template<typename BinaryVisitor, typename Variant1, typename Variant2> 
      +  typename BinaryVisitor::result_type 
      +  apply_visitor(BinaryVisitor & visitor, Variant1 & operand1, 
      +                Variant2 & operand2);
      +template<typename BinaryVisitor, typename Variant1, typename Variant2> 
      +  typename BinaryVisitor::result_type 
      +  apply_visitor(const BinaryVisitor & visitor, Variant1 & operand1, 
      +                Variant2 & operand2);
      +template<typename Visitor> 
      +  apply_visitor_delayed_t<Visitor> apply_visitor(Visitor & visitor);

      Description

      The behavior of apply_visitor is dependent on + the number of arguments on which it operates (i.e., other than the + visitor). The function behaves as follows: + +

      • Overloads accepting one operand invoke the unary function + call operator of the given visitor on the content of the given + variant operand.
      • Overloads accepting two operands invoke the binary + function call operator of the given visitor on the content of + the given variant + operands.
      • The overload accepting only a visitor returns a + generic function object + that accepts either one or two arguments and invokes + apply_visitor using + these arguments and visitor, thus behaving as + specified above. (This behavior is particularly useful, for + example, when one needs to operate on each element of a sequence + of variant objects using a standard library + algorithm.)

      Returns: + + The overloads acccepting operands return the result of + applying the given visitor to the content of the given operands. + The overload accepting only a visitor return a function object, thus + delaying application of the visitor to any operands.
      Requires: + + The given visitor must fulfill the + StaticVisitor + concept requirements with respect to each of the bounded types of the + given variant.
      Throws: + + The overloads accepting operands throw only if the given + visitor throws when applied. The overload accepting only a visitor + will not throw. (Note, however, that the returned + function object + may throw when invoked.)

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 0000000000..fb6df3d3ab --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,128 @@ +The Boost C++ Libraries
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      The Boost C++ Libraries


      Table of Contents

      The Boost C++ Libraries
      Libraries Listed Alphabetically
      Libraries Listed by Category
      + String and text processing +
      + Containers +
      + Iterators +
      + Algorithms +
      + Function objects and higher-order programming +
      + Generic programming +
      + Template metaprogramming +
      + Preprocessor metaprogramming +
      + Concurrent programming +
      + Math and numerics +
      + Correctness and testing +
      + Data structures +
      + Input/Output +
      + Inter-language support +
      + Memory +
      + Parsing +
      + Miscellaneous +
      + Broken compiler workarounds +
      Boost.Any
      Introduction
      Examples
      Reference
      ValueType requirements
      Header <boost/any.hpp>
      Acknowledgements
      Boost.Array
      Introduction
      Reference
      Header <boost/array.hpp>
      Design Rationale
      Open Issues
      For more information...
      Acknowledgements
      Boost.Function
      Introduction
      History & Compatibility Notes
      Tutorial
      Basic Usage
      Free functions
      Member functions
      References to Functions
      Reference
      Definitions
      Header <boost/function.hpp>
      Frequently Asked Questions
      Miscellaneous Notes
      Boost.Function vs. Function Pointers
      Performance
      Combatting virtual function "bloat"
      Acknowledgements
      Testsuite
      Acceptance tests
      Negative tests
      Boost.Ref
      Introduction
      Reference
      Header <boost/ref.hpp>
      Acknowledgements
      Boost.Signals
      Introduction
      Tutorial
      How to Read this Tutorial
      Compatibility Note
      Hello, World! (Beginner)
      Calling multiple slots
      Passing values to and from slots
      Connection Management
      Linking against the Signals library
      Reference
      Header <boost/signal.hpp>
      Header <boost/signals/slot.hpp>
      Header <boost/signals/trackable.hpp>
      Header <boost/signals/connection.hpp>
      Header <boost/visit_each.hpp>
      Header <boost/last_value.hpp>
      Frequently Asked Questions
      Design Overview
      Type Erasure
      connection class
      Slot Call Iterator
      visit_each function template
      Design Rationale
      Choice of Slot Definitions
      User-level Connection Management
      Combiner Interface
      Connection Interfaces: += operator
      trackable rationale
      Comparison with other Signal/Slot implementations
      Testsuite
      Acceptance tests
      Boost.Variant
      Introduction
      Abstract
      Motivation
      Tutorial
      Basic Usage
      Advanced Topics
      Reference
      Concepts
      Header <boost/variant.hpp>
      Header <boost/variant/variant_fwd.hpp>
      Header <boost/variant/variant.hpp>
      Header <boost/variant/recursive_variant.hpp>
      Header <boost/variant/recursive_wrapper.hpp>
      Header <boost/variant/apply_visitor.hpp>
      Header <boost/variant/get.hpp>
      Header <boost/variant/bad_visit.hpp>
      Header <boost/variant/static_visitor.hpp>
      Header <boost/variant/visitor_ptr.hpp>
      Design Overview
      "Never-Empty" Guarantee
      Miscellaneous Notes
      Boost.Variant vs. Boost.Any
      Portability
      Troubleshooting
      Acknowledgments
      References
      The BoostBook Documentation Format
      Introduction
      Getting Started
      Configuring local DocBook XSL and DTD distributions
      Configuring Apache FOP for PostScript/PDF Output
      Configuring Doxygen for Documentation Extraction
      Documenting libraries
      Defining a BoostBook library
      From HTML to BoostBook
      Sectioning in BoostBook
      Bringing Together a BoostBook Document
      Linking in BoostBook
      Reference

      List of Examples

      1. A Skeletal BoostBook Library

      Concept reference

      This product includes software developed at the University + of Notre Dame and the Pervasive Technology Labs at Indiana + University. For technical information contact Andrew Lumsdaine + at the Pervasive Technology Labs at Indiana University. For + administrative and license questions contact the Advanced + Research and Technology Institute at 351 West 10th Street. + Indianapolis, Indiana 46202, phone 317-278-4100, fax + 317-274-5902.

      Some concepts based on versions from the MTL draft manual + and Boost Graph and Property Map documentation, the SGI Standard + Template Library documentation and the Hewlett-Packard STL, + under the following license: +

      Permission to use, copy, modify, distribute and + sell this software and its documentation for any purpose is + hereby granted without fee, provided that the above copyright + notice appears in all copies and that both that copyright + notice and this permission notice appear in supporting + documentation. Silicon Graphics makes no representations + about the suitability of this software for any purpose. It is + provided "as is" without express or implied + warranty.
      Last revised: , at GMT
      diff --git a/doc/html/libraries.html b/doc/html/libraries.html new file mode 100644 index 0000000000..10efeddcb2 --- /dev/null +++ b/doc/html/libraries.html @@ -0,0 +1,111 @@ +The Boost C++ Libraries
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      The Boost C++ Libraries

      Libraries Listed Alphabetically

      • Any - + Safe, generic container for single values of different value types + , from Kevlin Henney.
      • Array - STL compliant container wrapper for arrays of constant size, from Nicolai Josuttis.
      • Bind - Generalized binders for function/object/pointers and member functions, from Peter Dimov.
      • CRC - Cyclic Redundancy Code, from Daryle Walker.
      • Call Traits - Defines types for passing parameters, from John Maddock and Howard Hinnant.
      • Compatibility - Help for non-conforming standard libraries, from Ralf Grosse-Kunstleve and Jens Maurer.
      • Compose - Functional composition adapters for the STL, from Nicolai Josuttis.
      • Compressed Pair - Empty member optimization, from John Maddock and Howard Hinnant.
      • Concept Check - Tools for generic programming, from Jeremy Siek.
      • Config - Helps boost library developers adapt to compiler idiosyncrasies; not intended for library users, from John Maddock, Beman Dawes, and Vesa Karvonen.
      • Conversion - Numeric, polymorphic, and lexical casts, from Dave Abrahams and Kevlin Henney.
      • Date-Time - Date-Time library, from Jeff Garland.
      • Dynamic Bitset - A runtime sized version of std::bitset, from Jeremy Siek and Chuck Allison.
      • Filesystem - Portable paths, iteration over directories, and other useful filesystem operations, from Beman Dawes.
      • Format - Type-safe 'printf-like' format operations, from Samuel Krempp.
      • Function - Function object wrappers for deferred calls or callbacks, from Douglas Gregor.
      • Functional - Enhanced function object adaptors, from Mark Rodgers.
      • Graph - Generic graph components and algorithms, from Jeremy Siek and University of Notre Dame Team.
      • I/O State Savers - Save I/O state to prevent jumbled data, from Daryle Walker.
      • Integer - Headers to ease dealing with integral types, from various authors.
      • Interval - Extends the usual arithmetic functions to mathematical intervals, from Guillaume Melquiond, Hervé Brönnimann, and Sylvain Pion.
      • Iterator Adaptors - Adapt a base type into a standard conforming iterator, from Dave Abrahams, Jeremy Siek, and John Potter.
      • Lambda - Define small unnamed function objects at the actual call site, and more, from Jaakko Järvi and Gary Powell.
      • MPL - Template metaprogramming framework of compile-time algorithms, sequences and metafunction classes, from Aleksey Gurtovoy.
      • Math - Several contributions in the domain of mathematics, from various authors.
      • Math/Common Factor - Greatest common divisor and least common multiple, from Daryle Walker.
      • Math/Octonion - Octonions, from Hubert Holin.
      • Math/Quaternion - Quaternions, from Hubert Holin.
      • Math/Special Functions - Mathematical special functions such as atanh, sinc, and sinhc, from Hubert Holin.
      • Mem_fn - Generalized binders for member functions, from Peter Dimov.
      • Multi Array - Multidimensional containers and adaptors for arrays of contiguous data, from Ron Garcia.
      • Operators - Templates ease arithmetic classes and iterators, from Dave Abrahams and Jeremy Siek.
      • Optional - Discriminated-union wrapper for optional values, from Fernando Cacciola.
      • Pool - Memory pool management, from Steve Cleary.
      • Preprocessor - Preprocessor metaprogramming tools including repetition and recursion, from Vesa Karvonen and Paul Mensonides.
      • Property Map - Concepts defining interfaces which map key objects to value objects, from Jeremy Siek.
      • Python - Reflects C++ classes and functions into Python, from Dave Abrahams.
      • Random - A complete system for random number generation, from Jens Maurer.
      • Rational - A rational number class, from Paul Moore.
      • Ref - A utility library for passing references to generic functions, from Jaakko Järvi, Peter Dimov, Douglas Gregor, and Dave Abrahams.
      • Regex - Regular expression library, from John Maddock.
      • Signals - Managed signals & slots callback implementation, from Douglas Gregor.
      • Smart Pointer - Five smart pointer class templates, from Greg Colvin, Beman Dawes, Peter Dimov, and Darin Adler.
      • Spirit - LL parser framework represents parsers directly as EBNF grammars in inlined C++, from Joel de Guzman and team .
      • Static Assert - Static assertions (compile time assertions), from John Maddock.
      • Test - Support for simple program testing, full unit testing, and for program execution monitoring, from Gennadiy Rozental.
      • Threads - Portable C++ multi-threading, from William Kempf.
      • Timer - Event timer, progress timer, and progress display classes, from Beman Dawes.
      • Tokenizer - Break of a string or other character sequence into a series of tokens, from John Bandela.
      • Tuple - Ease definition of functions returning multiple values, and more, from Jaakko Järvi.
      • Type Traits - Templates for fundamental properties of types, from John Maddock, Steve Cleary, and others .
      • Utility - Class noncopyable plus checked_delete, checked_array_delete, next, prior function templates, plus base-from-member idiom, from Dave Abrahams and others .
      • Variant - Safe, generic, stack-based discriminated union container, from Eric Friedman and Itay Maman.
      • uBLAS - Basic linear algebra for dense, packed and sparse matrices, from Joerg Walter and Mathias Koch.
      Last revised: , at GMT
      diff --git a/doc/html/ref.ack.html b/doc/html/ref.ack.html new file mode 100644 index 0000000000..5a3d37098c --- /dev/null +++ b/doc/html/ref.ack.html @@ -0,0 +1,79 @@ +Acknowledgements
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Acknowledgements

      ref and cref + were originally part of the Tuple library + by Jaakko Järvi. They were "promoted to boost:: status" by + Peter Dimov because they are generally useful. Douglas Gregor and + Dave Abrahams contributed + is_reference_wrapper and + unwrap_reference.

      Last revised: , at GMTCopyright © 1999, 2000 Jaakko Järvi
      Copyright © 2001, 2002 Peter Dimov
      Copyright © 2002 David Abrahams
      diff --git a/doc/html/ref.html b/doc/html/ref.html index 00507697a8..be1fc41677 100644 --- a/doc/html/ref.html +++ b/doc/html/ref.html @@ -1,10 +1,108 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/ref.html - - +Boost.Ref
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Boost.Ref

      Jaakko Järvi

      Peter Dimov

      Douglas Gregor

      Dave Abrahams

      Permission to copy, use, modify, sell and distribute this + software is granted provided this copyright notice appears in + all copies. This software is provided "as is" without express + or implied warranty, and with no claim as to its suitability for + any purpose. +

      Introduction

      The Ref library is a small library that is useful for passing + references to function templates (algorithms) that would usually + take copies of their arguments. It defines the class template + boost::reference_wrapper<T>, + the two functions + boost::ref and + boost::cref that return + instances of boost::reference_wrapper<T>, and the + two traits classes + boost::is_reference_wrapper<T> + and + boost::unwrap_reference<T>.

      The purpose of + boost::reference_wrapper<T> is to + contain a reference to an object of type T. It is primarily used to + "feed" references to function templates (algorithms) that take their + parameter by value.

      To support this usage, + boost::reference_wrapper<T> provides an implicit + conversion to T&. This usually allows the function + templates to work on references unmodified.

      boost::reference_wrapper<T> is + both CopyConstructible and Assignable (ordinary references are not + Assignable).

      The expression boost::ref(x) + returns a + boost::reference_wrapper<X>(x) where X + is the type of x. Similarly, + boost::cref(x) returns a + boost::reference_wrapper<X const>(x).

      The expression + boost::is_reference_wrapper<T>::value + is true if T is a reference_wrapper, and + false otherwise.

      The type-expression + boost::unwrap_reference<T>::type is T::type if T + is a reference_wrapper, T otherwise.

      Last revised: March 15, 2003 at 23:12:35 GMT
      diff --git a/doc/html/ref.reference.html b/doc/html/ref.reference.html new file mode 100644 index 0000000000..fcb4068c2b --- /dev/null +++ b/doc/html/ref.reference.html @@ -0,0 +1,79 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      Header <boost/ref.hpp>

      namespace boost {
      +  template<typename T> class reference_wrapper;
      +  reference_wrapper<T> ref(T&);
      +  reference_wrapper<T const> cref(T const&);
      +  template<typename T> class is_reference_wrapper;
      +  template<typename T> class unwrap_reference;
      +}
      Last revised: , at GMTCopyright © 1999, 2000 Jaakko Järvi
      Copyright © 2001, 2002 Peter Dimov
      Copyright © 2002 David Abrahams
      diff --git a/doc/html/reference.html b/doc/html/reference.html new file mode 100644 index 0000000000..6ead429bb3 --- /dev/null +++ b/doc/html/reference.html @@ -0,0 +1,147 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      Elements:

      Last revised: , at GMTCopyright © 2003 Douglas Gregor
      diff --git a/doc/html/signals.html b/doc/html/signals.html index 61ee2ca920..0bfc1df535 100644 --- a/doc/html/signals.html +++ b/doc/html/signals.html @@ -1,10 +1,90 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/signals.html - - +Boost.Signals
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Boost.Signals

      Douglas Gregor

      Use, modification and distribution is subject to 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)

      Introduction

      The Boost.Signals library is an implementation of a managed +signals and slots system. Signals represent callbacks with multiple +targets, and are also called publishers or events in similar +systems. Signals are connected to some set of slots, which are +callback receivers (also called event targets or subscribers), which +are called when the signal is "emitted."

      Signals and slots are managed, in that signals and slots (or, +more properly, objects that occur as part of the slots) track all +connections and are capable of automatically disconnecting signal/slot +connections when either is destroyed. This enables the user to make +signal/slot connections without expending a great effort to manage the +lifetimes of those connections with regard to the lifetimes of all +objects involved.

      When signals are connected to multiple slots, there is a +question regarding the relationship between the return values of the +slots and the return value of the signals. Boost.Signals allows the +user to specify the manner in which multiple return values are +combined.

      Last revised: October 01, 2003 at 04:34:38 GMT
      diff --git a/doc/html/signals.reference.html b/doc/html/signals.reference.html new file mode 100644 index 0000000000..cdf7f2ce24 --- /dev/null +++ b/doc/html/signals.reference.html @@ -0,0 +1,103 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      namespace boost {
      +  template<typename R, typename T1, typename T2, ..., typename TN, 
      +           typename Combiner = last_value<R>, typename Group = int, 
      +           typename GroupCompare = std::less<Group>, 
      +           typename SlotFunction = functionN<R, T1, T2, ..., TN> > 
      +    class signalN;
      +  template<typename Signature, typename Allocator = std::allocator<void>, 
      +           typename Combiner = last_value<R>, typename Group = int, 
      +           typename GroupCompare = std::less<Group>, 
      +           typename SlotFunction = function<Signature> > 
      +    class signal;
      +}
      namespace boost {
      +  template<typename SlotFunction> class slot;
      +}
      namespace boost {
      +  namespace signals {
      +    class trackable;
      +  }
      +}
      namespace boost {
      +  namespace signals {
      +    class connection;
      +    void swap(connection&, connection&);
      +    class scoped_connection;
      +  }
      +}
      namespace boost {
      +  template<typename Visitor, typename T> 
      +    void visit_each(const Visitor&, const T&, int);
      +}
      namespace boost {
      +  template<typename T> class last_value;
      +
      +  template<> class last_value<void>;
      +}
      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/signals.tests.html b/doc/html/signals.tests.html new file mode 100644 index 0000000000..f7bcbcab6e --- /dev/null +++ b/doc/html/signals.tests.html @@ -0,0 +1,81 @@ +Testsuite
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Testsuite

      Acceptance tests

      TestTypeDescriptionIf failing...

      dead_slot_test.cpp

      run

      Ensure that calling connect with a slot +that has already been disconnected via deletion does not actually +connect to the slot.

       

      deletion_test.cpp

      run

      Test deletion of slots.

       

      ordering_test.cpp

      run

      Test slot group ordering.

       

      signal_n_test.cpp

      run

      Basic test of signal/slot connections and invocation using the +boost::signalN class templates.

       

      signal_test.cpp

      run

      Basic test of signal/slot connections and invocation using the +boost::signal class template.

      The boost::signal class template may not +be usable on your compiler. However, the +boost::signalN class templates may still be +usable.

      trackable_test.cpp

      run

      Test automatic lifetime management using + boost::trackable objects.

       
      Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor
      diff --git a/doc/html/variant.design.html b/doc/html/variant.design.html new file mode 100644 index 0000000000..1679878ea1 --- /dev/null +++ b/doc/html/variant.design.html @@ -0,0 +1,265 @@ +Design Overview
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Design Overview

      "Never-Empty" Guarantee

      The Guarantee

      All instances v of type + variant<T1,T2,...,TN> + guarantee that v has constructed content of one of the + types Ti, even if an operation on + v has previously failed.

      This implies that variant may be viewed precisely as + a union of exactly its bounded types. This + "never-empty" property insulates the user from the + possibility of undefined variant content and the + significant additional complexity-of-use attendant with such a + possibility.

      The Implementation Problem

      While the + never-empty guarantee + might at first seem "obvious," it is in fact not even + straightforward how to implement it in general (i.e., without + unreasonably restrictive additional requirements on + bounded types).

      The central difficulty emerges in the details of + variant assignment. Given two instances v1 + and v2 of some concrete variant type, there + are two distinct, fundamental cases we must consider for the assignment + v1 = v2.

      First consider the case that v1 and v2 + each contains a value of the same type. Call this type T. + In this situation, assignment is perfectly straightforward: use + T::operator=.

      However, we must also consider the case that v1 and + v2 contain values of distinct types. + Call these types T and U. At this point, + since variant manages its content on the stack, the + left-hand side of the assignment (i.e., v1) must destroy + its content so as to permit in-place copy-construction of the content + of the right-hand side (i.e., v2). In the end, whereas + v1 began with content of type T, it ends + with content of type U, namely a copy of the content of + v2.

      The crux of the problem, then, is this: in the event that + copy-construction of the content of v2 fails, how can + v1 maintain its "never-empty" guarantee? + By the time copy-construction from v2 is attempted, + v1 has already destroyed its content!

      The "Ideal" Solution: False Hopes

      Upon learning of this dilemma, clever individuals may propose the + following scheme hoping to solve the problem: + +

      1. Provide some "backup" storage, appropriately + aligned, capable of holding values of the contained type of the + left-hand side.
      2. Copy the memory (e.g., using memcpy) of the + storage of the left-hand side to the backup storage.
      3. Attempt a copy of the right-hand side content to the + (now-replicated) left-hand side storage.
      4. In the event of an exception from the copy, restore the + backup (i.e., copy the memory from the backup storage back into + the left-hand side storage).
      5. Otherwise, in the event of success, now copy the memory + of the left-hand side storage to another "temporary" + aligned storage.
      6. Now restore the backup (i.e., again copying the memory) + to the left-hand side storage; with the "old" content + now restored, invoke the destructor of the contained type on the + storage of the left-hand side.
      7. Finally, copy the memory of the temporary storage to the + (now-empty) storage of the left-hand side.

      While complicated, it appears such a scheme could provide the + desired safety in a relatively efficient manner. In fact, several + early iterations of the library implemented this very approach.

      Unfortunately, as Dave Abraham's first noted, the scheme results + in undefined behavior: + +

      "That's a lot of code to read through, but if it's + doing what I think it's doing, it's undefined behavior.

      "Is the trick to move the bits for an existing object + into a buffer so we can tentatively construct a new object in + that memory, and later move the old bits back temporarily to + destroy the old object?

      "The standard does not give license to do that: only one + object may have a given address at a time. See 3.8, and + particularly paragraph 4."

      Additionally, as close examination quickly reveals, the scheme has + the potential to create irreconcilable race-conditions in concurrent + environments.

      Ultimately, even if the above scheme could be made to work on + certain platforms with particular compilers, it is still necessary to + find a portable solution.

      An Initial Solution: Double Storage

      Upon learning of the infeasibility of the above scheme, Anthony + Williams proposed in + [Wil02] a scheme that served + as the basis for a portable solution in some pre-release + implementations of variant.

      The essential idea to this scheme, which shall be referred to as + the "double storage" scheme, is to provide enough space + within a variant to hold two separate values of any of + the bounded types.

      With the secondary storage, a copy the right-hand side can be + attempted without first destroying the content of the left-hand side; + accordingly, the content of the left-hand side remains available in + the event of an exception.

      Thus, with this scheme, the variant implementation + needs only to keep track of which storage contains the content -- and + dispatch any visitation requests, queries, etc. accordingly.

      The most obvious flaw to this approach is the space overhead + incurred. Though some optimizations could be applied in special cases + to eliminate the need for double storage -- for certain bounded types + or in some cases entirely (see + the section called “Enabling Optimizations” for more + details) -- many users on the Boost mailing list strongly objected to + the use of double storage. In particular, it was noted that the + overhead of double storage would be at play at all times -- even if + assignment to variant never occurred. For this reason + and others, a new approach was developed.

      Current Approach: Temporary Heap Backup

      Despite the many objections to the double storage solution, it was + realized that no replacement would be without drawbacks. Thus, a + compromise was desired.

      To this end, Dave Abrahams suggested to include the following in + the behavior specification for variant assignment: + "variant assignment from one type to another may + incur dynamic allocation." That is, while variant would + continue to store its content in situ after + construction and after assignment involving identical contained types, + variant would store its content on the heap after + assignment involving distinct contained types.

      The algorithm for assignment would proceed as follows: + +

      1. Copy-construct the content of the right-hand side to the + heap; call the pointer to this data p.
      2. Destroy the content of the left-hand side.
      3. Copy p to the left-hand side + storage.

      + + Since all operations on pointers are nothrow, this scheme would allow + variant to meet its never-empty guarantee. +

      The most obvious concern with this approach is that while it + certainly eliminates the space overhead of double storage, it + introduces the overhead of dynamic-allocation to variant + assignment -- not just in terms of the initial allocation but also + as a result of the continued storage of the content on the heap. While + the former problem is unavoidable, the latter problem may be avoided + with the following "temporary heap backup" technique: + +

      1. Copy-construct the content of the + left-hand side to the heap; call the pointer to + this data backup.
      2. Destroy the content of the left-hand side.
      3. Copy-construct the content of the right-hand side in the + (now-empty) storage of the left-hand side.
      4. In the event of failure, copy backup to the + left-hand side storage.
      5. In the event of success, deallocate the data pointed to + by backup.

      With this technique: 1) only a single storage is used; + 2) allocation is on the heap in the long-term only if the assignment + fails; and 3) after any successful assignment, + storage within the variant is guaranteed. For the + purposes of the initial release of the library, these characteristics + were deemed a satisfactory compromise solution.

      There remain notable shortcomings, however. In particular, there + may be some users for which heap allocation must be avoided at all + costs; for other users, any allocation may need to occur via a + user-supplied allocator. These issues will be addressed in the future + (see the section called “Future Direction: Policy-based Implementation”). For now, + though, the library treats storage of its content as an implementation + detail. Nonetheless, as described in the next section, there + are certain things the user can do to ensure the + greatest efficiency for variant instances (see + the section called “Enabling Optimizations” for + details).

      Enabling Optimizations

      As described in + the section called “The Implementation Problem”, the central + difficulty in implementing the never-empty guarantee is the + possibility of failed copy-construction during variant + assignment. Yet types with nothrow copy constructors clearly never + face this possibility. Similarly, if one of the bounded types of the + variant is nothrow default-constructible, then such a + type could be used as a safe "fallback" type in the event of + failed copy construction.

      Accordingly, variant is designed to enable the + following optimizations once the following criteria on its bounded + types are met: + +

      • For each bounded type T that is nothrow + copy-constructible (as indicated by + boost::has_nothrow_copy), the + library guarantees variant will use only single + storage and in-place construction for T.
      • If any bounded type is nothrow + default-constructible (as indicated by + boost::has_nothrow_constructor), + the library guarantees variant will use only single + storage and in-place construction for every + bounded type in the variant. Note, however, that in + the event of assignment failure, an unspecified nothrow + default-constructible bounded type will be default-constructed in + the left-hand side operand so as to preserve the never-empty + guarantee.

      Caveat: On most platforms, the + Type Traits templates + has_nothrow_copy and has_nothrow_constructor + by default return false for all class and + struct types. It is necessary therefore to provide + specializations of these templates as appropriate for user-defined + types, as demonstrated in the following: + +

      // ...in your code (at file scope)...
      +
      +namespace boost {
      +
      +  template <>
      +  struct has_nothrow_copy< myUDT >
      +    : mpl::true_
      +  {
      +  };
      +
      +}
      +

      Implementation Note: So as to make + the behavior of variant more predictable in the aftermath + of an exception, the current implementation prefers to default-construct + boost::blank if specified as a + bounded type instead of other nothrow default-constructible bounded + types. (If this is deemed to be a useful feature, it will become part + of the specification for variant; otherwise, it may be + obsoleted. Please provide feedback to the Boost mailing list.)

      Future Direction: Policy-based Implementation

      As the previous sections have demonstrated, much effort has been + expended in an attempt to provide a balance between performance, data + size, and heap usage. Further, significant optimizations may be + enabled in variant on the basis of certain traits of its + bounded types.

      However, there will be some users for whom the chosen compromise + is unsatisfactory (e.g.: heap allocation must be avoided at all costs; + if heap allocation is used, custom allocators must be used; etc.). For + this reason, a future version of the library will support a + policy-based implementation of variant. While this will + not eliminate the problems described in the previous sections, it will + allow the decisions regarding tradeoffs to be decided by the user + rather than the library designers.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/variant.html b/doc/html/variant.html index 193a0cec8e..a59bff600d 100644 --- a/doc/html/variant.html +++ b/doc/html/variant.html @@ -1,10 +1,151 @@ - - - - - - - Automatic redirection failed, please go to - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/variant.html - - +Boost.Variant
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Boost.Variant

      Eric Friedman

      Itay Maman

      Permission to copy, use, sell and distribute this software + is granted provided this copyright notice appears in all copies. + Permission to modify the code and to distribute modified code is + granted provided this copyright notice appears in all copies, and + a notice that the code was modified is included with the copyright + notice.

      This software is provided "as is" without express or + implied warranty, and with no claim as to its suitability for any + purpose.

      Introduction

      Abstract

      The variant class template is a safe, generic, stack-based +discriminated union container, offering a simple solution for manipulating an +object from a heterogeneous set of types in a uniform manner. Whereas +standard containers such as std::vector may be thought of as +"multi-value, single type," +variant is "multi-type, +single value."

      Notable features of boost::variant +include:

      Motivation

      Problem

      Many times, during the development of a C++ program, the +programmer finds himself in need of manipulating several distinct +types in a uniform manner. Indeed, C++ features direct language +support for such types through its union +keyword:

      union { int i; double d; } u;
      +u.d = 3.14;
      +u.i = 3; // overwrites u.d (OK: u.d is a POD type)

      C++'s union construct, however, is nearly +useless in an object-oriented environment. The construct entered +the language primarily as a means for preserving compatibility with +C, which supports only POD (Plain Old Data) types, and so does not +accept types exhibiting non-trivial construction or +destruction:

      union {
      +  int i;
      +  std::string s; // illegal: std::string is not a POD type!
      +} u;

      Clearly another approach is required. Typical solutions +feature the dynamic-allocation of objects, which are subsequently +manipulated through a common base type (often a virtual base class + [Hen01] +or, more dangerously, a void*). Objects of +concrete type may be then retrieved by way of a polymorphic downcast +construct (e.g., dynamic_cast, +boost::any_cast, etc.).

      However, solutions of this sort are highly error-prone, due +to the following:

      • Downcast errors cannot be detected at + compile-time. Thus, incorrect usage of downcast + constructs will lead to bugs detectable only at run-time.
      • Addition of new concrete types may be + ignored. If a new concrete type is added to the + hierarchy, existing downcast code will continue to work as-is, + wholly ignoring the new type. Consequently, the programmer must + manually locate and modify code at numerous locations, which often + results in run-time errors that are difficult to find.

      Furthermore, even when properly implemented, these solutions tend +to incur a relatively significant abstraction penalty due to the use of +the heap, virtual function calls, and polymorphic downcasts.

      Solution: A Motivating Example

      The boost::variant class template +addresses these issues in a safe, straightforward, and efficient manner. The +following example demonstrates how the class can be used:

      #include "boost/variant.hpp"
      +#include <iostream>
      +
      +class my_visitor : public boost::static_visitor<int>
      +{
      +public:
      +    int operator()(int i) const
      +    {
      +        return i;
      +    }
      +    
      +    int operator()(const std::string & str) const
      +    {
      +        return str.length();
      +    }
      +};
      +
      +int main()
      +{
      +    boost::variant< int, std::string > u("hello world");
      +    std::cout << u; // output: hello world
      +
      +    int result = boost::apply_visitor( my_visitor(), u );
      +    std::cout << result; // output: 11 (i.e., length of "hello world")
      +}
      +
      Last revised: , at GMT
      diff --git a/doc/html/variant.misc.html b/doc/html/variant.misc.html new file mode 100644 index 0000000000..79700e7fef --- /dev/null +++ b/doc/html/variant.misc.html @@ -0,0 +1,140 @@ +Miscellaneous Notes
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Miscellaneous Notes

      Boost.Variant vs. Boost.Any

      As a discriminated union container, the Variant library shares many + of the same features of the Any library. + However, since neither library wholly encapsulates the features of the + other, one library cannot be generally recommended for use over the + other.

      That said, Boost.Variant has several advantages over Boost.Any, + such as: + +

      • Boost.Variant guarantees the type of its content is one of a + finite, user-specified set of types.
      • Boost.Variant provides compile-time + checked visitation of its content. (By contrast, the current version + of Boost.Any provides no visitation mechanism at all; but even if it + did, it would need to be checked at run-time.)
      • Boost.Variant enables generic visitation of its content. + (Even if Boost.Any did provide a visitation mechanism, it would enable + visitation only of explicitly-specified types.)
      • Boost.Variant offers an efficient, stack-based storage scheme + (avoiding the overhead of dynamic allocation).

      Of course, Boost.Any has several advantages over Boost.Variant, + such as: + +

      • Boost.Any, as its name implies, allows virtually any type for + its content, providing great flexibility.
      • Boost.Any provides the no-throw guarantee of exception safety + for its swap operation.
      • Boost.Any makes little use of template metaprogramming + techniques (avoiding potentially hard-to-read error messages and + significant compile-time processor and memory demands).

      Portability

      The library aims for 100% ANSI/ISO C++ conformance. However, this is + strictly impossible due to the inherently non-portable nature of the + Type Traits library's + type_with_alignment facility. In + practice though, no compilers or platforms have been discovered where this + reliance on undefined behavior has been an issue.

      Additionally, significant effort has been expended to ensure proper + functioning despite various compiler bugs and other conformance problems. + To date the library testsuite has + been compiled and tested successfully on at least the following compilers + for basic and advanced functionality: + +

       Basicvariant<T&>make_variant_overmake_recursive_variant
      Borland C++ 5.5.1 and 5.6.4XX  
      Comeau C++ 4.3.0XXXX
      GNU GCC 3.3.1XXXX
      GNU GCC 2.95.3XX X
      Intel C++ 7.0X XX
      Metrowerks CodeWarrior 8.3X XX
      Microsoft Visual C++ 7.1XXXX
      Microsoft Visual C++ 6 SP5 and 7X   

      Finally, the current state of the testsuite in CVS may be found on the + Test Summary + page. Please note, however, that this page reports on day-to-day changes + to inter-release code found in the Boost CVS and thus likely does not + match the state of code found in Boost releases.

      Troubleshooting

      Due to the heavy use of templates in the implementation of + variant, it is not uncommon when compiling to encounter + problems related to template instantiaton depth, compiler memory, etc. This + section attempts to provide advice to common problems experienced on several + popular compilers.

      (This section is still in progress, with additional advice/feedback + welcome. Please post to the Boost-Users list with any useful experiences you + may have.)

      "Template instantiation depth exceeds maximum"
      GNU GCC

      The compiler option + -ftemplate-depth-NN can increase the + maximum allowed instantiation depth. (Try + -ftemplate-depth-50.)

      "Internal heap limit reached"
      Microsoft Visual C++

      The compiler option /ZmNNN can + increase the memory allocation limit. The NNN is a + scaling percentage (i.e., 100 denotes the default limit). + (Try /Zm200.)

      Acknowledgments

      Eric Friedman and Itay Maman designed the initial submission; Eric was + the primary implementer.

      Eric is also the library maintainer and has expanded upon the initial + submission -- adding + make_recursive_variant, + make_variant_over, support for + reference content, etc.

      Andrei Alexandrescu's work in + [Ale01a] +and + [Ale02] +inspired the library's design.

      Jeff Garland was the formal review manager.

      Douglas Gregor, +Dave Abrahams, +Anthony Williams, +Fernando Cacciola, +Joel de Guzman, +Dirk Schreib, +Brad King, +Giovanni Bajo, +Eugene Gladyshev, +and others provided helpful feedback and suggestions to refine the semantics, +interface, and implementation of the library.

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/variant.reference.html b/doc/html/variant.reference.html new file mode 100644 index 0000000000..1351e10048 --- /dev/null +++ b/doc/html/variant.reference.html @@ -0,0 +1,210 @@ +Reference
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Reference

      Concepts

      BoundedType

      The requirements on a bounded type + are as follows:

      • CopyConstructible [20.1.3].
      • Destructor upholds the no-throw exception-safety + guarantee.
      • Complete at the point of variant template + instantiation. (See + boost::recursive_wrapper<T> + for a type wrapper that accepts incomplete types to enable recursive + variant types.)

      Every type specified as a template argument to + variant must at minimum fulfill the + above requirements. In addition, certain features of variant + are available only if its bounded types meet the requirements of these + following additional concepts:

      • Assignable: + variant is itself Assignable if and + only if every one of its bounded types meets the requirements of the + concept. (Note that top-level const-qualified types and + reference types do not meet these + requirements.)
      • DefaultConstructible [20.1.4]: + variant is itself + DefaultConstructible if and only if its first + bounded type (i.e., T1) meets the requirements of the + concept.
      • EqualityComparable: + variant is itself EqualityComparable + if and only if every one of its bounded types meets the requirements + of the concept.
      • LessThanComparable: + variant is itself LessThanComparable + if and only if every one of its bounded types meets the requirements + of the concept.
      • OutputStreamable: + variant is itself OutputStreamable + if and only if every one of its bounded types meets the requirements + of the concept.
      StaticVisitor

      The requirements on a static + visitor of a type T are as follows:

      • Must allow invocation as a function by overloading + operator(), unambiguously accepting any value of type + T.
      • Must expose inner type result_type. (See + boost::visitor_ptr for a + solution to using functions as visitors.)
      • If result_type is not void, then + each operation of the function object must return a value implicitly + convertible to result_type.
      Examples

      The following class satisfies the requirements of a static visitor + of several types (i.e., explicitly: int and + std::string; or, e.g., implicitly: short and + const char *; etc.):

      class my_visitor
      +    : public boost::static_visitor<int>
      +{
      +public:
      +
      +    int operator()(int i)
      +    {
      +        return i * 2;
      +    }
      +
      +    int operator()(const std::string& s)
      +    {
      +        return s.length();
      +    }
      +
      +};

      Another example is the following class, whose function-call + operator is a member template, allowing it to operate on values of many + types. Thus, the following class is a visitor of any type that supports + streaming output (e.g., int, double, + std::string, etc.):

      class printer
      +    : public boost::static_visitor<>
      +{
      +    template <typename T>
      +    void operator()(const T& t)
      +    {
      +        std::cout << t << std::endl;
      +    }
      +};
      OutputStreamable

      The requirements on an output + streamable type T are as follows:

      • For any object t of type T, + std::cout << t must be a valid + expression.

      This header exists simply as a convenience to the user, including + all of the headers in the boost/variant directory.

      namespace boost {
      +  template<typename T1, typename T2 = unspecified, ..., 
      +           typename TN = unspecified> 
      +    class variant;
      +
      +  template<typename Sequence> class make_variant_over;
      +  template<typename T1, typename T2, ..., typename TN> 
      +    void swap(variant<T1, T2, ..., TN> &, variant<T1, T2, ..., TN> &);
      +  template<typename ElemType, typename Traits, typename T1, typename T2, ..., 
      +           typename TN> 
      +    std::basic_ostream<ElemType,Traits> & 
      +    operator<<(std::basic_ostream<ElemType,Traits> &, 
      +               const variant<T1, T2, ..., TN> &);
      +}
      namespace boost {
      +  typedef unspecified recursive_variant_;
      +
      +  template<typename T1, typename T2 = unspecified, ..., 
      +           typename TN = unspecified> 
      +    class make_recursive_variant;
      +  template<typename Sequence> class make_recursive_variant_over;
      +}
      namespace boost {
      +  template<typename T> class recursive_wrapper;
      +  template<typename T> class is_recursive_wrapper;
      +  template<typename T> class unwrap_recursive_wrapper;
      +}
      namespace boost {
      +  template<typename Visitor> class apply_visitor_delayed_t;
      +  template<typename Visitor, typename Variant> 
      +    typename Visitor::result_type apply_visitor(Visitor &, Variant &);
      +  template<typename Visitor, typename Variant> 
      +    typename Visitor::result_type apply_visitor(const Visitor &, Variant &);
      +  template<typename BinaryVisitor, typename Variant1, typename Variant2> 
      +    typename BinaryVisitor::result_type 
      +    apply_visitor(BinaryVisitor &, Variant1 &, Variant2 &);
      +  template<typename BinaryVisitor, typename Variant1, typename Variant2> 
      +    typename BinaryVisitor::result_type 
      +    apply_visitor(const BinaryVisitor &, Variant1 &, Variant2 &);
      +  template<typename Visitor> 
      +    apply_visitor_delayed_t<Visitor> apply_visitor(Visitor &);
      +}
      namespace boost {
      +  class bad_get;
      +  template<typename U, typename T1, typename T2, ..., typename TN> 
      +    U * get(variant<T1, T2, ..., TN> *);
      +  template<typename U, typename T1, typename T2, ..., typename TN> 
      +    const U * get(const variant<T1, T2, ..., TN> *);
      +  template<typename U, typename T1, typename T2, ..., typename TN> 
      +    U & get(variant<T1, T2, ..., TN> &);
      +  template<typename U, typename T1, typename T2, ..., typename TN> 
      +    const U & get(const variant<T1, T2, ..., TN> &);
      +}
      namespace boost {
      +  class bad_visit;
      +}
      namespace boost {
      +  template<typename ResultType> class static_visitor;
      +}
      namespace boost {
      +  template<typename T, typename R> class visitor_ptr_t;
      +  template<typename R, typename T> visitor_ptr_t<T,R> visitor_ptr(R (*)(T));
      +}
      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/variant.refs.html b/doc/html/variant.refs.html new file mode 100644 index 0000000000..8b2740adb0 --- /dev/null +++ b/doc/html/variant.refs.html @@ -0,0 +1,149 @@ +References
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      References

      [Abr00] + David Abrahams. + "Exception-Safety in Generic Components." + M. Jazayeri, R. Loos, D. Musser (eds.): + Generic Programming '98, Proc. of a Dagstuhl Seminar, Lecture Notes on Computer Science, Vol. 1766, pp. 69-79. + Springer-Verlag Berlin Heidelberg. + 2000. +

      [Abr01] + David Abrahams. + "Error and Exception Handling." + Boost technical article. + 2001-2003. +

      [Ale01a] + Andrei Alexandrescu. + "An Implementation of Discriminated Unions in C++." + OOPSLA 2001, Second Workshop on C++ Template Programming. + Tampa Bay, 14 October 2001. +

      [Ale01b] + Andrei Alexandrescu. + Modern C++ Design. + Addison-Wesley, C++ In-Depth series. + 2001. +

      [Ale02] + Andrei Alexandrescu. + "Generic<Programming>: Discriminated Unions" series: + Part 1, + Part 2, + Part 3. + C/C++ Users Journal. + 2002. +

      [Boo02] + Various Boost members. + "Proposal --- A type-safe union." + Boost public discussion. + 2002. +

      + [C++98] + International Standard, Programming Languages – C++. + ISO/IEC:14882. + 1998. +

      + [GoF95] + Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. + Design Patterns: Elements of Reusable Object-Oriented Software. + Addison-Wesley. + 1995. +

      [Gre02] + Douglas Gregor. + "BOOST_USER: variant." + Boost Wiki paper. + 2002. +

      [Gur02] + Aleksey Gurtovoy. + Boost Metaprogramming Library. + 2002. +

      [Hen01] + Kevlin Henney. + Boost Any Library. + 2001. +

      [MK02] + Paul Mensonides and Vesa Karvonen. + Boost Preprocessor Library. + 2002. +

      [MCD+01] + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, John Maddock, Jeremy Siek. + Boost Type Traits Library. + 2001. +

      [Sut00] + Herb Sutter. + Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions. + Addison-Wesley, C++ In-Depth series. + 2000. +

      [Wil02] + Anthony Williams. + Double-Storage Proposal. + 2002. +

      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman
      diff --git a/doc/html/variant.tutorial.html b/doc/html/variant.tutorial.html new file mode 100644 index 0000000000..bce240e110 --- /dev/null +++ b/doc/html/variant.tutorial.html @@ -0,0 +1,457 @@ +Tutorial
      c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

      Tutorial

      Basic Usage

      A discriminated union container on some set of types is defined by + instantiating the boost::variant class + template with the desired types. These types are called + bounded types and are subject to the + requirements of the + BoundedType + concept. Any number of bounded types may be specified, up to some + implementation-defined limit (see + BOOST_VARIANT_LIMIT_TYPES).

      For example, the following declares a discriminated union container on + int and std::string: + +

      boost::variant< int, std::string > v;

      By default, a variant default-constructs its first + bounded type, so v initially contains int(0). If + this is not desired, or if the first bounded type is not + default-constructible, a variant can be constructed + directly from any value convertible to one of its bounded types. Similarly, + a variant can be assigned any value convertible to one of its + bounded types, as demonstrated in the following: + +

      v = "hello";

      Now v contains a std::string equal to + "hello". We can demonstrate this by + streamingv to standard + output: + +

      std::cout << v << std::endl;

      Usually though, we would like to do more with the content of a + variant than streaming. Thus, we need some way to access the + contained value. There are two ways to accomplish this: + apply_visitor, which is safest + and very powerful, and + get<T>, which is + sometimes more convenient to use.

      For instance, suppose we wanted to concatenate to the string contained + in v. With value retrieval + by get, this may be accomplished + quite simply, as seen in the following: + +

      std::string& str = boost::get<std::string>(v);
      +str += " world! ";

      As desired, the std::string contained by v now + is equal to "hello world! ". Again, we can demonstrate this by + streaming v to standard output: + +

      std::cout << v << std::endl;

      While use of get is perfectly acceptable in this trivial + example, get generally suffers from several significant + shortcomings. For instance, if we were to write a function accepting a + variant<int, std::string>, we would not know whether + the passed variant contained an int or a + std::string. If we insisted upon continued use of + get, we would need to query the variant for its + contained type. The following function, which "doubles" the + content of the given variant, demonstrates this approach: + +

      void times_two( boost::variant< int, std::string > & operand )
      +{
      +    if ( int* pi = boost::get<int>( &v ) )
      +        *pi *= 2;
      +    else if ( std::string* pstr = boost::get<std::string>( &v ) )
      +        *pstr += *pstr;
      +}

      However, such code is quite brittle, and without careful attention will + likely lead to the introduction of subtle logical errors detectable only at + runtime. For instance, consider if we wished to extend + times_two to operate on a variant with additional + bounded types. Specifically, let's add + std::complex<double> to the set. Clearly, we would need + to at least change the function declaration: + +

      void times_two( boost::variant< int, std::string, std::complex<double> > & operand )
      +{
      +    // as above...?
      +}

      Of course, additional changes are required, for currently if the passed + variant in fact contained a std::complex value, + times_two would silently return -- without any of the desired + side-effects and without any error. In this case, the fix is obvious. But in + more complicated programs, it could take considerable time to identify and + locate the error in the first place.

      Thus, real-world use of variant typically demands an access + mechanism more robust than get. For this reason, + variant supports compile-time checked + visitation via + apply_visitor. Visitation requires + that the programmer explicitly handle (or ignore) each bounded type. Failure + to do so results in a compile-time error.

      Visitation of a variant requires a visitor object. The + following demonstrates one such implementation of a visitor implementating + behavior identical to times_two: + +

      class times_two_visitor
      +    : public boost::static_visitor<>
      +{
      +public:
      +
      +    void operator()(int & i) const
      +    {
      +        i *= 2;
      +    }
      +
      +    void operator()(std::string & str) const
      +    {
      +        str += str;
      +    }
      +
      +};

      With the implementation of the above visitor, we can then apply it to + v, as seen in the following: + +

      boost::apply_visitor( times_two_visitor(), v );

      As expected, the content of v is now a + std::string equal to "hello world! hello world! ". + (We'll skip the verification this time.)

      In addition to enhanced robustness, visitation provides another + important advantage over get: the ability to write generic + visitors. For instance, the following visitor will "double" the + content of anyvariant (provided its + bounded types each support operator+=): + +

      class times_two_generic
      +    : public boost::static_visitor<>
      +{
      +public:
      +
      +    template <typename T>
      +    void operator()( T & operand ) const
      +    {
      +        operand += operand;
      +    }
      +
      +};

      Again, apply_visitor sets the wheels in motion: + +

      boost::apply_visitor( times_two_generic(), v );

      While the initial setup costs of visitation may exceed that required for + get, the benefits quickly become significant. Before concluding + this section, we should explore one last benefit of visitation with + apply_visitor: + delayed visitation. Namely, a special form + of apply_visitor is available that does not immediately apply + the given visitor to any variant but rather returns a function + object that operates on any variant given to it. This behavior + is particularly useful when operating on sequences of variant + type, as the following demonstrates: + +

      std::vector< boost::variant<int, std::string> > vec;
      +vec.push_back( 21 );
      +vec.push_back( "hello " );
      +
      +times_two_generic visitor;
      +std::for_each(
      +      vec.begin(), vec.end()
      +   , boost::apply_visitor(visitor)
      +   );

      Advanced Topics

      This section discusses several features of the library often required + for advanced uses of variant. Unlike in the above section, each + feature presented below is largely independent of the others. Accordingly, + this section is not necessarily intended to be read linearly or in its + entirety.

      Preprocessor macros

      While the variant class template's variadic parameter + list greatly simplifies use for specific instantiations of the template, + it significantly complicates use for generic instantiations. For instance, + while it is immediately clear how one might write a function accepting a + specific variant instantiation, say + variant<int, std::string>, it is less clear how one + might write a function accepting any given variant.

      Due to the lack of support for true variadic template parameter lists + in the C++98 standard, the preprocessor is needed. While the + Preprocessor library provides a general and + powerful solution, the need to repeat + BOOST_VARIANT_LIMIT_TYPES + unnecessarily clutters otherwise simple code. Therefore, for common + use-cases, this library provides its own macro + BOOST_VARIANT_ENUM_PARAMS.

      This macro simplifies for the user the process of declaring + variant types in function templates or explicit partial + specializations of class templates, as shown in the following: + +

      // general cases
      +template <typename T> void some_func(const T &);
      +template <typename T> class some_class;
      +
      +// function template overload
      +template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
      +void some_func(const boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> &);
      +
      +// explicit partial specialization
      +template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
      +class some_class< boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >;
      Using a type sequence to specify bounded types

      While convenient for typical uses, the variant class + template's variadic template parameter list is limiting in two significant + dimensions. First, due to the lack of support for true variadic template + parameter lists in C++, the number of parameters must be limited to some + implementation-defined maximum (namely, + BOOST_VARIANT_LIMIT_TYPES). + Second, the nature of parameter lists in general makes compile-time + manipulation of the lists excessively difficult.

      To solve these problems, + make_variant_over< Sequence > + exposes a variant whose bounded types are the elements of + Sequence (where Sequence is any type fulfilling + the requirements of MPL's + Sequence concept). For instance, + +

      typedef mpl::vector< std::string > types_initial;
      +typedef mpl::push_front< types_initial, int >::type types;
      +
      +boost::make_variant_over< types >::type v1;

      + + behaves equivalently to + +

      boost::variant< int, std::string > v2;

      Portability: Unfortunately, due to + standard conformance issues in several compilers, + make_variant_over is not universally available. On these + compilers the library indicates its lack of support for the syntax via the + definition of the preprocessor symbol + BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.

      Recursive variant types

      Recursive types facilitate the construction of complex semantics from + simple syntax. For instance, nearly every programmer is familiar with the + canonical definition of a linked list implementation, whose simple + definition allows sequences of unlimited length: + +

      template <typename T>
      +struct list_node
      +{
      +    T data;
      +    list_node * next;
      +};

      The nature of variant as a generic class template + unfortunately precludes the straightforward construction of recursive + variant types. Consider the following attempt to construct + a structure for simple mathematical expressions: + +

      struct add;
      +struct sub;
      +template <typename OpTag> struct binary_op;
      +
      +typedef boost::variant<
      +      int
      +    , binary_op<add>
      +    , binary_op<sub>
      +    > expression;
      +
      +template <typename OpTag>
      +struct binary_op
      +{
      +    expression left;  // variant instantiated here...
      +    expression right;
      +
      +    binary_op( const expression & lhs, const expression & rhs )
      +        : left(lhs), right(rhs)
      +    {
      +    }
      +
      +}; // ...but binary_op not complete until here!

      While well-intentioned, the above approach will not compile because + binary_op is still incomplete when the variant + type expression is instantiated. Further, the approach suffers + from a more significant logical flaw: even if C++ syntax were different + such that the above example could be made to "work," + expression would need to be of infinite size, which is + clearly impossible.

      To overcome these difficulties, variant includes special + support for the + boost::recursive_wrapper class + template, which breaks the circular dependency at the heart of these + problems. Further, + boost::make_recursive_variant provides + a more convenient syntax for declaring recursive variant + types. Tutorials for use of these facilities is described in + the section called “Recursive types with recursive_wrapper” and + the section called “Recursive types with make_recursive_variant”.

      Recursive types with recursive_wrapper

      The following example demonstrates how recursive_wrapper + could be used to solve the problem presented in + the section called “Recursive variant types”: + +

      typedef boost::variant<
      +      int
      +    , boost::recursive_wrapper< binary_op<add> >
      +    , boost::recursive_wrapper< binary_op<sub> >
      +    > expression;

      Because variant provides special support for + recursive_wrapper, clients may treat the resultant + variant as though the wrapper were not present. This is seen + in the implementation of the following visitor, which calculates the value + of an expression without any reference to + recursive_wrapper: + +

      class calculator : public boost::static_visitor<int>
      +{
      +public:
      +
      +    int operator()(int value) const
      +    {
      +        return value;
      +    }
      +
      +    int operator()(const binary_op<add> & binary) const
      +    {
      +        return boost::apply_visitor( calculator(), binary.left )
      +             + boost::apply_visitor( calculator(), binary.right );
      +    }
      +
      +    int operator()(const binary_op<sub> & binary) const
      +    {
      +        return boost::apply_visitor( calculator(), binary.left )
      +             - boost::apply_visitor( calculator(), binary.right );
      +    }
      +
      +};

      Finally, we can demonstrate expression in action: + +

      void f()
      +{
      +    // result = ((7-3)+8) = 12
      +    expression result(
      +        binary_op<add>(
      +            binary_op<sub>(7,3)
      +          , 8
      +          )
      +      );
      +
      +    assert( boost::apply_visitor(calculator(),result) == 12 );
      +}
      Recursive types with make_recursive_variant

      For some applications of recursive variant types, a user + may be able to sacrifice the full flexibility of using + recursive_wrapper with variant for the following + convenient syntax: + +

      typedef boost::make_recursive_variant<
      +      int
      +    , std::vector< boost::recursive_variant_ >
      +    >::type int_tree_t;

      Use of the resultant variant type is as expected: + +

      std::vector< int_tree_t > subresult;
      +subresult.push_back(3);
      +subresult.push_back(5);
      +
      +std::vector< int_tree_t > result;
      +result.push_back(1);
      +result.push_back(subresult);
      +result.push_back(7);
      +
      +int_tree_t var(result);

      To be clear, one might represent the resultant content of + var as ( 1 ( 3 5 ) 7 ).

      Finally, note that a type sequence can be used to specify the bounded + types of a recursive variant via the use of + boost::make_recursive_variant_over, + whose semantics are the same as make_variant_over (which is + described in the section called “Using a type sequence to specify bounded types”).

      Portability: Unfortunately, due to + standard conformance issues in several compilers, + make_recursive_variant is not universally supported. On these + compilers the library indicates its lack of support via the definition + of the preprocessor symbol + BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT. + Thus, unless working with highly-conformant compilers, maximum portability + will be achieved by instead using recursive_wrapper, as + described in + the section called “Recursive types with recursive_wrapper”.

      Binary visitation

      As the tutorial above demonstrates, visitation is a powerful mechanism + for manipulating variant content. Binary visitation further + extends the power and flexibility of visitation by allowing simultaneous + visitation of the content of two different variant + objects.

      Notably this feature requires that binary visitors are incompatible + with the visitor objects discussed in the tutorial above, as they must + operate on two arguments. The following demonstrates the implementation of + a binary visitor: + +

      class are_strict_equals
      +    : public boost::static_visitor<bool>
      +{
      +public:
      +
      +    template <typename T, typename U>
      +    bool operator()( const T &, const U & )
      +    {
      +        return false; // cannot compare different types
      +    }
      +
      +    template <typename T>
      +    bool operator()( const T & lhs, const T & rhs )
      +    {
      +        return lhs == rhs;
      +    }
      +
      +};

      As expected, the visitor is applied to two variant + arguments by means of apply_visitor: + +

      boost::variant< int, std::string > v1( "hello" );
      +
      +boost::variant< double, std::string > v2( "hello" );
      +assert( boost::apply_visitor(are_strict_equals(), v1, v2) );
      +
      +boost::variant< int, const char * > v3( "hello" );
      +assert( !boost::apply_visitor(are_strict_equals(), v1, v3) );

      Finally, we must note that the function object returned from the + "delayed" form of + apply_visitor also supports + binary visitation, as the following demonstrates: + +

      typedef boost::variant<double, std::string> my_variant;
      +
      +std::vector< my_variant > seq1;
      +seq1.push_back("pi is close to ");
      +seq1.push_back(3.14);
      +
      +std::list< my_variant > seq2;
      +seq2.push_back("pi is close to ");
      +seq2.push_back(3.14);
      +
      +are_strict_equals visitor;
      +assert( std::equal(
      +      v1.begin(), v1.end(), v2.begin()
      +    , boost::apply_visitor( visitor )
      +    ) );
      Last revised: , at GMTCopyright © 2002, 2003 Eric Friedman, Itay Maman