| Home | Libraries | People | FAQ | More

## Class ctti_type_index

boost::typeindex::ctti_type_index

## Synopsis

    // In header: <boost/type_index/ctti_type_index.hpp>

    class ctti_type_index {
    public:
      // types
      typedef unspecified type_info_t;

      // construct/copy/destruct
      explicit ctti_type_index(const char *) noexcept;
      ctti_type_index() noexcept;
      ctti_type_index(const type_info_t &) noexcept;

      // private member functions
      std::size_t get_raw_name_length() const noexcept;

      // public member functions
      const type_info_t & type_info() const noexcept;
      constexpr const char * raw_name() const noexcept;
      constexpr const char * name() const noexcept;
      std::string pretty_name() const;
      std::size_t hash_code() const noexcept;
      constexpr bool equal(const ctti_type_index &) const noexcept;
      constexpr bool before(const ctti_type_index &) const noexcept;

      // public static functions
      template<typename T> static constexpr ctti_type_index type_id() noexcept;
      template<typename T>
        static constexpr ctti_type_index type_id_with_cvr() noexcept;
      template<typename T>
        static ctti_type_index type_id_runtime(const T &) noexcept;
    };

## 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 on C++14 compatible compilers has following functions marked as constexpr:

- default constructor

- copy constructors and assignemnt operations

- class methods: name(), before(const ctti_type_index& rhs), equal(const ctti_type_index& rhs)

- static methods type_id<T>(), type_id_with_cvr<T>()

- comparison operators

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.     explicit ctti_type_index(const char * data) noexcept;

2.     ctti_type_index() noexcept;

3.     ctti_type_index(const type_info_t & data) noexcept;

### `ctti_type_index` private member functions

1.     std::size_t get_raw_name_length() const noexcept;

### `ctti_type_index` public member functions

1.     const type_info_t & type_info() const noexcept;

2.     constexpr const char * raw_name() const noexcept;

3.     constexpr const char * name() const noexcept;

4.     std::string pretty_name() const;

5.     std::size_t hash_code() const noexcept;

6.     constexpr bool equal(const ctti_type_index & rhs) const noexcept;

7.     constexpr bool before(const ctti_type_index & rhs) const noexcept;

### `ctti_type_index` public static functions

1.     template<typename T> static constexpr ctti_type_index type_id() noexcept;

2.     template<typename T>
         static constexpr ctti_type_index type_id_with_cvr() noexcept;

3.     template<typename T>
         static ctti_type_index type_id_runtime(const T & variable) noexcept;