| Home | Libraries | People | FAQ | More

## Boost.TypeIndex Header Reference

### Header <boost/type_index.hpp>

Includes minimal set of headers required to use the Boost.TypeIndex library.

By inclusion of this file most optimal type index classes will be included and used as a boost::typeindex::type_index and boost::typeindex::type_info.

    BOOST_TYPE_INDEX_REGISTER_CLASS
    BOOST_TYPE_INDEX_FUNCTION_SIGNATURE
    BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING
    BOOST_TYPE_INDEX_USER_TYPEINDEX
    BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY

    namespace boost {
      namespace typeindex {
        typedef platform_specific type_index;
        typedef type_index::type_info_t type_info;
        template<typename T> type_index type_id();
        template<typename T> type_index type_id_with_cvr();
        template<typename T> type_index type_id_runtime(const T &);
      }
    }

### Header <boost/type_index/ctti_type_index.hpp>

Contains boost::typeindex::ctti_type_index class.

boost::typeindex::ctti_type_index class can be used as a drop-in replacement for std::type_index.

It is used in situations when typeid() method is not available or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined.

    namespace boost {
      namespace typeindex {
        class ctti_type_index;

        // Helper method for getting detail::ctti_data of a template parameter T.
        template<typename T> unspecified ctti_construct();
      }
    }

### Header <boost/type_index/stl_type_index.hpp>

Contains boost::typeindex::stl_type_index class.

boost::typeindex::stl_type_index class can be used as a drop-in replacement for std::type_index.

It is used in situations when RTTI is enabled or typeid() method is available. When typeid() is disabled or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined boost::typeindex::ctti is usually used instead of boost::typeindex::stl_type_index.

    namespace boost {
      namespace typeindex {
        class stl_type_index;
      }
    }

### Header <boost/type_index/type_index_facade.hpp>

    namespace boost {
      template<typename It> std::size_t hash_range(It, It);
      namespace typeindex {
        template<typename Derived, typename TypeInfo> class type_index_facade;

        // noexcept comparison operators for type_index_facade classes.
        bool operator==,!=,<,...(const type_index_facade & lhs,
                                 const type_index_facade & rhs);

        // noexcept comparison operators for type_index_facade and it's TypeInfo classes.
        bool operator==,!=,<,...(const type_index_facade & lhs,
                                 const TypeInfo & rhs);

        // noexcept comparison operators for type_index_facade's TypeInfo and type_index_facade classes.
        bool operator==,!=,<,...(const TypeInfo & lhs,
                                 const type_index_facade & rhs);

        // Ostream operator that will output demangled name.
        template<typename CharT, typename TriatT, typename Derived,
                 typename TypeInfo>
          std::basic_ostream< CharT, TriatT > &
          operator<<(std::basic_ostream< CharT, TriatT > & ostr,
                     const type_index_facade< Derived, TypeInfo > & ind);
        template<typename Derived, typename TypeInfo>
          std::size_t hash_value(const type_index_facade< Derived, TypeInfo > &);
      }
    }