diff --git a/boost/template_id.html b/boost/template_id.html index 57f3af7..3083419 100644 --- a/boost/template_id.html +++ b/boost/template_id.html @@ -4,9 +4,9 @@ Function template template_id - - - + + + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext
@@ -29,13 +29,13 @@

boost::template_id

Synopsis

-
// In header: <boost/type_index/template_index_impl.hpp>
+
// In header: <boost/type_index/template_info.hpp>
 
 
-template<typename T> template_index template_id();
+template<typename T> const template_info & template_id();
-

Description

-

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

+

Description

+

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

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

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/template_id_with_cvr.html b/boost/template_id_with_cvr.html index 99a1ff7..cd31c71 100644 --- a/boost/template_id_with_cvr.html +++ b/boost/template_id_with_cvr.html @@ -4,10 +4,10 @@ Function template template_id_with_cvr - - + + - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext
@@ -29,13 +29,13 @@

boost::template_id_with_cvr

Synopsis

-
// In header: <boost/type_index/template_index_impl.hpp>
+
// In header: <boost/type_index/template_info.hpp>
 
 
-template<typename T> template_index template_id_with_cvr();
+template<typename T> const template_info & template_id_with_cvr();
-

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

+

Description

+

Factory method for constructing template_info 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>()`.

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

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/template_index.html b/boost/template_index.html index d063d6f..79e8d69 100644 --- a/boost/template_index.html +++ b/boost/template_index.html @@ -1,13 +1,13 @@ -Class template_index +Type definition template_index - - - - + + + + @@ -20,78 +20,22 @@

-PrevUpHomeNext +PrevUpHomeNext
-

Class template_index

-

boost::template_index

+

Type definition template_index

+

template_index

Synopsis

-
// In header: <boost/type_index/template_index_impl.hpp>
+
// In header: <boost/type_index/template_index.hpp>
 
 
-class template_index {
-public:
-  // construct/copy/destruct
-  template_index() noexcept;
-
-  // public member functions
-  bool before(const template_index &) const noexcept;
-  const char * name() const noexcept;
-  std::string name_demangled() const;
-  std::size_t hash_code() const noexcept;
-
-  // public static functions
-  template<typename T> static template_index construct();
-  template<typename T> static template_index construct_with_cvr();
-};
+typedef template_info template_index;
-

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() noexcept;
    -

    Default constructor.

    -
-
-
-

-template_index public member functions

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

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

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

    Function for getting hash value

    -
  8. -
-
-
-

-template_index public static functions

-
    -
  1. -
    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. -
  3. -
    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

    -
  4. -
-
+

Description

+

boost::template_index is just a typedef of boost::template_info, that combines functionality of boost::type_info and boost::type_index but can work with RTTI disabled.

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

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/template_info.html b/boost/template_info.html new file mode 100644 index 0000000..5bb46f9 --- /dev/null +++ b/boost/template_info.html @@ -0,0 +1,120 @@ + + + +Class template_info + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class template_info

+

boost::template_info

+
+

Synopsis

+
// In header: <boost/type_index/template_info.hpp>
+
+
+class template_info {
+public:
+  // construct/copy/destruct
+  template_info() noexcept;
+
+  // public member functions
+  bool before(const template_info &) const noexcept;
+  const char * name() const noexcept;
+  std::string name_demangled() const;
+  bool operator==(const template_info &) const noexcept;
+  bool operator!=(const template_info &) const noexcept;
+  bool operator<(const template_info &) const noexcept;
+  bool operator>(const template_info &) const noexcept;
+  bool operator<=(const template_info &) const noexcept;
+  bool operator>=(const template_info &) const noexcept;
+  std::size_t hash_code() const noexcept;
+
+  // public static functions
+  template<typename T> static const template_info & construct();
+  template<typename T> static const template_info & construct_with_cvr();
+};
+
+

Description

+

Copyable type_info class that does not require RTTI. When RTTI is disabled this class will be used instead of boost::type_info and boost::type_index.

+
+

+template_info + public + construct/copy/destruct

+
  1. +
    template_info() noexcept;
    +

    Default constructor.

    +
+
+
+

+template_info public member functions

+
    +
  1. +
    bool before(const template_info & rhs) const noexcept;
    +

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

    +
  2. +
  3. +
    const char * name() const noexcept;
    Returns raw name.
  4. +
  5. +
    std::string name_demangled() const;
    Returns user-friendly name.
  6. +
  7. bool operator==(const template_info & rhs) const noexcept;
  8. +
  9. bool operator!=(const template_info & rhs) const noexcept;
  10. +
  11. bool operator<(const template_info & rhs) const noexcept;
  12. +
  13. bool operator>(const template_info & rhs) const noexcept;
  14. +
  15. bool operator<=(const template_info & rhs) const noexcept;
  16. +
  17. bool operator>=(const template_info & rhs) const noexcept;
  18. +
  19. +
    std::size_t hash_code() const noexcept;
    Function for getting hash value.
  20. +
+
+
+

+template_info public static functions

+
    +
  1. +
    template<typename T> static const template_info & construct();
    +

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

    +
  2. +
  3. +
    template<typename T> static const template_info & construct_with_cvr();
    +

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

    +
  4. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/type_id.html b/boost/type_id.html index 9d3b6c3..f125736 100644 --- a/boost/type_id.html +++ b/boost/type_id.html @@ -4,9 +4,9 @@ Function template type_id - - - + + + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext
@@ -29,13 +29,13 @@

boost::type_id

Synopsis

-
// In header: <boost/type_index/type_index_impl.hpp>
+
// In header: <boost/type_index/type_info.hpp>
 
 
-template<typename T> type_index type_id();
+template<typename T> const type_info & type_id();
-

Description

-

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

+

Description

+

Function to get boost::type_info 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_idp5430736.html b/boost/type_id_rtti_on_idp6020784.html similarity index 59% rename from boost/type_id_rtti_on_idp5430736.html rename to boost/type_id_rtti_on_idp6020784.html index 06c06e4..5971af0 100644 --- a/boost/type_id_rtti_on_idp5430736.html +++ b/boost/type_id_rtti_on_idp6020784.html @@ -4,10 +4,10 @@ Function template type_id_rtti_only - - + + - + @@ -20,22 +20,22 @@

-PrevUpHomeNext +PrevUpHomeNext
-
+

Function template type_id_rtti_only

boost::type_id_rtti_only

Synopsis

-
// In header: <boost/type_index/type_index_impl.hpp>
+
// In header: <boost/type_index/type_info.hpp>
 
 
-template<typename T> type_index type_id_rtti_only(T & rtti_val);
+template<typename T> const type_info & 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. Without RTTI support it won't compile, producing a compile-time error with message: "boost::type_id_rtti_only(T&) requires RTTI"

+

Description

+

Function that works exactly like C++ typeid(rtti_val) call, but returns boost::type_info. 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_idp5434192.html b/boost/type_id_rtti_on_idp6024592.html similarity index 56% rename from boost/type_id_rtti_on_idp5434192.html rename to boost/type_id_rtti_on_idp6024592.html index 813c7c3..86b5c1f 100644 --- a/boost/type_id_rtti_on_idp5434192.html +++ b/boost/type_id_rtti_on_idp6024592.html @@ -4,9 +4,9 @@ Function template type_id_rtti_only - - - + + + @@ -20,22 +20,22 @@
-PrevUpHomeNext +PrevUpHomeNext
-
+

Function template type_id_rtti_only

boost::type_id_rtti_only

Synopsis

-
// In header: <boost/type_index/type_index_impl.hpp>
+
// In header: <boost/type_index/type_info.hpp>
 
 
-template<typename T> type_index type_id_rtti_only(T * rtti_val);
+template<typename T> const type_info & 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. Without RTTI support it won't compile, producing a compile-time error with message: "boost::type_id_rtti_only(T*) requires RTTI"

+

Description

+

Function that works exactly like C++ typeid(rtti_val) call, but returns boost::type_info. 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 f4c4a7a..52ff3fd 100644 --- a/boost/type_id_with_cvr.html +++ b/boost/type_id_with_cvr.html @@ -4,10 +4,10 @@ Function template type_id_with_cvr - - + + - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext
@@ -29,13 +29,13 @@

boost::type_id_with_cvr

Synopsis

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

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

+

Description

+

Function for constructing boost::type_info 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 b51bc54..fb68d12 100644 --- a/boost/type_index.html +++ b/boost/type_index.html @@ -4,10 +4,10 @@ Class type_index - - - - + + + + @@ -20,89 +20,87 @@

-PrevUpHomeNext +PrevUpHomeNext

Class type_index

-

boost::type_index — Copyable type_info class that requires RTTI.

+

boost::type_index

Synopsis

-
// In header: <boost/type_index/type_index_impl.hpp>
+
// In header: <boost/type_index/type_index.hpp>
 
 
 class type_index {
 public:
-  // types
-  typedef std::type_info stl_type_info;
-
   // construct/copy/destruct
-  type_index() noexcept;
-  explicit type_index(const stl_type_info &) noexcept;
+  type_index() noexcept;
+  type_index(const type_info &) noexcept;
+  type_index(const std::type_info &) noexcept;
 
-  // public member functions
-  bool before(type_index const &) const noexcept;
-  const char * name() const noexcept;
-  std::string name_demangled() const;
-  std::size_t hash_code() const noexcept;
-
-  // public static functions
-  template<typename T> static type_index construct() noexcept;
-  template<typename T> static type_index construct_with_cvr() noexcept;
-  template<typename T> static type_index construct_rtti_only(T &);
-  template<typename T> static type_index construct_rtti_only(T *);
+  // public member functions
+  bool before(type_index const &) const noexcept;
+  const char * name() const noexcept;
+  std::string name_demangled() const;
+  bool operator==(type_index const &) const noexcept;
+  bool operator!=(type_index const &) const noexcept;
+  bool operator<(type_index const &) const noexcept;
+  bool operator>(type_index const &) const noexcept;
+  bool operator<=(type_index const &) const noexcept;
+  bool operator>=(type_index const &) const noexcept;
+  bool operator==(std::type_info const &) const noexcept;
+  bool operator!=(std::type_info const &) const noexcept;
+  bool operator<(std::type_info const &) const noexcept;
+  bool operator>(std::type_info const &) const noexcept;
+  bool operator<=(std::type_info const &) const noexcept;
+  bool operator>=(std::type_info const &) const noexcept;
+  std::size_t hash_code() const noexcept;
 };
-

Description

+

Description

+

This class is designed to be a drop-in replacement for C++11 std::type_index class.

+

Copyable std::type_index class that requires RTTI. When RTTI is disabled boost::template_index will be used instead of this class.

-

+

type_index public construct/copy/destruct

  1. -
    type_index() noexcept;
    Default constructor.
  2. +
    type_index() noexcept;
    Default constructor.
  3. -
    explicit type_index(const stl_type_info & inf) noexcept;
    Constructs type_index from an instance of std::type_info.
  4. +
    type_index(const type_info & inf) noexcept;
    Constructs type_index from an instance of boost::type_info. +
  5. +
    type_index(const std::type_info & inf) noexcept;
    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 noexcept;
    +
    bool before(type_index const & rhs) const noexcept;

    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 noexcept;
    Returns raw name.
  3. +
    const char * name() const noexcept;
    Returns raw name.
  4. -
    std::string name_demangled() const;
    Returns user-friendly name.
  5. +
    std::string name_demangled() const;
    Returns user-friendly name. +
  6. bool operator==(type_index const & rhs) const noexcept;
  7. +
  8. bool operator!=(type_index const & rhs) const noexcept;
  9. +
  10. bool operator<(type_index const & rhs) const noexcept;
  11. +
  12. bool operator>(type_index const & rhs) const noexcept;
  13. +
  14. bool operator<=(type_index const & rhs) const noexcept;
  15. +
  16. bool operator>=(type_index const & rhs) const noexcept;
  17. +
  18. bool operator==(std::type_info const & rhs) const noexcept;
  19. +
  20. bool operator!=(std::type_info const & rhs) const noexcept;
  21. +
  22. bool operator<(std::type_info const & rhs) const noexcept;
  23. +
  24. bool operator>(std::type_info const & rhs) const noexcept;
  25. +
  26. bool operator<=(std::type_info const & rhs) const noexcept;
  27. +
  28. bool operator>=(std::type_info const & rhs) const noexcept;
  29. -
    std::size_t hash_code() const noexcept;
    Function for getting hash value.
  30. -
-
-
-

-type_index public static functions

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

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

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

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

    -
  4. -
  5. -
    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.

    -
  6. -
  7. -
    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.

    -
  8. +
    std::size_t hash_code() const noexcept;
    Function for getting hash value.
@@ -117,7 +115,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost/type_info.html b/boost/type_info.html new file mode 100644 index 0000000..a4f0f3a --- /dev/null +++ b/boost/type_info.html @@ -0,0 +1,126 @@ + + + +Class type_info + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class type_info

+

boost::type_info

+
+

Synopsis

+
// In header: <boost/type_index/type_info.hpp>
+
+
+class type_info {
+public:
+
+  // public static functions
+  template<typename T> static const boost::type_info & construct() noexcept;
+  template<typename T> 
+    static const boost::type_info & construct_with_cvr() noexcept;
+  template<typename T> 
+    static const type_info & construct_rtti_only(T &) noexcept;
+  template<typename T> static const type_info & construct_rtti_only(T *);
+
+  // public member functions
+  const char * name() const noexcept;
+  std::string name_demangled() const;
+  bool operator==(type_info const &) const noexcept;
+  bool operator!=(type_info const &) const noexcept;
+  bool operator==(std::type_info const &) const noexcept;
+  bool operator!=(std::type_info const &) const noexcept;
+  bool before(type_info const &) const noexcept;
+  bool before(std::type_info const &) const noexcept;
+  std::size_t hash_code() const noexcept;
+};
+
+

Description

+

boost::type_info is a class that can be used as a drop-in replacement for std::type_info.

+

boost::type_info class is used in situations when RTTI is enabled. When RTTI is disabled or BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro is defined boost::template_info is used instead of it.

+

Unlike std::type_info this class: has a name_demangled() function for getting human-readable type names name() function always noexcept and returns simple mangled name as character a character array contains workarounds for some compiler issues

+
+

+type_info public static functions

+
    +
  1. +
    template<typename T> static const boost::type_info & construct() noexcept;
    +

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

    +
  2. +
  3. +
    template<typename T> 
    +  static const boost::type_info & construct_with_cvr() noexcept;
    +

    Factory method for constructing boost::type_info 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>()`.

    +
  4. +
  5. +
    template<typename T> 
    +  static const type_info & construct_rtti_only(T & rtti_val) noexcept;
    +

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

    +
  6. +
  7. +
    template<typename T> 
    +  static const type_info & construct_rtti_only(T * rtti_val);
    +

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

    +
  8. +
+
+
+

+type_info public member functions

+
    +
  1. +
    const char * name() const noexcept;
    Returns mangled type name.
  2. +
  3. +
    std::string name_demangled() const;
    Returns user-friendly name.
  4. +
  5. bool operator==(type_info const & rhs) const noexcept;
  6. +
  7. bool operator!=(type_info const & rhs) const noexcept;
  8. +
  9. bool operator==(std::type_info const & rhs) const noexcept;
  10. +
  11. bool operator!=(std::type_info const & rhs) const noexcept;
  12. +
  13. +
    bool before(type_info const & rhs) const noexcept;
    +

    Returns true if the type precedes the type of rhs in the collation order. The collation order is just an internal order. Works exactly like operator <

    +
  14. +
  15. +
    bool before(std::type_info const & rhs) const noexcept;
    +

    Returns true if the type precedes the type of rhs in the collation order. The collation order is just an internal order. Works exactly like operator <

    +
  16. +
  17. +
    std::size_t hash_code() const noexcept;
    Function for getting hash value.
  18. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost_typeindex/code_bloat.html b/boost_typeindex/code_bloat.html index dbac18a..efc6200 100644 --- a/boost_typeindex/code_bloat.html +++ b/boost_typeindex/code_bloat.html @@ -4,8 +4,8 @@ Code bloat - - + + @@ -27,14 +27,16 @@ Code bloat

- 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. + Without RTTI TypeIndex library will switch from using boost::type_info + class to boost::template_info. boost::template_info + uses macro for getting full text representation of function name 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]
 
@@ -42,13 +44,9 @@ While using RTTI, you'll get the following (more compact) string in binary file:

-

-

i
 17user_defined_type
 
-

-

diff --git a/boost_typeindex/compiler_support.html b/boost_typeindex/compiler_support.html index feb8a7f..219be7e 100644 --- a/boost_typeindex/compiler_support.html +++ b/boost_typeindex/compiler_support.html @@ -4,10 +4,10 @@ Compiler support - - + + - +
@@ -20,27 +20,33 @@

-PrevUpHomeNext +PrevUpHomeNext

Compiler support

- TypeIndex has been tested and sucessfully work on MSVC2010, GCC-4.5, Clang-2.9. + TypeIndex has been tested and successfully 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 + define BOOST_TYPE_INDEX_FUNCTION_SIGNATURE, + BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP macroses:

    +
  1. + define BOOST_TYPE_INDEX_FUNCTION_SIGNATURE + to a a compiler specific macro, that outputs the whole + function signature, including template parameters +
  2. define BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP to 0
  3. - get the output of boost::detail::ctti<int>::n() + get the output of boost::template_id<int>().name()
  4. set BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP @@ -53,22 +59,27 @@ in output
  5. - check that boost::detail::ctti<int>::name_demangled() + check that boost::template_id<int>().name_demangled() returns "int"
  6. (optional, but highly recomended) create ticket with feature request to add your compiler to supported compilers - list. Include BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + list. Include BOOST_TYPE_INDEX_FUNCTION_SIGNATURE, + BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP - numbers. + values.

- Consider the following example: With BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + Consider the following example: +

+

+ With BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP - set to 0, boost::detail::ctti<int>::n() returns "const char *__cdecl boost::detail::ctti<int>::n(void)". - Then you shall set BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + set to 0, boost::template_id<int>().name() returns + "const char *__cdecl boost::detail::ctti<int>::n(void)". Then + you shall set BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP to sizeof("const char *__cdecl boost::detail::ctti<") - 1 and BOOST_TYPE_INDEX_CTTI_END_SKIP to sizeof(">::n(void)") @@ -85,7 +96,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/boost_typeindex/examples.html b/boost_typeindex/examples.html index b37d8d9..06843c2 100644 --- a/boost_typeindex/examples.html +++ b/boost_typeindex/examples.html @@ -4,8 +4,8 @@ Examples - - + + @@ -27,27 +27,25 @@ Examples
-
Getting +
Getting human readable and mangled type names
-
Storing +
Storing information about a type in container
-
Getting +
Getting through the inheritance to receive a real type name
-
Exact +
Exact type match: storing type with const, volatile and reference

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

-

-

-
#include <boost/type_index/type_index_minimal.hpp>
+
#include <boost/type_index/type_info.hpp>
 #include <iostream>
 
 template <class T>
@@ -76,8 +74,6 @@
     // Readable name: user_defined_type     user_defined_type
 }
 
-

-

Short names are very compiler dependant: some compiler will output .H, others i. @@ -89,16 +85,14 @@

The following example shows how an information about a type could be stored. Example works with and without RTTI.

-

-

-
#include <boost/type_index/type_index_minimal.hpp>
+
#include <boost/type_index/type_index.hpp>
 #include <boost/unordered_set.hpp>
 #include <cassert>
 
@@ -121,24 +115,22 @@
     assert(*types.begin() == boost::type_id<int>());
 }
 
-

-

- The following example shows that boost::type_index + The following example shows that boost::type_info is able to store the real type, successfully getting through all the inheritances. +

+

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"

-

-

-
#include <boost/type_index/type_index_minimal.hpp>
+
#include <boost/type_index/type_info.hpp>
 #include <iostream>
 
 struct A { virtual ~A(){} };
@@ -156,18 +148,17 @@
     print_real_type(B());       // Outputs `struct B`
 }
 
-

-

- The following example shows that boost::template_index - is able to store the exact type, without stripping const, volatile and references. - Example works with and without RTTI. + The following example shows that boost::type_index + (and boost::type_info) is able to store the exact type, + without stripping const, volatile and references. Example works with and + without RTTI.

In this example we'll create a class, that stores pointer to function and @@ -175,27 +166,25 @@ to call the stored function will be made, type of input parameter will be checked for exact match with initaily erased type of function.

-

-

-
#include <boost/type_index.hpp>
+
#include <boost/type_index/type_index.hpp>
 #include <iostream>
 #include <stdexcept>
 #include <cassert>
 
 class type_erased_unary_function {
     void*                   function_ptr_;
-    boost::template_index   exact_param_t_;
+    boost::type_index       exact_param_t_;
 
 public:
     template <class ParamT>
     type_erased_unary_function(void(*ptr)(ParamT))
         : function_ptr_(reinterpret_cast<void*>(ptr)) // ptr - is a pointer to function returning `void` and accepting parameter of type `ParamT`
-        , exact_param_t_(boost::template_id_with_cvr<ParamT>())
+        , exact_param_t_(boost::type_id_with_cvr<ParamT>())
     {}
 
     template <class ParamT>
     void call(ParamT v) {
-        if (exact_param_t_ != boost::template_id_with_cvr<ParamT>()) {
+        if (exact_param_t_ != boost::type_id_with_cvr<ParamT>()) {
             throw std::runtime_error("Incorrect `ParamT`");
         }
 
@@ -219,8 +208,6 @@
     } catch (const std::runtime_error& /*e*/) {}
 }
 
-

-

diff --git a/boost_typeindex/getting_started.html b/boost_typeindex/getting_started.html index 2d18fbd..bc3cdcf 100644 --- a/boost_typeindex/getting_started.html +++ b/boost_typeindex/getting_started.html @@ -4,9 +4,9 @@ Getting started - - - + + + @@ -27,19 +27,35 @@ Getting started

- 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. + boost::type_info is a drop-in replacement for std::type_index + and boost::type_index is a drop-in replacement for + std::type_index. Unlike Standard Library versions + those classes usually do not require RTTI.

- To start using it: + boost::type_index provides the full set of comparison + operators, hashing functions and ostream operators, so it can be used with + any container class. +

+

+ To start using Boost.TypeIndex:

  • +

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

    #include <boost/type_index/type_index_minimal.hpp>
    +        

    +
    #include <boost/type_index.hpp>
     
     type_index ti = type_id<T>();
     std::string nice_name
    @@ -72,7 +90,7 @@
     std::string nice_name_with_const_volatile_ref
         = type_id_with_cvr<ParamT&>().name_demangled();
     
    -
  • +
    diff --git a/boost_typeindex/mixing_sources_with_rtti_on_and_rtti_off.html b/boost_typeindex/mixing_sources_with_rtti_on_and_.html similarity index 80% rename from boost_typeindex/mixing_sources_with_rtti_on_and_rtti_off.html rename to boost_typeindex/mixing_sources_with_rtti_on_and_.html index 4321a85..801e34d 100644 --- a/boost_typeindex/mixing_sources_with_rtti_on_and_rtti_off.html +++ b/boost_typeindex/mixing_sources_with_rtti_on_and_.html @@ -4,8 +4,8 @@ Mixing sources with RTTI on and RTTI off - - + + @@ -23,16 +23,17 @@

    Linking a binary from source files that were compiled with different RTTI flags is not a very good idea and may lead to a lot of surprises. However if there - is a very strong need TypeIndex library provides a solution for mixing sources: + is a very strong need, TypeIndex library provides a solution for mixing sources: just define BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro. This would lead to usage of boost::template_index - instead of boost::type_index class. + instead of boost::type_index class and boost::template_info + instead of boost::type_info class.

    @@ -54,7 +55,7 @@ flags:

    -
    +
    @@ -88,6 +89,17 @@

    Such differences are usually not detected by linker and lead to errors at runtime.

    +
    + + + + + +
    [Warning]Warning

    + Even with BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY + defined there is no guarantee that everything will be OK. Libraries that + use their own workarounds for disabled RTTI may fail to link orwork correctly. +

    diff --git a/boost_typeindex/space_and_performance.html b/boost_typeindex/space_and_performance.html index 52b5799..52e36da 100644 --- a/boost_typeindex/space_and_performance.html +++ b/boost_typeindex/space_and_performance.html @@ -4,9 +4,9 @@ Space and Performance - - - + + + @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -28,9 +28,9 @@

    • - template_index uses the - BOOST_CURRENT_FUNCTION - macro which could lead to code bloat, so prefer using type_index + template_info uses macro + for getting full text representation of function name which could lead + to code bloat, so prefer using type_info type.
    • @@ -47,15 +47,9 @@ 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. + Calls to std::string name_demangled() usually require dynamic memory allocation + and some computations, so they are not recommended for usage in performance + critical sections.
    @@ -69,7 +63,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/boost_typeindex_header_reference.html b/boost_typeindex_header_reference.html index 547d2f0..974eef5 100644 --- a/boost_typeindex_header_reference.html +++ b/boost_typeindex_header_reference.html @@ -4,10 +4,10 @@ Boost.TypeIndex Header Reference - - + + - + @@ -20,63 +20,99 @@

    -PrevUpHomeNext +PrevUpHomeNext

    Boost.TypeIndex Header Reference

    Includes all the headers of the Boost.TypeIndex library.

    -

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

    +

    By inclusion of this file all classes (boost::type_info + boost::type_index if RTTI is on and boost::template_info + boost::template_index) will be available.

    +

    Consider including <boost/type_index/type_index.hpp> if you do not whant to include boost::template_info and boost::template_index class while RTTI is available.

    +

    Consider including <boost/type_index/type_info.hpp> if you need only boost::type_info class and boost::type_id* functions.

    -

    Contains implementation of template_index class.

    -

    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.

    +Header <boost/type_index/type_index.hpp>
    +

    Contains implementation of boost::type_index class.

    +

    boost::type_index class is used in situations when RTTI is enabled, it is designed to be a drop-in replacement for C++11 std::type_index class.

    +

    When RTTI is disabled boost::template_index will be used instead of this class.

    namespace boost {
    -  class template_index;
    -  template<typename T> template_index template_id();
    -  template<typename T> template_index template_id_with_cvr();
    +  class type_index;
    +  bool operator==(unspecified lhs, type_index const & rhs);
    +  bool operator!=(unspecified lhs, type_index const & rhs);
    +  bool operator<(unspecified lhs, type_index const & rhs);
    +  bool operator>(unspecified lhs, type_index const & rhs);
    +  bool operator<=(unspecified lhs, type_index const & rhs);
    +  bool operator>=(unspecified lhs, type_index const & rhs);
     
       // Ostream operator that will output demangled name. 
       template<typename CharT, typename TriatT> 
         std::basic_ostream< CharT, TriatT > & 
    -    operator<<(std::basic_ostream< CharT, TriatT > & ostr, 
    -               template_index const & ind);
    +    operator<<(std::basic_ostream< CharT, TriatT > & ostr, 
    +               type_index const & ind);
     
    -  // hash_value function overload for template_index
    -  std::size_t hash_value(template_index const & v);
    +  // hash_value function overload for type_index. 
    +  std::size_t hash_value(type_index const & v);
     }
    -

    Contains implementation of type_index class.

    -

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

    +Header <boost/type_index/template_index.hpp>
    +

    Contains implementation of boost::template_index class.

    +

    boost::template_index is just a typedef of boost::template_info, that combines functionality of boost::type_info and boost::type_index but can work with RTTI disabled.

    namespace boost {
    -  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 *);
    +  typedef template_info template_index;
     }
    -

    This is the header that required for ussage of type_index with/without RTTI.

    -

    It includes only the minamally required headers and does the `typedef template_index type_index;` when RTTI is disabled.

    -

    Define the BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro if you are mixing objects compiled with different RTTI flags.

    +Header <boost/type_index/template_info.hpp>
    +

    Contains implementation of boost::template_info class.

    +

    boost::template_info class is used instead of boost::type_info and boost::type_index classes in situations when RTTI is disabled.

    +

    It combines functionality of std::type_info and std::type_index.

    +
    namespace boost {
    +  class template_info;
    +  template<typename T> const template_info & template_id();
    +  template<typename T> const template_info & template_id_with_cvr();
    +
    +  // Ostream operator that will output demangled name. 
    +  template<typename CharT, typename TriatT> 
    +    std::basic_ostream< CharT, TriatT > & 
    +    operator<<(std::basic_ostream< CharT, TriatT > & ostr, 
    +               template_info const & ind);
    +
    +  // hash_value function overload for template_info
    +  std::size_t hash_value(template_info const & v);
    +}
    + +
    + +

    Contains implementation of boost::type_info class.

    +

    boost::type_info class can be used as a drop-in replacement for std::type_info, but unlike std::type_info this class has a name_demangled() function for getting human-readable type names.

    +

    boost::type_info class is used in situations when RTTI is enabled. When RTTI is disabled or BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY macro is defined boost::template_info is used instead of it.

    +
    namespace boost {
    +  class type_info;
    +  template<typename T> const type_info & type_id();
    +  template<typename T> const type_info & type_id_with_cvr();
    +  template<typename T> const type_info & type_id_rtti_only(T &);
    +  template<typename T> const type_info & type_id_rtti_only(T *);
    +  bool operator==(unspecified lhs, type_info const & rhs);
    +  bool operator!=(unspecified lhs, type_info const & rhs);
    +
    +  // hash_value function overload for boost::type_info. 
    +  std::size_t hash_value(type_info const & v);
    +}
    @@ -89,7 +125,7 @@

    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/index.html b/index.html index 3f836aa..cf14b45 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,10 @@ -Chapter 1. Boost.TypeIndex 1.0 +Chapter 1. Boost.TypeIndex 2.0 - + @@ -21,7 +21,7 @@

    -Chapter 1. Boost.TypeIndex 1.0

    +Chapter 1. Boost.TypeIndex 2.0
    @@ -94,7 +95,7 @@

    - Boost.TypeIndex was designed to work around all those issues. + Boost.TypeIndex library was designed to work around all those issues.

     @@ -115,13 +116,13 @@ Warning

    - This library is not accepted to Boost, it is currrently waiting for review. + This library is not accepted to Boost, it is currently waiting for review.

    - +

    Last revised: October 22, 2013 at 12:36:27 GMT

    Last revised: October 29, 2013 at 12:15:03 GMT


    diff --git a/standalone_HTML.manifest b/standalone_HTML.manifest index 64ea035..62f18cf 100644 --- a/standalone_HTML.manifest +++ b/standalone_HTML.manifest @@ -2,15 +2,17 @@ index.html boost_typeindex/getting_started.html boost_typeindex/examples.html boost_typeindex_header_reference.html +boost/type_index.html boost/template_index.html +boost/template_info.html boost/template_id.html boost/template_id_with_cvr.html -boost/type_index.html +boost/type_info.html boost/type_id.html boost/type_id_with_cvr.html -boost/type_id_rtti_on_idp5430736.html -boost/type_id_rtti_on_idp5434192.html +boost/type_id_rtti_on_idp6020784.html +boost/type_id_rtti_on_idp6024592.html boost_typeindex/space_and_performance.html boost_typeindex/code_bloat.html boost_typeindex/compiler_support.html -boost_typeindex/mixing_sources_with_rtti_on_and_rtti_off.html +boost_typeindex/mixing_sources_with_rtti_on_and_.html