From edf6443e9e02a114dfd59cb0ea8574214ba27837 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 16 Oct 2013 17:27:27 +0400 Subject: [PATCH] Docs regenerated --- boost/template_id.html | 2 +- boost/template_id_with_cvr.html | 4 +- boost/template_index.html | 44 ++++++------ boost/type_id.html | 8 +-- boost/type_id_rtti_on_idp5366896.html | 54 ++++++++++++++ ...8.html => type_id_rtti_on_idp5370032.html} | 10 +-- ..._idp5353952.html => type_id_with_cvr.html} | 20 +++--- boost/type_index.html | 57 ++++++++------- boost_typeindex/examples.html | 2 +- boost_typeindex/getting_started.html | 71 +++++++++++-------- boost_typeindex/performance.html | 13 ++-- boost_typeindex_header_reference.html | 10 +-- index.html | 6 +- standalone_HTML.manifest | 5 +- 14 files changed, 191 insertions(+), 115 deletions(-) create mode 100644 boost/type_id_rtti_on_idp5366896.html rename boost/{type_id_rtti_on_idp5357088.html => type_id_rtti_on_idp5370032.html} (93%) rename boost/{type_id_rtti_on_idp5353952.html => type_id_with_cvr.html} (78%) diff --git a/boost/template_id.html b/boost/template_id.html index 785448e..f1697a9 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 e4e8a24..045ba93 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.

+

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>()`.

diff --git a/boost/template_index.html b/boost/template_index.html index c2a3a0f..2657f34 100644 --- a/boost/template_index.html +++ b/boost/template_index.html @@ -35,59 +35,59 @@ 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();
    +
    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

diff --git a/boost/type_id.html b/boost/type_id.html index aef2a31..11d4a46 100644 --- a/boost/type_id.html +++ b/boost/type_id.html @@ -7,7 +7,7 @@ - +
@@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext
@@ -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.

@@ -48,7 +48,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_id_rtti_on_idp5366896.html b/boost/type_id_rtti_on_idp5366896.html new file mode 100644 index 0000000..4f9cfba --- /dev/null +++ b/boost/type_id_rtti_on_idp5366896.html @@ -0,0 +1,54 @@ + + + +Function template type_id_rtti_only + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Function template type_id_rtti_only

+

boost::type_id_rtti_only

+
+

Synopsis

+
// In header: <boost/type_index/type_index_impl.hpp>
+
+
+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.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/type_id_rtti_on_idp5357088.html b/boost/type_id_rtti_on_idp5370032.html similarity index 93% rename from boost/type_id_rtti_on_idp5357088.html rename to boost/type_id_rtti_on_idp5370032.html index e2f40c4..fd821e8 100644 --- a/boost/type_id_rtti_on_idp5357088.html +++ b/boost/type_id_rtti_on_idp5370032.html @@ -6,7 +6,7 @@ - + @@ -20,10 +20,10 @@
-PrevUpHomeNext +PrevUpHomeNext
-
+

Function template type_id_rtti_only

boost::type_id_rtti_only

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

Description

+

Description

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

@@ -48,7 +48,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_id_rtti_on_idp5353952.html b/boost/type_id_with_cvr.html similarity index 78% rename from boost/type_id_rtti_on_idp5353952.html rename to boost/type_id_with_cvr.html index 71c805b..f61993a 100644 --- a/boost/type_id_rtti_on_idp5353952.html +++ b/boost/type_id_with_cvr.html @@ -1,13 +1,13 @@ -Function template type_id_rtti_only +Function template type_id_with_cvr - + @@ -20,22 +20,22 @@

-PrevUpHomeNext +PrevUpHomeNext
-
+
-

Function template type_id_rtti_only

-

boost::type_id_rtti_only

+

Function template type_id_with_cvr

+

boost::type_id_with_cvr

Synopsis

// In header: <boost/type_index/type_index_impl.hpp>
 
 
-template<typename T> type_index type_id_rtti_only(T & rtti_val);
+template<typename T> type_index type_id_with_cvr();
-

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 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>()`.

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

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_index.html b/boost/type_index.html index 2a9a9c1..0211ecb 100644 --- a/boost/type_index.html +++ b/boost/type_index.html @@ -38,64 +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_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_rtti_only(T & rtti_val);
    +
    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>()`.

    +
  3. +
  4. +
    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.

  5. -
    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/examples.html b/boost_typeindex/examples.html index d0f9264..e390df5 100644 --- a/boost_typeindex/examples.html +++ b/boost_typeindex/examples.html @@ -165,7 +165,7 @@ In this example we'll create a class, that stores pointer to function and remembers the exact type of a parameter that function accepts. When an attempt to call the stored function will be made, type of input parameter will be - checked for exact match with initail/erased type of function. + checked for exact match with initaily erased type of function.

diff --git a/boost_typeindex/getting_started.html b/boost_typeindex/getting_started.html index d07fc7d..2d18fbd 100644 --- a/boost_typeindex/getting_started.html +++ b/boost_typeindex/getting_started.html @@ -27,38 +27,53 @@ Getting started

- In short: Just replace typeid(T), - &typeid(T) - with boost::type_id<T>() and - std::type_index, const - std::type_info& - with boost::type_index. For cases when RTTI is actually - required, replace typeid(variable) - with boost::type_id_rtti_only(variable) - (or just leave as is). That's all, you are now using Boost.TypeIndex. + boost::type_index can be used as a drop-in replacement + for std::type_index, but it usually does not require + RTTI. It provides the full set of comparison operators, hashing functions and + ostream operators, so it can be used with any container class.

- To get nice human readable names, use the name_demangled() member function: -

-
type_index ti = type_id<T>();
-std::string nice_name = ti.name_demangled();
+      To start using it:
+    

+
    +
  • + Replace std::type_index, const + std::type_info&, + const std::type_info* with boost::type_index. +
  • +
  • + If you do not want to save const, + volatile, & + and &&: +
    • + Use boost::type_id<T>() + instead of typeid(T), + &typeid(T). +
    +
  • +
  • + If you want to save const, + volatile, & + and &&: +
    • + Use boost::type_id_with_cvr<T>() + instead of typeid(T), + &typeid(T). +
    +
  • +
  • + To get nice human readable names, use the name_demangled() member function: +
    #include <boost/type_index/type_index_minimal.hpp>
    +
    +type_index ti = type_id<T>();
    +std::string nice_name
    +    = ti.name_demangled();
     ...
    -std::string nice_name_with_const_volatile_ref = template_id_with_cvr<ParamT&>().name_demangled();
    +std::string nice_name_with_const_volatile_ref
    +    = type_id_with_cvr<ParamT&>().name_demangled();
     
    -

    -

    -

    - template_index and type_index provide the full set of comparison - operators, hashing functions and ostream operators. Thay can be used with any - container class. -

    -

    - If you need to preserve const, - volatile and references, use - boost::template_index instead of boost::type_index; - boost::template_id_with_cvr<T>() instead - of boost::type_id<T>(). -

    +
  • +
diff --git a/boost_typeindex/performance.html b/boost_typeindex/performance.html index d4f8c9c..a9bad19 100644 --- a/boost_typeindex/performance.html +++ b/boost_typeindex/performance.html @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext

@@ -42,10 +42,9 @@ std::string name_demangled() for type_index.

- template_index uses the BOOST_CURRENT_FUNCTION macro, which could - lead to code bloat. In those cases where preserving const, - volatile and references is not - needed prefer using type_index. + template_index uses the BOOST_CURRENT_FUNCTION macro which could + lead to code bloat, so prefer using type_index + type.

@@ -58,7 +57,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost_typeindex_header_reference.html b/boost_typeindex_header_reference.html index bc2ccf9..e524ec8 100644 --- a/boost_typeindex_header_reference.html +++ b/boost_typeindex_header_reference.html @@ -41,7 +41,8 @@

Contains implementation of template_index class.

-

Here is defined the template_index class, that is used instead of type_index class in situations when RTTI is disabled. Consider including `<boost/type_index/type_index_minimal.hpp>` or `<boost/type_index.hpp>` instead of this file.

+

Here is defined the `boost::template_index` class, that is used instead of `boost::type_index` class in situations when RTTI is disabled.

+

Consider including `<boost/type_index/type_index_minimal.hpp>` or `<boost/type_index.hpp>` instead of this file.

namespace boost {
   class template_index;
   template<typename T> template_index template_id();
@@ -50,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
@@ -65,8 +66,9 @@
 
namespace boost {
   class type_index;
   template<typename T> type_index type_id();
-  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_with_cvr();
+  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 7c8ed30..3386b57 100644 --- a/index.html +++ b/index.html @@ -62,8 +62,8 @@ Motivation

- Sometimes getting and storing information about a template type at runtime - is required. For such cases a construction like &typeid(T) or C++11 class std::type_index + Sometimes getting and storing information about a type at runtime is required. + For such cases a construction like &typeid(T) or C++11 class std::type_index is usually used. And that is the point, where problems start:

    @@ -118,7 +118,7 @@
- +

Last revised: October 15, 2013 at 11:01:14 GMT

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


diff --git a/standalone_HTML.manifest b/standalone_HTML.manifest index 5dcdbde..c2db632 100644 --- a/standalone_HTML.manifest +++ b/standalone_HTML.manifest @@ -7,7 +7,8 @@ boost/template_id.html boost/template_id_with_cvr.html boost/type_index.html boost/type_id.html -boost/type_id_rtti_on_idp5353952.html -boost/type_id_rtti_on_idp5357088.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_typeindex/compiler_support.html