diff --git a/BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY.html b/BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY.html new file mode 100644 index 0000000..ab364c6 --- /dev/null +++ b/BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY

+

BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY

+
+

Synopsis

+
// In header: <boost/type_index.hpp>
+
+BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY
+
+

Description

+

BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY is a helper macro that must be defined if mixing RTTI on/off modules. See "Mixing sources with RTTI on and RTTI off" section of documentation for more info.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/BOOST_TYPE_INDEX_REGISTER_CLASS.html b/BOOST_TYPE_INDEX_REGISTER_CLASS.html index 396c7f5..92e5b4b 100644 --- a/BOOST_TYPE_INDEX_REGISTER_CLASS.html +++ b/BOOST_TYPE_INDEX_REGISTER_CLASS.html @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext
@@ -32,33 +32,6 @@
// In header: <boost/type_index.hpp>
 
 BOOST_TYPE_INDEX_REGISTER_CLASS
-
-

Description

-

BOOST_TYPE_INDEX_REGISTER_CLASS is a helper macro that is used to help to emulate RTTI. Put this macro into the public section of polymorphic class to allow runtime type detection.

-

Depending on the typeid() availability this macro will expand to nothing or to virtual helper function virtual const type_info& type_id_runtime() const.

-

Example:

-
class A {
-public:
-    BOOST_TYPE_INDEX_REGISTER_CLASS
-    virtual ~A(){}
-};
-
-struct B: public A {
-    BOOST_TYPE_INDEX_REGISTER_CLASS
-};
-
-struct C: public B {
-    BOOST_TYPE_INDEX_REGISTER_CLASS
-};
-
-...
-
-C c1;
-A* pc1 = &c1;
-assert(boost::typeind::type_id<C>() == boost::typeind::type_id_runtime(*pc1));
-
-

-
@@ -70,7 +43,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS.html b/BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS.html index 13e5aee..f3d334b 100644 --- a/BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS.html +++ b/BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS.html @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext
@@ -33,7 +33,7 @@ BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS
-

Description

+

Description

BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS is used by BOOST_TYPE_INDEX_REGISTER_CLASS when RTTI is off and typeid() does not work.

BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS macro expands to declaration and implementation of virtual const detail::ctti_data& type_id_runtime() const method.

@@ -48,7 +48,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/BOOST_TYPE_INDEX_REGISTER_STL_CLASS.html b/BOOST_TYPE_INDEX_REGISTER_STL_CLASS.html index ca57b47..ca6c012 100644 --- a/BOOST_TYPE_INDEX_REGISTER_STL_CLASS.html +++ b/BOOST_TYPE_INDEX_REGISTER_STL_CLASS.html @@ -33,7 +33,7 @@ BOOST_TYPE_INDEX_REGISTER_STL_CLASS
-

Description

+

Description

BOOST_TYPE_INDEX_REGISTER_STL_CLASS is used by BOOST_TYPE_INDEX_REGISTER_CLASS when RTTI is off and typeid() does work.

BOOST_TYPE_INDEX_REGISTER_STL_CLASS macro expands to declaration and implementation of virtual const std::type_info& type_id_runtime() const method.

diff --git a/BOOST_TYPE_INDEX_USER_TYPEINDEX.html b/BOOST_TYPE_INDEX_USER_TYPEINDEX.html index 5d32266..46b14f3 100644 --- a/BOOST_TYPE_INDEX_USER_TYPEINDEX.html +++ b/BOOST_TYPE_INDEX_USER_TYPEINDEX.html @@ -33,7 +33,7 @@ BOOST_TYPE_INDEX_USER_TYPEINDEX
-

Description

+

Description

BOOST_TYPE_INDEX_USER_TYPEINDEX can be defined to the path to header file with user provided implementation of type_index.

See "Making own type_index" section of documentation for usage example.

diff --git a/boost/typeind/ctti_type_index.html b/boost/typeind/ctti_type_index.html index e8bd99e..fa5a420 100644 --- a/boost/typeind/ctti_type_index.html +++ b/boost/typeind/ctti_type_index.html @@ -38,53 +38,53 @@ typedef unspecified type_info_t; // construct/copy/destruct - ctti_type_index() noexcept; - ctti_type_index(const type_info_t &) noexcept; + ctti_type_index() noexcept; + ctti_type_index(const type_info_t &) noexcept; - // public member functions - const type_info_t & type_info() const noexcept; - const char * raw_name() const noexcept; - std::string pretty_name() const; - std::size_t hash_code() const noexcept; + // public member functions + const type_info_t & type_info() const noexcept; + const char * raw_name() const noexcept; + std::string pretty_name() const; + std::size_t hash_code() const noexcept; - // public static functions - template<typename T> static ctti_type_index type_id() noexcept; - template<typename T> static ctti_type_index type_id_with_cvr() noexcept; + // public static functions + template<typename T> static ctti_type_index type_id() noexcept; + template<typename T> static ctti_type_index type_id_with_cvr() noexcept; template<typename T> - static ctti_type_index type_id_runtime(const T &) noexcept; + static ctti_type_index type_id_runtime(const T &) noexcept; };
-

Description

-

This class is a wrapper that pretends to work exactly like stl_type_info, but does not require RTTI support. For description of functions see type_index_facade.

+

Description

+

This class is a wrapper that pretends to work exactly like stl_type_index, but does not require RTTI support. For description of functions see type_index_facade.

This class produces slightly longer type names, so consider using stl_type_index in situations when typeid() is working.

-

+

ctti_type_index public construct/copy/destruct

    -
  1. ctti_type_index() noexcept;
  2. -
  3. ctti_type_index(const type_info_t & data) noexcept;
  4. +
  5. ctti_type_index() noexcept;
  6. +
  7. ctti_type_index(const type_info_t & data) noexcept;
-

-ctti_type_index public member functions

+

+ctti_type_index public member functions

    -
  1. const type_info_t & type_info() const noexcept;
  2. -
  3. const char * raw_name() const noexcept;
  4. -
  5. std::string pretty_name() const;
  6. -
  7. std::size_t hash_code() const noexcept;
  8. +
  9. const type_info_t & type_info() const noexcept;
  10. +
  11. const char * raw_name() const noexcept;
  12. +
  13. std::string pretty_name() const;
  14. +
  15. std::size_t hash_code() const noexcept;
-

-ctti_type_index public static functions

+

+ctti_type_index public static functions

    -
  1. template<typename T> static ctti_type_index type_id() noexcept;
  2. -
  3. template<typename T> static ctti_type_index type_id_with_cvr() noexcept;
  4. +
  5. template<typename T> static ctti_type_index type_id() noexcept;
  6. +
  7. template<typename T> static ctti_type_index type_id_with_cvr() noexcept;
  8. template<typename T> 
    -  static ctti_type_index type_id_runtime(const T & variable) noexcept;
  9. + static ctti_type_index type_id_runtime(const T & variable) noexcept;
diff --git a/boost/typeind/stl_type_index.html b/boost/typeind/stl_type_index.html index 9158ec5..64267e1 100644 --- a/boost/typeind/stl_type_index.html +++ b/boost/typeind/stl_type_index.html @@ -40,59 +40,59 @@ typedef std::type_info type_info_t; // construct/copy/destruct - stl_type_index() noexcept; - stl_type_index(const type_info_t &) noexcept; + stl_type_index() noexcept; + stl_type_index(const type_info_t &) noexcept; - // public member functions - const type_info_t & type_info() const noexcept; - const char * raw_name() const noexcept; - const char * name() const noexcept; - std::string pretty_name() const; - std::size_t hash_code() const noexcept; - bool equal(const stl_type_index &) const noexcept; - bool before(const stl_type_index &) const noexcept; + // public member functions + const type_info_t & type_info() const noexcept; + const char * raw_name() const noexcept; + const char * name() const noexcept; + std::string pretty_name() const; + std::size_t hash_code() const noexcept; + bool equal(const stl_type_index &) const noexcept; + bool before(const stl_type_index &) const noexcept; - // public static functions - template<typename T> static stl_type_index type_id() noexcept; - template<typename T> static stl_type_index type_id_with_cvr() noexcept; + // public static functions + template<typename T> static stl_type_index type_id() noexcept; + template<typename T> static stl_type_index type_id_with_cvr() noexcept; template<typename T> - static stl_type_index type_id_runtime(const T &) noexcept; + static stl_type_index type_id_runtime(const T &) noexcept; };
-

Description

+

Description

This class is a wrapper around std::type_info, that workarounds issues and provides much more rich interface. For description of functions see type_index_facade.

This class requires typeid() to work. For cases when RTTI is disabled see ctti_type_index.

-

+

stl_type_index public construct/copy/destruct

    -
  1. stl_type_index() noexcept;
  2. -
  3. stl_type_index(const type_info_t & data) noexcept;
  4. +
  5. stl_type_index() noexcept;
  6. +
  7. stl_type_index(const type_info_t & data) noexcept;
-

-stl_type_index public member functions

+

+stl_type_index public member functions

    -
  1. const type_info_t & type_info() const noexcept;
  2. -
  3. const char * raw_name() const noexcept;
  4. -
  5. const char * name() const noexcept;
  6. -
  7. std::string pretty_name() const;
  8. -
  9. std::size_t hash_code() const noexcept;
  10. -
  11. bool equal(const stl_type_index & rhs) const noexcept;
  12. -
  13. bool before(const stl_type_index & rhs) const noexcept;
  14. +
  15. const type_info_t & type_info() const noexcept;
  16. +
  17. const char * raw_name() const noexcept;
  18. +
  19. const char * name() const noexcept;
  20. +
  21. std::string pretty_name() const;
  22. +
  23. std::size_t hash_code() const noexcept;
  24. +
  25. bool equal(const stl_type_index & rhs) const noexcept;
  26. +
  27. bool before(const stl_type_index & rhs) const noexcept;
-

-stl_type_index public static functions

+

+stl_type_index public static functions

    -
  1. template<typename T> static stl_type_index type_id() noexcept;
  2. -
  3. template<typename T> static stl_type_index type_id_with_cvr() noexcept;
  4. +
  5. template<typename T> static stl_type_index type_id() noexcept;
  6. +
  7. template<typename T> static stl_type_index type_id_with_cvr() noexcept;
  8. template<typename T> 
    -  static stl_type_index type_id_runtime(const T & value) noexcept;
  9. + static stl_type_index type_id_runtime(const T & value) noexcept;
diff --git a/boost/typeind/type_id.html b/boost/typeind/type_id.html index 93a9f02..751c60c 100644 --- a/boost/typeind/type_id.html +++ b/boost/typeind/type_id.html @@ -34,7 +34,7 @@ template<typename T> type_index type_id();
-

Description

+

Description

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

Example:

type_index ti = type_id<int&>();
diff --git a/boost/typeind/type_id_runtime.html b/boost/typeind/type_id_runtime.html
index 99e0d09..a7eb994 100644
--- a/boost/typeind/type_id_runtime.html
+++ b/boost/typeind/type_id_runtime.html
@@ -34,7 +34,7 @@
 
 template<typename T> type_index type_id_runtime(const T & runtime_val);
-

Description

+

Description

Function that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index.

Retunrs runtime information about specified type.

Requirements: RTTI available or Base and Derived classes must be marked with BOOST_TYPE_INDEX_REGISTER_CLASS.

diff --git a/boost/typeind/type_id_with_cvr.html b/boost/typeind/type_id_with_cvr.html index 99253aa..885bfac 100644 --- a/boost/typeind/type_id_with_cvr.html +++ b/boost/typeind/type_id_with_cvr.html @@ -34,7 +34,7 @@ template<typename T> type_index type_id_with_cvr();
-

Description

+

Description

Function for constructing boost::type_index instance for type T. Does not remove 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>().

Example:

diff --git a/boost/typeind/type_index.html b/boost/typeind/type_index.html index a6de3ef..6e4f8f5 100644 --- a/boost/typeind/type_index.html +++ b/boost/typeind/type_index.html @@ -34,7 +34,7 @@ typedef platform specific type_index;
-

Description

+

Description

Depending on a compiler flags, optimal implementation of type_index will be used as a default boost::typeind::type_index.

Could be a boost::typeind::stl_type_index, boost::typeind::ctti_type_index or user defined type_index class.

diff --git a/boost/typeind/type_index_facade.html b/boost/typeind/type_index_facade.html index 8b0efaf..dbb0d87 100644 --- a/boost/typeind/type_index_facade.html +++ b/boost/typeind/type_index_facade.html @@ -37,22 +37,22 @@ // types typedef TypeInfo type_info_t; - // public member functions - const type_info_t & type_info() const noexcept; - const char * raw_name() const noexcept; - std::string pretty_name() const; - const char * name() const noexcept; - bool equal(const Derived &) const noexcept; - bool before(const Derived &) const noexcept; - std::size_t hash_code() const noexcept; + // public member functions + const type_info_t & type_info() const noexcept; + const char * raw_name() const noexcept; + std::string pretty_name() const; + const char * name() const noexcept; + bool equal(const Derived &) const noexcept; + bool before(const Derived &) const noexcept; + std::size_t hash_code() const noexcept; - // protected static functions - template<typename T> static Derived type_id() noexcept; - template<typename T> static Derived type_id_with_cvr() noexcept; - template<typename T> static Derived type_id_runtime(const T &) noexcept; + // protected static functions + template<typename T> static Derived type_id() noexcept; + template<typename T> static Derived type_id_with_cvr() noexcept; + template<typename T> static Derived type_id_runtime(const T &) noexcept; };
-

Description

+

Description

This class takes care about the comparison operators, hash functions and ostream operators. Use this class as a public base class for defining new type_info-conforming classes.

Example:

class stl_type_index: public type_index_facade<stl_type_index, std::type_info> 
@@ -72,7 +72,7 @@
 

-

Template Parameters

+

Template Parameters

  1. typename Derived
    @@ -85,11 +85,11 @@
-

-type_index_facade public member functions

+

+type_index_facade public member functions

  1. -
    const type_info_t & type_info() const noexcept;
    +
    const type_info_t & type_info() const noexcept;

    Override: This function must be redefined in Derived class. Overrides must not throw.

    @@ -101,7 +101,7 @@
  2. -
    const char * raw_name() const noexcept;
    +
    const char * raw_name() const noexcept;

    Override: This function must be redefined in Derived class. Overrides must not throw.

    @@ -113,7 +113,7 @@
  3. -
    std::string pretty_name() const;
    +
    std::string pretty_name() const;

    Override: This function must be redefined in Derived class. Overrides may throw.

    @@ -125,7 +125,7 @@
  4. -
    const char * name() const noexcept;
    +
    const char * name() const noexcept;

    Override: This function may be redefined in Derived class. Overrides must not throw.

    @@ -137,7 +137,7 @@
  5. -
    bool equal(const Derived & rhs) const noexcept;
    +
    bool equal(const Derived & rhs) const noexcept;

    Override: This function may be redefined in Derived class. Overrides must not throw.

    @@ -149,7 +149,7 @@
  6. -
    bool before(const Derived & rhs) const noexcept;
    +
    bool before(const Derived & rhs) const noexcept;

    Override: This function may be redefined in Derived class. Overrides must not throw.

    @@ -161,7 +161,7 @@
  7. -
    std::size_t hash_code() const noexcept;
    +
    std::size_t hash_code() const noexcept;

    Override: This function may be redefined in Derived class. Overrides must not throw.

    @@ -175,11 +175,11 @@
    -

    -type_index_facade protected static functions

    +

    +type_index_facade protected static functions

    1. -
      template<typename T> static Derived type_id() noexcept;
      +
      template<typename T> static Derived type_id() noexcept;

      This is a factory method that is used to create instances of Derived classes. boost::typeind::type_id() will call this method, if Derived has same type as boost::typeind::type_index.

      Override: This function may be redefined and made public in Derived class. Overrides must not throw. Overrides must remove const, volatile && and & modifiers from T. @@ -205,7 +205,7 @@

  8. -
    template<typename T> static Derived type_id_with_cvr() noexcept;
    +
    template<typename T> static Derived type_id_with_cvr() noexcept;

    This is a factory method that is used to create instances of Derived classes. boost::typeind::type_id_with_cvr() will call this method, if Derived has same type as boost::typeind::type_index.

    Override: This function may be redefined and made public in Derived class. Overrides must not throw. Overrides must not remove const, volatile && and & modifiers from T. @@ -232,7 +232,7 @@

  9. template<typename T> 
    -  static Derived type_id_runtime(const T & variable) noexcept;
    + static Derived type_id_runtime(const T & variable) noexcept;

This is a factory method that is used to create instances of Derived classes. boost::typeind::type_id_runtime(const T&) will call this method, if Derived has same type as boost::typeind::type_index.

Override: This function may be redefined and made public in Derived class. diff --git a/boost/typeind/type_info.html b/boost/typeind/type_info.html index 8c875c5..c4334f7 100644 --- a/boost/typeind/type_info.html +++ b/boost/typeind/type_info.html @@ -34,7 +34,7 @@ typedef type_index::type_info_t type_info;

-

Description

+

Description

Depending on a compiler flags, optimal implementation of type_info will be used as a default boost::typeind::type_info.

Could be a std::type_info, boost::typeind::detail::ctti_data or some user defined class.

type_info is not copyable or default constructible. It is not assignable too!

diff --git a/boost_typeindex/code_bloat.html b/boost_typeindex/code_bloat.html index b4bebec..ece1168 100644 --- a/boost_typeindex/code_bloat.html +++ b/boost_typeindex/code_bloat.html @@ -27,8 +27,8 @@ Code bloat

- Without RTTI TypeIndex library will switch from using boost::typeind::stl_type_info - class to boost::typeind::ctti_type_info. boost::typeind::ctti_type_info + Without RTTI TypeIndex library will switch from using boost::typeind::stl_type_index + class to boost::typeind::ctti_type_index. boost::typeind::ctti_type_index uses macro for getting full text representation of function name for each type that is passed to type_id() and type_id_with_cvr() diff --git a/boost_typeindex/compiler_support.html b/boost_typeindex/compiler_support.html index 5f80bab..a65fae3 100644 --- a/boost_typeindex/compiler_support.html +++ b/boost_typeindex/compiler_support.html @@ -77,7 +77,7 @@

With BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP - set to 0, boost::typeind::ctti_type_info::construct<int>().raw_name() + set to 0, boost::typeind::ctti_type_index::type_id<int>().raw_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 diff --git a/boost_typeindex/getting_started.html b/boost_typeindex/getting_started.html index 67f6dbc..a677aa8 100644 --- a/boost_typeindex/getting_started.html +++ b/boost_typeindex/getting_started.html @@ -98,17 +98,6 @@ -

const std::type_info&
-
- - -
const bti::type_info&   // when reference to `std::type_info` is required
-bti::type_index         // other cases
-
- - - -
typeid(T)
 typeid(please_save_modifiers<T>)
 typeid(T).name() // not human readable
@@ -123,6 +112,18 @@
 
+ + +
const std::type_info& v1 = typeid(int);  // when reference to `std::type_info` is required
+const std::type_info* v2 = &typeid(int); // other cases
+
+ + +
const bti::type_info& v1 = bti::type_id<int>().type_info();
+bti::type_index v2 = bti::type_id<int>();
+
+ + @@ -180,7 +181,7 @@
virtual const bti::type_info & type() const BOOST_NOEXCEPT
 {
     // now works even with RTTI disabled
-    return bti::type_id<ValueType>()->type_info();
+    return bti::type_id<ValueType>().type_info();
 }
 
@@ -257,7 +258,7 @@ template <typename T> const bti::type_info& operator()(const T&) const BOOST_NOEXCEPT { - return bti::type_id<T>()->type_info(); + return bti::type_id<T>().type_info(); } }; diff --git a/boost_typeindex/mixing_sources_with_rtti_on_and_.html b/boost_typeindex/mixing_sources_with_rtti_on_and_.html index ba7bb78..445042c 100644 --- a/boost_typeindex/mixing_sources_with_rtti_on_and_.html +++ b/boost_typeindex/mixing_sources_with_rtti_on_and_.html @@ -32,8 +32,8 @@ 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: just define BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY - macro. This would lead to usage of boost::typeind::ctti_type_info - instead of boost::typeind::stl_type_info class. + macro. This would lead to usage of same type_index class (boost::typeind::ctti_type_index + or boost::typeind::stl_type_index) all around the project.

@@ -75,12 +75,12 @@ diff --git a/boost_typeindex/space_and_performance.html b/boost_typeindex/space_and_performance.html index 21670e7..f2eb704 100644 --- a/boost_typeindex/space_and_performance.html +++ b/boost_typeindex/space_and_performance.html @@ -28,9 +28,9 @@

- boost::typeind::stl_type_info get_integer(); + boost::typeind::stl_type_index get_integer();

- boost::typeind::ctti_type_info get_integer(); + boost::typeind::ctti_type_index get_integer();

- +

Last revised: February 21, 2014 at 08:59:15 GMT

Last revised: February 21, 2014 at 13:52:51 GMT


diff --git a/standalone_HTML.manifest b/standalone_HTML.manifest index b358b27..45dabb7 100644 --- a/standalone_HTML.manifest +++ b/standalone_HTML.manifest @@ -10,6 +10,7 @@ boost/typeind/type_id_with_cvr.html boost/typeind/type_id_runtime.html BOOST_TYPE_INDEX_USER_TYPEINDEX.html BOOST_TYPE_INDEX_REGISTER_CLASS.html +BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY.html BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS.html boost/typeind/ctti_type_index.html BOOST_TYPE_INDEX_REGISTER_STL_CLASS.html