diff --git a/BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP.html b/BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP.html deleted file mode 100644 index e7577c5..0000000 --- a/BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP.html +++ /dev/null @@ -1,54 +0,0 @@ - -
- -![]() |
-Home | -Libraries | -People | -FAQ | -More | -
BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP
-// In header: <boost/type_index/template_info.hpp>
-
-BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
BOOST_TYPE_INDEX_CTTI_END_SKIP
-// In header: <boost/type_index/template_info.hpp>
-
-BOOST_TYPE_INDEX_CTTI_END_SKIP
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY
-// In header: <boost/type_index/type_info.hpp>
-
-BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY
Define the BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro if you are mixing objects compiled with different RTTI flags. This will force the usage of boost::template_index class instead of boost::type_index.
-- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
BOOST_TYPE_INDEX_FUNCTION_SIGNATURE
-// In header: <boost/type_index/template_info.hpp>
-
-BOOST_TYPE_INDEX_FUNCTION_SIGNATURE
BOOST_TYPE_INDEX_FUNCTION_SIGNATURE is used by boost::template_info class to deduce the name of a template parameter. If your compiler is not recognized by the TypeIndex library and you wish to work with boost::template_info, you may define this macro by yourself.
-BOOST_TYPE_INDEX_FUNCTION_SIGNATURE must be defined to a compiler specific macro, that outputs the WHOLE function signature, including template parameters.
-If your compiler is not recognised and BOOST_TYPE_INDEX_FUNCTION_SIGNATURE is not defined, then a compile-time error will arise at any attempt to use boost::template_info or boost::template_index classes.
-- | - |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
BOOST_TYPE_INDEX_REGISTER_CLASS
+// In header: <boost/type_index.hpp>
+
+BOOST_TYPE_INDEX_REGISTER_CLASS
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)); ++
+
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS
+// In header: <boost/type_index/ctti_register_class.hpp>
+
+BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
BOOST_TYPE_INDEX_REGISTER_STL_CLASS
+// In header: <boost/type_index/stl_register_class.hpp>
+
+BOOST_TYPE_INDEX_REGISTER_STL_CLASS
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
BOOST_TYPE_INDEX_USER_TYPEINDEX
+// In header: <boost/type_index.hpp>
+
+BOOST_TYPE_INDEX_USER_TYPEINDEX
+ | + |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::template_id
-// In header: <boost/type_index/template_info.hpp> - - -template<typename T> const template_info & template_id();
Method for constructing template_info
instance for type T. Strips const, volatile and & modifiers from T.
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::template_id_with_cvr
-// In header: <boost/type_index/template_info.hpp> - - -template<typename T> const template_info & template_id_with_cvr();
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>()
.
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
template_index
-// In header: <boost/type_index/template_index.hpp> - - -typedef template_info template_index;
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.
-- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::template_info
-// 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(); -};
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 member functionsbool 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.
-const char * name() const noexcept;Returns raw name.
std::string name_demangled() const;Returns user-friendly name.
bool operator==(const template_info & rhs) const noexcept;
bool operator!=(const template_info & rhs) const noexcept;
bool operator<(const template_info & rhs) const noexcept;
bool operator>(const template_info & rhs) const noexcept;
bool operator<=(const template_info & rhs) const noexcept;
bool operator>=(const template_info & rhs) const noexcept;
std::size_t hash_code() const noexcept;Function for getting hash value.
template_info
public static functionstemplate<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.
Works exactly like boost::template_id().
-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.
Works exactly like boost::template_id_with_cvr().
-- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::type_id
-// In header: <boost/type_index/type_info.hpp> - - -template<typename T> const type_info & type_id();
Function to get boost::type_info
for a type T. Strips const, volatile and & modifiers from T.
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::type_id_rtti_only
-// In header: <boost/type_index/type_info.hpp> - - -template<typename T> const type_info & type_id_rtti_only(T & rtti_val);
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"
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::type_id_rtti_only
-// In header: <boost/type_index/type_info.hpp> - - -template<typename T> const type_info & type_id_rtti_only(T * rtti_val);
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"
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::type_id_with_cvr
-// In header: <boost/type_index/type_info.hpp> - - -template<typename T> const type_info & type_id_with_cvr();
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>()
.
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::type_index
-// In header: <boost/type_index/type_index.hpp> - - -class type_index { -public: - // construct/copy/destruct - 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; - 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; -};
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/destructtype_index() noexcept;Default constructor.
type_index(const type_info & inf) noexcept;Constructs
type_index
from an instance of boost::type_info
. type_index(const std::type_info & inf) noexcept;Constructs
type_index
from an instance of std::type_info. type_index
public member functionsbool 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.
-const char * name() const noexcept;Returns raw name.
std::string name_demangled() const;Returns user-friendly name.
bool operator==(type_index const & rhs) const noexcept;
bool operator!=(type_index const & rhs) const noexcept;
bool operator<(type_index const & rhs) const noexcept;
bool operator>(type_index const & rhs) const noexcept;
bool operator<=(type_index const & rhs) const noexcept;
bool operator>=(type_index const & rhs) const noexcept;
bool operator==(std::type_info const & rhs) const noexcept;
bool operator!=(std::type_info const & rhs) const noexcept;
bool operator<(std::type_info const & rhs) const noexcept;
bool operator>(std::type_info const & rhs) const noexcept;
bool operator<=(std::type_info const & rhs) const noexcept;
bool operator>=(std::type_info const & rhs) const noexcept;
std::size_t hash_code() const noexcept;Function for getting hash value.
- | - |
![]() |
-Home | -Libraries | -People | -FAQ | -More | -
boost::type_info
-// In header: <boost/type_index/type_info.hpp> - - -class type_info { -public: - // construct/copy/destruct - type_info(); - type_info(const type_info &); - - // 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; -};
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_NO_RTTI_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
-
-boost::type_info is not copyable and is not default constructible. Use boost::type_id* functions to get const references to instances of boost::type_info objects.
- -type_info
public static functionstemplate<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.
Works exactly like boost::type_id().
-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>()
.
Works exactly like boost::type_id_with_cvr().
-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.
Same as boost::type_id_rtti_only().
-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.
Same as boost::type_id_rtti_only().
-type_info
public member functionsconst char * name() const noexcept;Returns mangled type name.
std::string name_demangled() const;Returns user-friendly name.
bool operator==(type_info const & rhs) const noexcept;
bool operator!=(type_info const & rhs) const noexcept;
bool operator==(std::type_info const & rhs) const noexcept;
bool operator!=(std::type_info const & rhs) const noexcept;
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 <
-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 <
-std::size_t hash_code() const noexcept;Function for getting hash value.
- | - |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
boost::typeind::ctti_type_index
+// In header: <boost/type_index/ctti_type_index.hpp> + + +class ctti_type_index { +public: + // types + typedef unspecified type_info_t; + + // construct/copy/destruct + 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 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; +};
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.
+This class produces slightly longer type names, so consider using stl_type_index in situations when typeid() is working.
+ + +ctti_type_index
public static functionstemplate<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 & variable) noexcept;
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
boost::typeind::stl_type_index
+// In header: <boost/type_index/stl_type_index.hpp> + + +class stl_type_index : + public boost::typeind::type_index_facade< stl_type_index, std::type_info > +{ +public: + // types + typedef std::type_info type_info_t; + + // construct/copy/destruct + 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 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; +};
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 member functionsconst 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 & rhs) const noexcept;
bool before(const stl_type_index & rhs) const noexcept;
stl_type_index
public static functionstemplate<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 & value) noexcept;
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
boost::typeind::type_id
+// In header: <boost/type_index.hpp> + + +template<typename T> type_index type_id();
Function to get boost::type_index for a type T. Removes const, volatile && and & modifiers from T.
+Example:
+type_index ti = type_id<int&>(); +std::cout << ti.pretty_name(); // Outputs 'int' ++
+ + +
+Template Parameters: |
+
|
+||
Returns: |
+boost::typeind::type_index with information about the specified type T. |
+||
Throws: |
+Nothing. | +
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
boost::typeind::type_id_runtime
+// In header: <boost/type_index.hpp> + + +template<typename T> type_index type_id_runtime(const T & runtime_val);
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.
+Example:
+struct Base { virtual ~Base(){} }; +struct Derived: public Base {}; +... +Derived d; +Base& b = d; +type_index ti = type_id_runtime(b); +std::cout << ti.pretty_name(); // Outputs 'Derived' ++
+ + +
+Parameters: |
+
|
+||
Returns: |
+boost::typeind::type_index with information about the specified variable. |
+||
Throws: |
+Nothing. | +
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
boost::typeind::type_id_with_cvr
+// In header: <boost/type_index.hpp> + + +template<typename T> type_index type_id_with_cvr();
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:
+type_index ti = type_id_with_cvr<int&>(); +std::cout << ti.pretty_name(); // Outputs 'int&' ++
+ + +
+Template Parameters: |
+
|
+||
Returns: |
+boost::typeind::type_index with information about the specified type T. |
+||
Throws: |
+Nothing. | +
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
type_index
+// In header: <boost/type_index.hpp> + + +typedef platform specific type_index;
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.
++ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
boost::typeind::type_index_facade
+// In header: <boost/type_index/type_index_facade.hpp> + +template<typename Derived, typename TypeInfo> +class type_index_facade { +public: + // 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; + + // 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; +};
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> +{ +public: + typedef std::type_info type_info_t; +private: + const type_info_t* data_; + +public: + stl_type_index(const type_info_t& data) noexcept + : data_(&data) + {} +// ... +}; ++
+
+typename Derived
+Class derived from type_index_facade
.
typename TypeInfo
+Class that will be used as a base type_info class.
+type_index_facade
public member functionsconst type_info_t & type_info() const noexcept;+
Override: This function must be redefined in Derived class. Overrides must not throw. +
+Returns: |
+Const reference to underlying low level type_info_t. |
+
const char * raw_name() const noexcept;+
Override: This function must be redefined in Derived class. Overrides must not throw. +
+Returns: |
+Pointer to unredable/raw type name. |
+
std::string pretty_name() const;+
Override: This function must be redefined in Derived class. Overrides may throw. +
+Returns: |
+Human redable type name. |
+
const char * name() const noexcept;+
Override: This function may be redefined in Derived class. Overrides must not throw. +
+Returns: |
+Name of a type. By default retuns raw_name(). |
+
bool equal(const Derived & rhs) const noexcept;+
Override: This function may be redefined in Derived class. Overrides must not throw. +
+Returns: |
+True if two types are equal. By default compares types by raw_name(). |
+
bool before(const Derived & rhs) const noexcept;+
Override: This function may be redefined in Derived class. Overrides must not throw. +
+Returns: |
+True if rhs is greater than this. By default compares types by raw_name(). |
+
std::size_t hash_code() const noexcept;+
Override: This function may be redefined in Derived class. Overrides must not throw. +
+Returns: |
+Hash code of a type. By default hashes types by raw_name(). |
+
type_index_facade
protected static functionstemplate<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. + +
+Template Parameters: |
+
|
+||
Returns: |
+type_index for type T. |
+
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. + +
+Template Parameters: |
+
|
+||
Returns: |
+type_index for type T. |
+
template<typename T> + 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. + +
+Parameters: |
+
|
+||
Returns: |
+type_index with runtime type of variable. |
+
+ | + |
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
type_info
+// In header: <boost/type_index.hpp> + + +typedef type_index::type_info_t type_info;
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!
++ | + |
- |