diff --git a/doc/type_index.qbk b/doc/type_index.qbk index ef3be83..b0c484a 100644 --- a/doc/type_index.qbk +++ b/doc/type_index.qbk @@ -31,7 +31,7 @@ Boost.TypeIndex library was designed to work around all those issues. [section Getting started] -`boost::typeind::type_info` is a drop-in replacement for `std::type_info` and `boost::typeind::type_index` +`boost::typeindex::type_info` is a drop-in replacement for `std::type_info` and `boost::typeindex::type_index` is a drop-in replacement for `std::type_index`. Unlike Standard Library versions those classes may work without RTTI. `type_index` provides the full set of comparison operators, hashing functions and ostream @@ -53,7 +53,7 @@ To start using Boost.TypeIndex: [[`` std::type_index ``][`` - boost::typeind::type_index + boost::typeindex::type_index ``]] [[`` @@ -62,18 +62,18 @@ To start using Boost.TypeIndex: typeid(T).name() // not human readable typeid(variable) ``][`` - boost::typeind::type_id() - boost::typeind::type_id_with_cvr() - boost::typeind::type_id().pretty_name() // human readable - boost::typeind::type_id_runtime(variable) + boost::typeindex::type_id() + boost::typeindex::type_id_with_cvr() + boost::typeindex::type_id().pretty_name() // human readable + boost::typeindex::type_id_runtime(variable) ``]] [[`` 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 boost::typeind::type_info& v1 = boost::typeind::type_id().type_info(); - boost::typeind::type_index v2 = boost::typeind::type_id(); + const boost::typeindex::type_info& v1 = boost::typeindex::type_id().type_info(); + boost::typeindex::type_index v2 = boost::typeindex::type_id(); ``]] ] @@ -95,10 +95,10 @@ Here is how TypeIndex could be used in `boost/any.hpp`: return typeid(ValueType); } ``] [`` - virtual const boost::typeind::type_info & type() const BOOST_NOEXCEPT + virtual const boost::typeindex::type_info & type() const BOOST_NOEXCEPT { // now works even with RTTI disabled - return boost::typeind::type_id().type_info(); + return boost::typeindex::type_id().type_info(); } ``]] ] @@ -138,14 +138,14 @@ public: // visitor interfaces #endif // BOOST_NO_TYPEID ``][`` class reflect - : public static_visitor + : public static_visitor { public: // visitor interfaces template - const boost::typeind::type_info& operator()(const T&) const BOOST_NOEXCEPT + const boost::typeindex::type_info& operator()(const T&) const BOOST_NOEXCEPT { - return boost::typeind::type_id().type_info(); + return boost::typeindex::type_id().type_info(); } }; @@ -159,7 +159,7 @@ public: // visitor interfaces } #endif ``] [`` - const boost::typeind::type_info& type() const + const boost::typeindex::type_info& type() const { detail::variant::reflect visitor; return this->apply_visitor(visitor); @@ -174,7 +174,7 @@ public: // visitor interfaces `type_index` is just a typedef for `stl_type_index` or `ctti_type_index`. Depending on the `typeid()` availability TypeIndex library will choose an optimal class for -`type_index`. In cases when at least basic support for `typeid()` is available `boost::typeind::stl_type_index` +`type_index`. In cases when at least basic support for `typeid()` is available `boost::typeindex::stl_type_index` will be used. `BOOST_TYPE_INDEX_REGISTER_CLASS` macro is a helper macro that places some virtual helper functions or @@ -243,8 +243,8 @@ so prefer using `stl_type_index` type when possible. [section Code bloat] -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 +Without RTTI TypeIndex library will switch from using `boost::typeindex::stl_type_index` class to +`boost::typeindex::ctti_type_index`. `boost::typeindex::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()` functions. @@ -283,7 +283,7 @@ feature request to add your compiler to supported compilers list. Include Consider the following example: With `BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP` and `BOOST_TYPE_INDEX_CTTI_END_SKIP` set to `0`, -`boost::typeind::ctti_type_index::type_id().raw_name()` returns +`boost::typeindex::ctti_type_index::type_id().raw_name()` returns "const char *__cdecl boost::detail::ctti::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)") - 1`. @@ -295,8 +295,8 @@ and `BOOST_TYPE_INDEX_CTTI_END_SKIP` to `sizeof(">::n(void)") - 1`. 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: just define `BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY` -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. +macro. This would lead to usage of same type_index class (`boost::typeindex::ctti_type_index` or +`boost::typeindex::stl_type_index`) all around the project. [note Do not forget to rebuild *all* the projects with `BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY` macro defined ] @@ -308,7 +308,7 @@ RTTI flags: [table:diffs [[RTTI on] [RTTI off]] -[[`boost::typeind::stl_type_index get_integer();`] [`boost::typeind::ctti_type_index get_integer();`]] +[[`boost::typeindex::stl_type_index get_integer();`] [`boost::typeindex::ctti_type_index get_integer();`]] ] Such differences are usually not detected by linker and lead to errors at runtime. diff --git a/examples/demangled_names.cpp b/examples/demangled_names.cpp index bcaecf5..11f561d 100644 --- a/examples/demangled_names.cpp +++ b/examples/demangled_names.cpp @@ -14,12 +14,11 @@ #include #include -namespace bti = boost::typeind; template void foo(T) { - std::cout << "\n Short name: " << boost::typeind::type_id().raw_name(); - std::cout << "\n Readable name: " << boost::typeind::type_id().pretty_name(); + std::cout << "\n Short name: " << boost::typeindex::type_id().raw_name(); + std::cout << "\n Readable name: " << boost::typeindex::type_id().pretty_name(); } struct user_defined_type{}; diff --git a/examples/exact_types_match.cpp b/examples/exact_types_match.cpp index fd23f50..7521bf5 100644 --- a/examples/exact_types_match.cpp +++ b/examples/exact_types_match.cpp @@ -21,18 +21,18 @@ class type_erased_unary_function { void* function_ptr_; - boost::typeind::type_index exact_param_t_; + boost::typeindex::type_index exact_param_t_; public: template type_erased_unary_function(void(*ptr)(ParamT)) : function_ptr_(reinterpret_cast(ptr)) // ptr - is a pointer to function returning `void` and accepting parameter of type `ParamT` - , exact_param_t_(boost::typeind::type_id_with_cvr()) + , exact_param_t_(boost::typeindex::type_id_with_cvr()) {} template void call(ParamT v) { - if (exact_param_t_ != boost::typeind::type_id_with_cvr()) { + if (exact_param_t_ != boost::typeindex::type_id_with_cvr()) { throw std::runtime_error("Incorrect `ParamT`"); } diff --git a/examples/inheritance.cpp b/examples/inheritance.cpp index caf1dfb..c263439 100644 --- a/examples/inheritance.cpp +++ b/examples/inheritance.cpp @@ -23,7 +23,7 @@ struct B: public A { BOOST_TYPE_INDEX_REGISTER_CLASS }; struct C: public B { BOOST_TYPE_INDEX_REGISTER_CLASS }; void print_real_type(const A& a) { - std::cout << boost::typeind::type_id_runtime(a).pretty_name() << '\n'; + std::cout << boost::typeindex::type_id_runtime(a).pretty_name() << '\n'; } int main() { diff --git a/examples/registry.cpp b/examples/registry.cpp index 457cce9..2d14a9a 100644 --- a/examples/registry.cpp +++ b/examples/registry.cpp @@ -16,22 +16,22 @@ #include int main() { - boost::unordered_set types; + boost::unordered_set types; // Storing some `boost::type_info`s - types.insert(boost::typeind::type_id()); - types.insert(boost::typeind::type_id()); + types.insert(boost::typeindex::type_id()); + types.insert(boost::typeindex::type_id()); // `types` variable contains two `boost::type_index`es: assert(types.size() == 2); // Const, volatile and reference will be striped from the type: - bool is_inserted = types.insert(boost::typeind::type_id()).second; + bool is_inserted = types.insert(boost::typeindex::type_id()).second; assert(!is_inserted); - assert(types.erase(boost::typeind::type_id()) == 1); + assert(types.erase(boost::typeindex::type_id()) == 1); // We have erased the `float` type, only `int` remains - assert(*types.begin() == boost::typeind::type_id()); + assert(*types.begin() == boost::typeindex::type_id()); } //] [/type_index_registry_example] diff --git a/examples/user_defined_typeinfo.cpp b/examples/user_defined_typeinfo.cpp index 902556f..948989d 100644 --- a/examples/user_defined_typeinfo.cpp +++ b/examples/user_defined_typeinfo.cpp @@ -7,7 +7,7 @@ //[type_index_my_type_index_worldwide_macro /*` - There is an easy way to force `boost::typeind::type_id` to use your own type_index class. + There is an easy way to force `boost::typeindex::type_id` to use your own type_index class. All we need to do is just define `BOOST_TYPE_INDEX_USER_TYPEINDEX` to the full path to header file of your type index class: @@ -56,7 +56,7 @@ int main() { /*` That's it! Now all TypeIndex global methods and typedefs will be using your class: */ - boost::typeind::type_index worldwide = boost::typeind::type_id(); + boost::typeindex::type_index worldwide = boost::typeindex::type_id(); assert(worldwide.pretty_name() == "my_classes"); assert(worldwide == my_type_index::type_id()); //][/type_index_my_type_index_worldwide_usage] diff --git a/examples/user_defined_typeinfo.hpp b/examples/user_defined_typeinfo.hpp index 8d63869..5690a00 100644 --- a/examples/user_defined_typeinfo.hpp +++ b/examples/user_defined_typeinfo.hpp @@ -75,7 +75,7 @@ namespace my_namespace { namespace detail { */ namespace my_namespace { -class my_type_index: public boost::typeind::type_index_facade { +class my_type_index: public boost::typeindex::type_index_facade { const detail::my_typeinfo* data_; public: @@ -118,7 +118,7 @@ public: } // namespace my_namespace /*` - Note that we have used the boost::typeind::type_index_facade class as base. + Note that we have used the boost::typeindex::type_index_facade class as base. That class took care about all the helper function and operators (comparison, hashing, ostreaming and others). */ @@ -186,7 +186,7 @@ struct my_struct: public my_class { You'll also need to add some typedefs and macro to your "user_defined_typeinfo.hpp" header file: */ #define BOOST_TYPE_INDEX_REGISTER_CLASS MY_TYPEINDEX_REGISTER_CLASS -namespace boost { namespace typeind { +namespace boost { namespace typeindex { typedef my_namespace::my_type_index type_index; }} //] [/type_index_my_type_index_worldwide_typedefs] diff --git a/include/boost/type_index.hpp b/include/boost/type_index.hpp index 4025018..c55b6f8 100644 --- a/include/boost/type_index.hpp +++ b/include/boost/type_index.hpp @@ -12,7 +12,7 @@ /// \brief 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::typeind::type_index and boost::typeind::type_info. +/// as a boost::typeindex::type_index and boost::typeindex::type_info. // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -33,33 +33,33 @@ # include #endif -namespace boost { namespace typeind { +namespace boost { namespace typeindex { #if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) /// Depending on a compiler flags, optimal implementation of type_index will be used - /// as a default boost::typeind::type_index. + /// as a default boost::typeindex::type_index. /// - /// Could be a boost::typeind::stl_type_index, boost::typeind::ctti_type_index or + /// Could be a boost::typeindex::stl_type_index, boost::typeindex::ctti_type_index or /// user defined type_index class. typedef platform-specific type_index; #elif defined(BOOST_TYPE_INDEX_USER_TYPEINDEX) // Nothing to do #elif (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) - typedef boost::typeind::stl_type_index type_index; + typedef boost::typeindex::stl_type_index type_index; # ifdef BOOST_NO_RTTI # define BOOST_TYPE_INDEX_REGISTER_CLASS BOOST_TYPE_INDEX_REGISTER_STL_CLASS # else # define BOOST_TYPE_INDEX_REGISTER_CLASS # endif #else - typedef boost::typeind::ctti_type_index type_index; + typedef boost::typeindex::ctti_type_index type_index; # define BOOST_TYPE_INDEX_REGISTER_CLASS BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS #endif /// Depending on a compiler flags, optimal implementation of type_info will be used -/// as a default boost::typeind::type_info. +/// as a default boost::typeindex::type_info. /// -/// Could be a std::type_info, boost::typeind::detail::ctti_data or +/// Could be a std::type_info, boost::typeindex::detail::ctti_data or /// some user defined class. /// /// type_info \b is \b not copyable or default constructible. It is \b not assignable too! @@ -102,7 +102,7 @@ typedef type_index::type_info_t type_info; /// /// C c1; /// A* pc1 = &c1; -/// assert(boost::typeind::type_id() == boost::typeind::type_id_runtime(*pc1)); +/// assert(boost::typeindex::type_id() == boost::typeindex::type_id_runtime(*pc1)); /// \endcode #define BOOST_TYPE_INDEX_REGISTER_CLASS nothing-or-some-virtual-functions @@ -126,7 +126,7 @@ typedef type_index::type_info_t type_info; /// /// \tparam T Type for which type_index must be created. /// \throw Nothing. -/// \return boost::typeind::type_index with information about the specified type T. +/// \return boost::typeindex::type_index with information about the specified type T. template inline type_index type_id() BOOST_NOEXCEPT { return type_index::type_id(); @@ -146,7 +146,7 @@ inline type_index type_id() BOOST_NOEXCEPT { /// /// \tparam T Type for which type_index must be created. /// \throw Nothing. -/// \return boost::typeind::type_index with information about the specified type T. +/// \return boost::typeindex::type_index with information about the specified type T. template inline type_index type_id_with_cvr() BOOST_NOEXCEPT { return type_index::type_id_with_cvr(); @@ -171,13 +171,13 @@ inline type_index type_id_with_cvr() BOOST_NOEXCEPT { /// /// \param runtime_val Varaible which runtime type must be returned. /// \throw Nothing. -/// \return boost::typeind::type_index with information about the specified variable. +/// \return boost::typeindex::type_index with information about the specified variable. template inline type_index type_id_runtime(const T& runtime_val) BOOST_NOEXCEPT { return type_index::type_id_runtime(runtime_val); } -}} // namespace boost::typeind +}} // namespace boost::typeindex diff --git a/include/boost/type_index/ctti_register_class.hpp b/include/boost/type_index/ctti_register_class.hpp index d7a4b7c..2a30571 100644 --- a/include/boost/type_index/ctti_register_class.hpp +++ b/include/boost/type_index/ctti_register_class.hpp @@ -19,14 +19,14 @@ #include -namespace boost { namespace typeind { namespace detail { +namespace boost { namespace typeindex { namespace detail { template inline const ctti_data& ctti_construct_typeid_ref(const T*) BOOST_NOEXCEPT { return ctti_construct(); } -}}} // namespace boost::typeind::detail +}}} // namespace boost::typeindex::detail /// \def BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS /// BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS is used by BOOST_TYPE_INDEX_REGISTER_CLASS when RTTI is off @@ -35,8 +35,8 @@ inline const ctti_data& ctti_construct_typeid_ref(const T*) BOOST_NOEXCEPT { /// BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS macro expands to declaration and implementation of /// `virtual const detail::ctti_data& type_id_runtime() const` method. #define BOOST_TYPE_INDEX_REGISTER_CTTI_CLASS \ - virtual const boost::typeind::detail::ctti_data& type_id_runtime() const BOOST_NOEXCEPT { \ - return boost::typeind::detail::ctti_construct_typeid_ref(this); \ + virtual const boost::typeindex::detail::ctti_data& type_id_runtime() const BOOST_NOEXCEPT { \ + return boost::typeindex::detail::ctti_construct_typeid_ref(this); \ } \ /**/ diff --git a/include/boost/type_index/ctti_type_index.hpp b/include/boost/type_index/ctti_type_index.hpp index 3d543e2..21a9970 100644 --- a/include/boost/type_index/ctti_type_index.hpp +++ b/include/boost/type_index/ctti_type_index.hpp @@ -15,9 +15,9 @@ #endif /// \file ctti_type_index.hpp -/// \brief Contains boost::typeind::ctti_type_index class. +/// \brief Contains boost::typeindex::ctti_type_index class. /// -/// boost::typeind::ctti_type_index class can be used as a drop-in replacement +/// 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 @@ -31,7 +31,7 @@ #include #include -namespace boost { namespace typeind { +namespace boost { namespace typeindex { namespace detail { @@ -147,7 +147,7 @@ inline std::size_t ctti_type_index::hash_code() const BOOST_NOEXCEPT { } -}} // namespace boost::typeind +}} // namespace boost::typeindex #endif // BOOST_TYPE_INDEX_CTTI_TYPE_INDEX_HPP diff --git a/include/boost/type_index/detail/compile_time_type_info.hpp b/include/boost/type_index/detail/compile_time_type_info.hpp index f3fff16..ad53863 100644 --- a/include/boost/type_index/detail/compile_time_type_info.hpp +++ b/include/boost/type_index/detail/compile_time_type_info.hpp @@ -22,7 +22,7 @@ #include #include -namespace boost { namespace typeind { namespace detail { +namespace boost { namespace typeindex { namespace detail { #if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) @@ -89,7 +89,7 @@ namespace boost { namespace typeind { namespace detail { BOOST_STATIC_CONSTANT(std::size_t, ctti_skip_size_at_end = 0); // skip nothing #endif -}}} // namespace boost::typeind::detail +}}} // namespace boost::typeindex::detail namespace boost { namespace detail { @@ -104,9 +104,9 @@ struct ctti { /// Returns raw name. Must be as short, as possible, to avoid code bloat static const char* n() BOOST_NOEXCEPT { #if defined(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE) - return BOOST_TYPE_INDEX_FUNCTION_SIGNATURE + boost::typeind::detail::ctti_skip_size_at_begin; + return BOOST_TYPE_INDEX_FUNCTION_SIGNATURE + boost::typeindex::detail::ctti_skip_size_at_begin; #elif defined(__FUNCSIG__) - return __FUNCSIG__ + boost::typeind::detail::ctti_skip_size_at_begin; + return __FUNCSIG__ + boost::typeindex::detail::ctti_skip_size_at_begin; #elif defined(__PRETTY_FUNCTION__) \ || defined(__GNUC__) \ || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) \ @@ -114,7 +114,7 @@ struct ctti { || defined(__ghs__) \ || defined(__DMC__) - return __PRETTY_FUNCTION__ + boost::typeind::detail::ctti_skip_size_at_begin; + return __PRETTY_FUNCTION__ + boost::typeindex::detail::ctti_skip_size_at_begin; #else BOOST_STATIC_ASSERT_MSG( sizeof(T) && false, diff --git a/include/boost/type_index/stl_register_class.hpp b/include/boost/type_index/stl_register_class.hpp index e26a347..6bbd180 100644 --- a/include/boost/type_index/stl_register_class.hpp +++ b/include/boost/type_index/stl_register_class.hpp @@ -19,14 +19,14 @@ #include -namespace boost { namespace typeind { namespace detail { +namespace boost { namespace typeindex { namespace detail { template inline const stl_type_index::type_info_t& stl_construct_typeid_ref(const T*) BOOST_NOEXCEPT { return typeid(T); } -}}} // namespace boost::typeind::detail +}}} // namespace boost::typeindex::detail /// \def BOOST_TYPE_INDEX_REGISTER_STL_CLASS @@ -36,8 +36,8 @@ inline const stl_type_index::type_info_t& stl_construct_typeid_ref(const T*) BOO /// BOOST_TYPE_INDEX_REGISTER_STL_CLASS macro expands to declaration and implementation of /// `virtual const std::type_info& type_id_runtime() const` method. #define BOOST_TYPE_INDEX_REGISTER_STL_CLASS \ - virtual const boost::typeind::stl_type_index::type_info_t& type_id_runtime() const BOOST_NOEXCEPT { \ - return boost::typeind::detail::stl_construct_typeid_ref(this); \ + virtual const boost::typeindex::stl_type_index::type_info_t& type_id_runtime() const BOOST_NOEXCEPT { \ + return boost::typeindex::detail::stl_construct_typeid_ref(this); \ } \ /**/ diff --git a/include/boost/type_index/stl_type_index.hpp b/include/boost/type_index/stl_type_index.hpp index 9109a43..538aa7d 100644 --- a/include/boost/type_index/stl_type_index.hpp +++ b/include/boost/type_index/stl_type_index.hpp @@ -15,14 +15,14 @@ #endif /// \file stl_type_index.hpp -/// \brief Contains boost::typeind::stl_type_index class. +/// \brief Contains boost::typeindex::stl_type_index class. /// -/// boost::typeind::stl_type_index class can be used as a drop-in replacement +/// 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::typeind::ctti is usually used instead of boost::typeind::stl_type_index. +/// is defined boost::typeindex::ctti is usually used instead of boost::typeindex::stl_type_index. #include @@ -58,7 +58,7 @@ # include #endif -namespace boost { namespace typeind { +namespace boost { namespace typeindex { /// \class stl_type_index /// This class is a wrapper around std::type_info, that workarounds issues and provides @@ -150,12 +150,12 @@ inline std::string stl_type_index::pretty_name() const { free(demang); #endif - std::string::size_type pos = ret.find("boost::typeind::detail::cvr_saver<"); + std::string::size_type pos = ret.find("boost::typeindex::detail::cvr_saver<"); if (pos == std::string::npos) { return ret; } - pos += sizeof("boost::typeind::detail::cvr_saver<") - 1; + pos += sizeof("boost::typeindex::detail::cvr_saver<") - 1; while (ret[pos] == ' ') { ++ pos; } @@ -255,7 +255,7 @@ inline stl_type_index stl_type_index::type_id_runtime(const T& value) BOOST_NOEX #endif } -}} // namespace boost::typeind +}} // namespace boost::typeindex #endif // BOOST_TYPE_INDEX_STL_TYPE_INDEX_HPP diff --git a/include/boost/type_index/type_index_facade.hpp b/include/boost/type_index/type_index_facade.hpp index aa70517..02b6e2e 100644 --- a/include/boost/type_index/type_index_facade.hpp +++ b/include/boost/type_index/type_index_facade.hpp @@ -27,7 +27,7 @@ #endif #endif -namespace boost { namespace typeind { +namespace boost { namespace typeindex { /// \class type_index_facade /// @@ -110,7 +110,7 @@ public: #if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) protected: /// 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. + /// boost::typeindex::type_id() will call this method, if Derived has same type as boost::typeindex::type_index. /// /// \b Override: This function \b may be redefined and made public in Derived class. Overrides \b must not throw. /// Overrides \b must remove const, volatile && and & modifiers from T. @@ -120,7 +120,7 @@ protected: static Derived type_id() BOOST_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. + /// boost::typeindex::type_id_with_cvr() will call this method, if Derived has same type as boost::typeindex::type_index. /// /// \b Override: This function \b may be redefined and made public in Derived class. Overrides \b must not throw. /// Overrides \b must \b not remove const, volatile && and & modifiers from T. @@ -130,7 +130,7 @@ protected: static Derived type_id_with_cvr() BOOST_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. + /// boost::typeindex::type_id_runtime(const T&) will call this method, if Derived has same type as boost::typeindex::type_index. /// /// \b Override: This function \b may be redefined and made public in Derived class. /// \param variable Variable which runtime type will be stored in type_index. @@ -283,7 +283,7 @@ inline std::size_t hash_value(const type_index_facade& lhs) B return static_cast(lhs).hash_code(); } -}} // namespace boost::typeind +}} // namespace boost::typeindex #endif // BOOST_TYPE_INDEX_TYPE_INDEX_FACADE_HPP diff --git a/test/test_lib.cpp b/test/test_lib.cpp index 8a63284..dcb3d44 100644 --- a/test/test_lib.cpp +++ b/test/test_lib.cpp @@ -7,25 +7,25 @@ namespace user_defined_namespace { namespace test_lib { -boost::typeind::type_index get_integer() { - return boost::typeind::type_id(); +boost::typeindex::type_index get_integer() { + return boost::typeindex::type_id(); } -boost::typeind::type_index get_user_defined_class() { - return boost::typeind::type_id(); +boost::typeindex::type_index get_user_defined_class() { + return boost::typeindex::type_id(); } -boost::typeind::type_index get_const_integer() { - return boost::typeind::type_id_with_cvr(); +boost::typeindex::type_index get_const_integer() { + return boost::typeindex::type_id_with_cvr(); } -boost::typeind::type_index get_const_user_defined_class() { - return boost::typeind::type_id_with_cvr(); +boost::typeindex::type_index get_const_user_defined_class() { + return boost::typeindex::type_id_with_cvr(); } // Just do nothing -void accept_typeindex(const boost::typeind::type_index&) {} +void accept_typeindex(const boost::typeindex::type_index&) {} } diff --git a/test/test_lib.hpp b/test/test_lib.hpp index 37f52e7..8521312 100644 --- a/test/test_lib.hpp +++ b/test/test_lib.hpp @@ -25,14 +25,14 @@ namespace test_lib { -TEST_LIB_DECL boost::typeind::type_index get_integer(); -TEST_LIB_DECL boost::typeind::type_index get_user_defined_class(); +TEST_LIB_DECL boost::typeindex::type_index get_integer(); +TEST_LIB_DECL boost::typeindex::type_index get_user_defined_class(); -TEST_LIB_DECL boost::typeind::type_index get_const_integer(); -TEST_LIB_DECL boost::typeind::type_index get_const_user_defined_class(); +TEST_LIB_DECL boost::typeindex::type_index get_const_integer(); +TEST_LIB_DECL boost::typeindex::type_index get_const_user_defined_class(); // This is required for checking RTTI on/off linkage -TEST_LIB_DECL void accept_typeindex(const boost::typeind::type_index&); +TEST_LIB_DECL void accept_typeindex(const boost::typeindex::type_index&); } diff --git a/test/testing_crossmodule.cpp b/test/testing_crossmodule.cpp index 675501d..3204bd4 100644 --- a/test/testing_crossmodule.cpp +++ b/test/testing_crossmodule.cpp @@ -17,8 +17,8 @@ namespace user_defined_namespace { BOOST_AUTO_TEST_CASE(comparing_types_between_modules) { - boost::typeind::type_index t_const_int = boost::typeind::type_id_with_cvr(); - boost::typeind::type_index t_int = boost::typeind::type_id(); + boost::typeindex::type_index t_const_int = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t_int = boost::typeindex::type_id(); BOOST_CHECK_EQUAL(t_int, test_lib::get_integer()); BOOST_CHECK_EQUAL(t_const_int, test_lib::get_const_integer()); @@ -26,10 +26,10 @@ BOOST_AUTO_TEST_CASE(comparing_types_between_modules) BOOST_CHECK_NE(t_int, test_lib::get_const_integer()); - boost::typeind::type_index t_const_userdef - = boost::typeind::type_id_with_cvr(); - boost::typeind::type_index t_userdef - = boost::typeind::type_id(); + boost::typeindex::type_index t_const_userdef + = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t_userdef + = boost::typeindex::type_id(); BOOST_CHECK_EQUAL(t_userdef, test_lib::get_user_defined_class()); BOOST_CHECK_EQUAL(t_const_userdef, test_lib::get_const_user_defined_class()); diff --git a/test/type_index_test.cpp b/test/type_index_test.cpp index 0e5a901..7f5ede0 100644 --- a/test/type_index_test.cpp +++ b/test/type_index_test.cpp @@ -25,7 +25,7 @@ namespace my_namespace2 { BOOST_AUTO_TEST_CASE(names_matches_type_id) { - using namespace boost::typeind; + using namespace boost::typeindex; BOOST_CHECK_EQUAL(type_id().pretty_name(), "int"); BOOST_CHECK_EQUAL(type_id().pretty_name(), "double"); @@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(names_matches_type_id) BOOST_AUTO_TEST_CASE(default_construction) { - using namespace boost::typeind; + using namespace boost::typeindex; type_index ti1, ti2; BOOST_CHECK_EQUAL(ti1, ti2); BOOST_CHECK_EQUAL(type_id(), ti1); @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(default_construction) BOOST_AUTO_TEST_CASE(copy_construction) { - using namespace boost::typeind; + using namespace boost::typeindex; type_index ti1, ti2 = type_id(); BOOST_CHECK_NE(ti1, ti2); ti1 = ti2; @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(copy_construction) BOOST_AUTO_TEST_CASE(comparators_type_id) { - using namespace boost::typeind; + using namespace boost::typeindex; type_index t_int = type_id(); type_index t_double = type_id(); @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(comparators_type_id) BOOST_AUTO_TEST_CASE(hash_code_type_id) { - using namespace boost::typeind; + using namespace boost::typeindex; std::size_t t_int1 = type_id().hash_code(); std::size_t t_double1 = type_id().hash_code(); @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(hash_code_type_id) template static void test_with_modofiers() { - using namespace boost::typeind; + using namespace boost::typeindex; type_index t1 = type_id_with_cvr(); type_index t2 = type_id_with_cvr(); @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(type_id_storing_modifiers) template static void test_storing_nonstoring_modifiers_templ() { - using namespace boost::typeind; + using namespace boost::typeindex; type_index t1 = type_id_with_cvr(); type_index t2 = type_id(); @@ -203,15 +203,15 @@ BOOST_AUTO_TEST_CASE(type_id_storing_modifiers_vs_nonstoring) test_storing_nonstoring_modifiers_templ(); test_storing_nonstoring_modifiers_templ(); - boost::typeind::type_index t1 = boost::typeind::type_id_with_cvr(); - boost::typeind::type_index t2 = boost::typeind::type_id(); + boost::typeindex::type_index t1 = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t2 = boost::typeindex::type_id(); BOOST_CHECK_NE(t2, t1); BOOST_CHECK(t1.pretty_name() == "const int" || t1.pretty_name() == "int const"); } BOOST_AUTO_TEST_CASE(type_index_stream_operator_via_lexical_cast_testing) { - using namespace boost::typeind; + using namespace boost::typeindex; std::string s_int2 = boost::lexical_cast(type_id()); BOOST_CHECK_EQUAL(s_int2, "int"); @@ -222,7 +222,7 @@ BOOST_AUTO_TEST_CASE(type_index_stream_operator_via_lexical_cast_testing) BOOST_AUTO_TEST_CASE(type_index_stripping_cvr_test) { - using namespace boost::typeind; + using namespace boost::typeindex; BOOST_CHECK_EQUAL(type_id(), type_id()); BOOST_CHECK_EQUAL(type_id(), type_id()); @@ -245,7 +245,7 @@ BOOST_AUTO_TEST_CASE(type_index_stripping_cvr_test) BOOST_AUTO_TEST_CASE(type_index_user_defined_class_test) { - using namespace boost::typeind; + using namespace boost::typeindex; BOOST_CHECK_EQUAL(type_id(), type_id()); BOOST_CHECK_EQUAL(type_id(), type_id()); @@ -297,28 +297,28 @@ BOOST_AUTO_TEST_CASE(comparators_type_id_runtime) BOOST_CHECK(typeid(&rc1) == typeid(pb1)); BOOST_CHECK(typeid(&rb1) == typeid(pc1)); #else - BOOST_CHECK(boost::typeind::type_index(pc1->type_id_runtime()).raw_name()); + BOOST_CHECK(boost::typeindex::type_index(pc1->type_id_runtime()).raw_name()); #endif - BOOST_CHECK_EQUAL(boost::typeind::type_id_runtime(rc1), boost::typeind::type_id_runtime(*pc1)); - BOOST_CHECK_EQUAL(boost::typeind::type_id(), boost::typeind::type_id_runtime(*pc1)); - BOOST_CHECK_EQUAL(boost::typeind::type_id_runtime(rb1), boost::typeind::type_id_runtime(*pb1)); - BOOST_CHECK_EQUAL(boost::typeind::type_id(), boost::typeind::type_id_runtime(*pb1)); + BOOST_CHECK_EQUAL(boost::typeindex::type_id_runtime(rc1), boost::typeindex::type_id_runtime(*pc1)); + BOOST_CHECK_EQUAL(boost::typeindex::type_id(), boost::typeindex::type_id_runtime(*pc1)); + BOOST_CHECK_EQUAL(boost::typeindex::type_id_runtime(rb1), boost::typeindex::type_id_runtime(*pb1)); + BOOST_CHECK_EQUAL(boost::typeindex::type_id(), boost::typeindex::type_id_runtime(*pb1)); - BOOST_CHECK_NE(boost::typeind::type_id_runtime(rc1), boost::typeind::type_id_runtime(*pb1)); - BOOST_CHECK_NE(boost::typeind::type_id_runtime(rb1), boost::typeind::type_id_runtime(*pc1)); + BOOST_CHECK_NE(boost::typeindex::type_id_runtime(rc1), boost::typeindex::type_id_runtime(*pb1)); + BOOST_CHECK_NE(boost::typeindex::type_id_runtime(rb1), boost::typeindex::type_id_runtime(*pc1)); #ifndef BOOST_NO_RTTI - BOOST_CHECK_EQUAL(boost::typeind::type_id_runtime(&rc1), boost::typeind::type_id_runtime(pb1)); - BOOST_CHECK_EQUAL(boost::typeind::type_id_runtime(&rb1), boost::typeind::type_id_runtime(pc1)); + BOOST_CHECK_EQUAL(boost::typeindex::type_id_runtime(&rc1), boost::typeindex::type_id_runtime(pb1)); + BOOST_CHECK_EQUAL(boost::typeindex::type_id_runtime(&rb1), boost::typeindex::type_id_runtime(pc1)); - BOOST_CHECK(boost::typeind::type_id_runtime(rc1) == typeid(*pc1)); - BOOST_CHECK(boost::typeind::type_id_runtime(rb1) == typeid(*pb1)); + BOOST_CHECK(boost::typeindex::type_id_runtime(rc1) == typeid(*pc1)); + BOOST_CHECK(boost::typeindex::type_id_runtime(rb1) == typeid(*pb1)); - BOOST_CHECK(boost::typeind::type_id_runtime(rc1) != typeid(*pb1)); - BOOST_CHECK(boost::typeind::type_id_runtime(rb1) != typeid(*pc1)); - BOOST_CHECK(boost::typeind::type_id_runtime(&rc1) == typeid(pb1)); - BOOST_CHECK(boost::typeind::type_id_runtime(&rb1) == typeid(pc1)); + BOOST_CHECK(boost::typeindex::type_id_runtime(rc1) != typeid(*pb1)); + BOOST_CHECK(boost::typeindex::type_id_runtime(rb1) != typeid(*pc1)); + BOOST_CHECK(boost::typeindex::type_id_runtime(&rc1) == typeid(pb1)); + BOOST_CHECK(boost::typeindex::type_id_runtime(&rb1) == typeid(pc1)); #endif } @@ -327,7 +327,7 @@ BOOST_AUTO_TEST_CASE(comparators_type_id_runtime) BOOST_AUTO_TEST_CASE(comparators_type_id_vs_type_info) { - using namespace boost::typeind; + using namespace boost::typeindex; type_index t_int = type_id(); BOOST_CHECK(t_int == typeid(int)); diff --git a/test/type_index_test_ctti_alignment.cpp b/test/type_index_test_ctti_alignment.cpp index b2f57d2..7ed4f8b 100644 --- a/test/type_index_test_ctti_alignment.cpp +++ b/test/type_index_test_ctti_alignment.cpp @@ -10,8 +10,8 @@ int main() { BOOST_STATIC_ASSERT_MSG( - boost::alignment_of::value == boost::alignment_of::value, - "Alignments of boost::typeind::detail::ctti_data and char differ. " + boost::alignment_of::value == boost::alignment_of::value, + "Alignments of boost::typeindex::detail::ctti_data and char differ. " "It is unsafe to reinterpret_cast between them." ); } diff --git a/test/type_index_test_ctti_construct_fail.cpp b/test/type_index_test_ctti_construct_fail.cpp index 1c2cdc7..23f03ff 100644 --- a/test/type_index_test_ctti_construct_fail.cpp +++ b/test/type_index_test_ctti_construct_fail.cpp @@ -8,7 +8,7 @@ #include int main() { - using namespace boost::typeind; + using namespace boost::typeindex; ctti_type_index::type_info_t t; (void)t; } diff --git a/test/type_index_test_ctti_copy_fail.cpp b/test/type_index_test_ctti_copy_fail.cpp index 0133bd6..f4482f1 100644 --- a/test/type_index_test_ctti_copy_fail.cpp +++ b/test/type_index_test_ctti_copy_fail.cpp @@ -8,7 +8,7 @@ #include int main() { - using namespace boost::typeind; + using namespace boost::typeindex; ctti_type_index::type_info_t t = ctti_type_index::type_id().type_info(); (void)t; }