From b5d27a81749b9a2b496b928d431d1a71158a7993 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 17 Oct 2013 11:54:24 +0400 Subject: [PATCH] Docs regeneration, after fixing issues mentioned by Niall Douglas --- boost/template_id.html | 2 +- boost/template_id_with_cvr.html | 4 +- boost/template_index.html | 46 ++++++------ boost/type_id.html | 2 +- ...6.html => type_id_rtti_on_idp5760464.html} | 12 +-- ...2.html => type_id_rtti_on_idp5763792.html} | 14 ++-- boost/type_id_with_cvr.html | 10 +-- boost/type_index.html | 58 +++++++------- boost_typeindex/code_bloat.html | 66 ++++++++++++++++ boost_typeindex/compiler_support.html | 13 ++-- boost_typeindex/examples.html | 31 +++++--- boost_typeindex/performance.html | 63 ---------------- boost_typeindex/space_and_performance.html | 75 +++++++++++++++++++ boost_typeindex_header_reference.html | 8 +- index.html | 7 +- standalone_HTML.manifest | 7 +- 16 files changed, 255 insertions(+), 163 deletions(-) rename boost/{type_id_rtti_on_idp5366896.html => type_id_rtti_on_idp5760464.html} (89%) rename boost/{type_id_rtti_on_idp5370032.html => type_id_rtti_on_idp5763792.html} (81%) create mode 100644 boost_typeindex/code_bloat.html delete mode 100644 boost_typeindex/performance.html create mode 100644 boost_typeindex/space_and_performance.html diff --git a/boost/template_id.html b/boost/template_id.html index f1697a9..89cb0f5 100644 --- a/boost/template_id.html +++ b/boost/template_id.html @@ -34,7 +34,7 @@ template<typename T> template_index template_id();
-

Description

+

Description

Method for constructing template_index instance for type T. Strips const, volatile and & modifiers from T.

diff --git a/boost/template_id_with_cvr.html b/boost/template_id_with_cvr.html index 045ba93..0fbb675 100644 --- a/boost/template_id_with_cvr.html +++ b/boost/template_id_with_cvr.html @@ -34,8 +34,8 @@ template<typename T> template_index template_id_with_cvr();
-

Description

-

Factory method for constructing template_index instance for type T. Does not strips const, volatile and & modifiers from T. If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling `template_id<T>()`.

+

Description

+

Factory method for constructing template_index instance for type T. Does not strip const, volatile and & modifiers from T. If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling `template_id<T>()`.

diff --git a/boost/template_index.html b/boost/template_index.html index 2657f34..5a4895c 100644 --- a/boost/template_index.html +++ b/boost/template_index.html @@ -35,60 +35,60 @@ classtemplate_index{public:// construct/copy/destruct - template_index(); + template_index(); - // public member functions - boolbefore(consttemplate_index&)const; - constchar*name()const; - std::stringname_demangled()const; - std::size_thash_code()const; + // public member functions + boolbefore(consttemplate_index&)const; + constchar*name()const; + std::stringname_demangled()const; + std::size_thash_code()const; - // public static functions - template<typename T>statictemplate_indexconstruct(); - template<typename T>statictemplate_indexconstruct_with_cvr(); + // public static functions + template<typename T>statictemplate_indexconstruct(); + template<typename T>statictemplate_indexconstruct_with_cvr();};
-

Description

+

Description

Copyable type_info that does not require RTTI and could store const, volatile and references if constructed via construct_with_cvr()

-

+

template_index public construct/copy/destruct

  1. -
    template_index();
    +
    template_index();

    Default constructor.

-

-template_index public member functions

+

+template_index public member functions

  1. -
    bool before(const template_index & rhs) const;
    +
    bool before(const template_index & rhs) const;

    Returns true if the type precedes the type of rhs in the collation order. The collation order is just an internal order.

  2. -
    const char * name() const;
    Returns raw name.
  3. +
    const char * name() const;
    Returns raw name.
  4. -
    std::string name_demangled() const;
    Returns user-friendly name.
  5. +
    std::string name_demangled() const;
    Returns user-friendly name.
  6. -
    std::size_t hash_code() const;
    +
    std::size_t hash_code() const;

    Function for getting hash value

-

-template_index public static functions

+

+template_index public static functions

  1. -
    template<typename T> static template_index construct();
    +
    template<typename T> static template_index construct();

    Factory method for constructing template_index instance for type T. Strips const, volatile and & modifiers from T

  2. -
    template<typename T> static template_index construct_with_cvr();
    -

    Factory method for constructing template_index instance for type T. Does not strips const, volatile and & modifiers from T

    +
    template<typename T> static template_index construct_with_cvr();
    +

    Factory method for constructing template_index instance for type T. Does not strip const, volatile and & modifiers from T

diff --git a/boost/type_id.html b/boost/type_id.html index 11d4a46..ead5675 100644 --- a/boost/type_id.html +++ b/boost/type_id.html @@ -34,7 +34,7 @@ template<typename T> type_index type_id();
-

Description

+

Description

Function, to get type_index for a type T. Strips const, volatile and & modifiers from T.

diff --git a/boost/type_id_rtti_on_idp5366896.html b/boost/type_id_rtti_on_idp5760464.html similarity index 89% rename from boost/type_id_rtti_on_idp5366896.html rename to boost/type_id_rtti_on_idp5760464.html index 4f9cfba..25973d8 100644 --- a/boost/type_id_rtti_on_idp5366896.html +++ b/boost/type_id_rtti_on_idp5760464.html @@ -7,7 +7,7 @@ - +
@@ -20,10 +20,10 @@

-PrevUpHomeNext +PrevUpHomeNext
-
+

Function template type_id_rtti_only

boost::type_id_rtti_only

@@ -34,8 +34,8 @@ template<typename T> type_index type_id_rtti_only(T & rtti_val);
-

Description

-

Function, that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. This method available only with RTTI enabled.

+

Description

+

Function, that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. This method available only with RTTI enabled. Without RTTI support it won't compile, producing a compile-time error with message: "boost::type_id_rtti_only(T&) requires RTTI"

@@ -48,7 +48,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_id_rtti_on_idp5370032.html b/boost/type_id_rtti_on_idp5763792.html similarity index 81% rename from boost/type_id_rtti_on_idp5370032.html rename to boost/type_id_rtti_on_idp5763792.html index fd821e8..0abdbff 100644 --- a/boost/type_id_rtti_on_idp5370032.html +++ b/boost/type_id_rtti_on_idp5763792.html @@ -6,8 +6,8 @@ - - + + @@ -20,10 +20,10 @@

-PrevUpHomeNext +PrevUpHomeNext
-
+

Function template type_id_rtti_only

boost::type_id_rtti_only

@@ -34,8 +34,8 @@ template<typename T> type_index type_id_rtti_only(T * rtti_val);
-

Description

-

Function, that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. This method available only with RTTI enabled.

+

Description

+

Function, that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. This method available only with RTTI enabled. Without RTTI support it won't compile, producing a compile-time error with message: "boost::type_id_rtti_only(T*) requires RTTI"

@@ -48,7 +48,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_id_with_cvr.html b/boost/type_id_with_cvr.html index f61993a..a32090b 100644 --- a/boost/type_id_with_cvr.html +++ b/boost/type_id_with_cvr.html @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext
@@ -34,8 +34,8 @@ template<typename T> type_index type_id_with_cvr();
-

Description

-

Function for constructing type_index instance for type T. Does not strips const, volatile, & and && modifiers from T. If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling `type_id<T>()`.

+

Description

+

Function for constructing type_index instance for type T. Does not strip const, volatile, & and && modifiers from T. If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling `type_id<T>()`.

@@ -48,7 +48,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_index.html b/boost/type_index.html index 0211ecb..ae5bcdc 100644 --- a/boost/type_index.html +++ b/boost/type_index.html @@ -38,69 +38,69 @@ typedef std::type_info stl_type_info; // construct/copy/destruct - type_index(); - explicit type_index(const stl_type_info &); + type_index(); + explicit type_index(const stl_type_info &); - // public member functions - bool before(type_index const &) const; - const char * name() const; - std::string name_demangled() const; - std::size_t hash_code() const; + // public member functions + bool before(type_index const &) const; + const char * name() const; + std::string name_demangled() const; + std::size_t hash_code() const; - // public static functions - template<typename T> static type_index construct(); - template<typename T> static type_index construct_with_cvr(); - template<typename T> static type_index construct_rtti_only(T &); - template<typename T> static type_index construct_rtti_only(T *); + // public static functions + template<typename T> static type_index construct(); + template<typename T> static type_index construct_with_cvr(); + template<typename T> static type_index construct_rtti_only(T &); + template<typename T> static type_index construct_rtti_only(T *); };
-

Description

+

Description

-

+

type_index public construct/copy/destruct

  1. -
    type_index();
    Default constructor.
  2. +
    type_index();
    Default constructor.
  3. -
    explicit type_index(const stl_type_info & inf);
    Constructs type_index from an instance of std::type_info.
  4. +
    explicit type_index(const stl_type_info & inf);
    Constructs type_index from an instance of std::type_info.
-

-type_index public member functions

+

+type_index public member functions

  1. -
    bool before(type_index const & rhs) const;
    +
    bool before(type_index const & rhs) const;

    Returns true if the type precedes the type of rhs in the collation order. The collation order is just an internal order.

  2. -
    const char * name() const;
    Returns raw name.
  3. +
    const char * name() const;
    Returns raw name.
  4. -
    std::string name_demangled() const;
    Returns user-friendly name.
  5. +
    std::string name_demangled() const;
    Returns user-friendly name.
  6. -
    std::size_t hash_code() const;
    Function for getting hash value.
  7. +
    std::size_t hash_code() const;
    Function for getting hash value.
-

-type_index public static functions

+

+type_index public static functions

  1. -
    template<typename T> static type_index construct();
    +
    template<typename T> static type_index construct();

    Factory method for constructing type_index instance for type T. Strips const, volatile and & modifiers from T.

  2. -
    template<typename T> static type_index construct_with_cvr();
    -

    Factory method for constructing type_index instance for type T. Does not strips const, volatile, & and && modifiers from T. If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling `construct<T>()`.

    +
    template<typename T> static type_index construct_with_cvr();
    +

    Factory method for constructing type_index instance for type T. Does not strip const, volatile, & and && modifiers from T. If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling `construct<T>()`.

  3. -
    template<typename T> static type_index construct_rtti_only(T & rtti_val);
    +
    template<typename T> static type_index construct_rtti_only(T & rtti_val);

    Factory function, that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. This method available only with RTTI enabled.

  4. -
    template<typename T> static type_index construct_rtti_only(T * rtti_val);
    +
    template<typename T> static type_index construct_rtti_only(T * rtti_val);

    Factory function, that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. This method available only with RTTI enabled.

diff --git a/boost_typeindex/code_bloat.html b/boost_typeindex/code_bloat.html new file mode 100644 index 0000000..dbac18a --- /dev/null +++ b/boost_typeindex/code_bloat.html @@ -0,0 +1,66 @@ + + + +Code bloat + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Without RTTI TypeIndex library will switch from using boost::type_index + class to boost::template_index. boost::template_index + uses the BOOST_CURRENT_FUNCTION + for each type that is passed to type_id() and type_id_with_cvr() functions. +

+

+ This leads to big strings in binary file: +

+
static const char* boost::detail::ctti<T>::n() [with T = int]
+static const char* boost::detail::ctti<T>::n() [with T = user_defined_type]
+
+

+ While using RTTI, you'll get the following (more compact) string in binary + file: +

+

+

+
i
+17user_defined_type
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost_typeindex/compiler_support.html b/boost_typeindex/compiler_support.html index 2524397..28fb572 100644 --- a/boost_typeindex/compiler_support.html +++ b/boost_typeindex/compiler_support.html @@ -6,7 +6,7 @@ - + @@ -19,15 +19,18 @@

-PrevUpHome +PrevUpHome

- TypeIndex has been tested on MSVC2010, GCC-4.5, Clang-2.9. If your compiler - is not in a list of tested compilers, you shall correctly define BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP macroses: + TypeIndex has been tested and sucessfully work on MSVC2010, GCC-4.5, Clang-2.9. + If your compiler is not in a list of tested compilers, you shall correctly + define BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + and BOOST_TYPE_INDEX_CTTI_END_SKIP + macroses:

  1. @@ -81,7 +84,7 @@
    -PrevUpHome +PrevUpHome
    diff --git a/boost_typeindex/examples.html b/boost_typeindex/examples.html index e390df5..b37d8d9 100644 --- a/boost_typeindex/examples.html +++ b/boost_typeindex/examples.html @@ -43,13 +43,11 @@

The following example shows how short (mangled) and human readable type names - could be obtained from a type. + could be obtained from a type. Works with and without RTTI.

-
// Works with and without RTTI.
-
-#include <boost/type_index/type_index_minimal.hpp>
+
#include <boost/type_index/type_index_minimal.hpp>
 #include <iostream>
 
 template <class T>
@@ -65,21 +63,29 @@
     foo(1);
     // will output something like this:
     //
-    // Short name: .H
-    // Readable name: int
+    // (RTTI on)                            (RTTI off)
+    // Short name: i                        Short name: int]
+    // Readable name: int                   Readable name: int
 
     user_defined_type t;
     foo(t);
     // Will output:
     //
-    // Short name: .?AUuser_defined_type@@
-    // Readable name: struct user_defined_type
+    // (RTTI on)                            (RTTI off)
+    // Short name: 17user_defined_type      user_defined_type]
+    // Readable name: user_defined_type     user_defined_type
 }
-
-// The example 
 

+

+ Short names are very compiler dependant: some compiler will output .H, others + i. +

+

+ Readable names may also differ between compilers: struct + user_defined_type, user_defined_type. +

@@ -126,7 +132,9 @@

The following example shows that boost::type_index is able to store the real type, successfully getting through all the inheritances. - Example works with RTTI only. + Example works with RTTI only. Without RTTI support it won't compile, producing + a compile-time error with message: "boost::type_id_rtti_only(T&) + requires RTTI"

@@ -172,6 +180,7 @@
#include <boost/type_index.hpp>
 #include <iostream>
 #include <stdexcept>
+#include <cassert>
 
 class type_erased_unary_function {
     void*                   function_ptr_;
diff --git a/boost_typeindex/performance.html b/boost_typeindex/performance.html
deleted file mode 100644
index a9bad19..0000000
--- a/boost_typeindex/performance.html
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-Performance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
- -

- type_index and template_index classes hold a single pointer, - so they are easy and fast to copy. Calls to const - char* name() do - not require dynamic memory allocation and usually just return a pointer to - an array of chars in a read-only section of the binary image. Comparison operators - are optimized as much as possible, and will at worst execute a single std::strcmp. - Calls to std::string name_demangled() for type_index - do usually require dynamic memory allocation and some computations, so they - are not recomended for usage in performance critical sections. Calls to std::string - name_demangled() - for template_index only require - a single std::strlen call and are considerably faster than - std::string name_demangled() for type_index. -

-

- template_index uses the BOOST_CURRENT_FUNCTION macro which could - lead to code bloat, so prefer using type_index - type. -

-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/boost_typeindex/space_and_performance.html b/boost_typeindex/space_and_performance.html new file mode 100644 index 0000000..63409ff --- /dev/null +++ b/boost_typeindex/space_and_performance.html @@ -0,0 +1,75 @@ + + + +Space and Performance + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
    +
  • + template_index uses the + BOOST_CURRENT_FUNCTION + macro which could lead to code bloat, so prefer using type_index + type. +
  • +
  • + type_index and template_index classes hold a single + pointer, so they are easy and fast to copy. +
  • +
  • + Calls to const char* name() do not require dynamic memory allocation + and usually just return a pointer to an array of chars in a read-only section + of the binary image. +
  • +
  • + Comparison operators are optimized as much as possible, and will at worst + execute a single std::strcmp. +
  • +
  • + Calls to std::string name_demangled() for type_index + do usually require dynamic memory allocation and some computations, so + they are not recomended for usage in performance critical sections. +
  • +
  • + Calls to std::string name_demangled() for template_index + only require a single std::strlen + call and are considerably faster than std::string name_demangled() + for type_index. +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost_typeindex_header_reference.html b/boost_typeindex_header_reference.html index e524ec8..b844cff 100644 --- a/boost_typeindex_header_reference.html +++ b/boost_typeindex_header_reference.html @@ -35,7 +35,7 @@

Includes all the headers of the Boost.TypeIndex library.

-

By inclusion of this file classes `type_index` (if RTTI is on) and `template_index` will be available. Consider including `<boost/type_index/type_index_minimal.hpp>` if you need only a type_index type with and without RTTI.

+

By inclusion of this file both classes (`type_index` (if RTTI is on) and `template_index`) will be available. Consider including `<boost/type_index/type_index_minimal.hpp>` if you do not whant to include `template_index` class while RTTI is available (this is recommended).

@@ -51,7 +51,7 @@ // Ostream operator that will output demangled name. template<typename CharT, typename TriatT> std::basic_ostream< CharT, TriatT > & - operator<<(std::basic_ostream< CharT, TriatT > & ostr, + operator<<(std::basic_ostream< CharT, TriatT > & ostr, template_index const & ind); // hash_value function overload for template_index @@ -67,8 +67,8 @@ class type_index; template<typename T> type_index type_id(); template<typename T> type_index type_id_with_cvr(); - template<typename T> type_index type_id_rtti_only(T &); - template<typename T> type_index type_id_rtti_only(T *); + template<typename T> type_index type_id_rtti_only(T &); + template<typename T> type_index type_id_rtti_only(T *); }

diff --git a/index.html b/index.html index 3386b57..8ef9fbb 100644 --- a/index.html +++ b/index.html @@ -53,7 +53,8 @@
Header <boost/type_index/type_index_impl.hpp>
Header <boost/type_index/type_index_minimal.hpp>
-
Performance
+
Space and Performance
+
Code bloat
Compiler support
@@ -81,7 +82,7 @@ objects across shared libraries
  • - only a few implementations of Standart Library currently provide std::type_index + only a few implementations of Standard Library currently provide std::type_index
  • no easy way to store type info without stripping const, volatile and references @@ -118,7 +119,7 @@
  • - +

    Last revised: October 16, 2013 at 13:25:34 GMT

    Last revised: October 17, 2013 at 07:39:53 GMT


    diff --git a/standalone_HTML.manifest b/standalone_HTML.manifest index c2db632..b8b4e95 100644 --- a/standalone_HTML.manifest +++ b/standalone_HTML.manifest @@ -8,7 +8,8 @@ boost/template_id_with_cvr.html boost/type_index.html boost/type_id.html boost/type_id_with_cvr.html -boost/type_id_rtti_on_idp5366896.html -boost/type_id_rtti_on_idp5370032.html -boost_typeindex/performance.html +boost/type_id_rtti_on_idp5760464.html +boost/type_id_rtti_on_idp5763792.html +boost_typeindex/space_and_performance.html +boost_typeindex/code_bloat.html boost_typeindex/compiler_support.html