forked from boostorg/type_index
Moved some of the classes from boost::typeind::detail namespace to boost::typeind namespace
This commit is contained in:
@ -38,11 +38,11 @@
|
||||
namespace boost { namespace typeind {
|
||||
|
||||
#if defined(BOOST_TYPE_INDEX_USER_TYPEINFO) && defined(BOOST_TYPE_INDEX_USER_TYPEINFO_NAME)
|
||||
typedef boost::typeind::detail::type_index_base<BOOST_TYPE_INDEX_USER_TYPEINFO_NAME> type_index;
|
||||
typedef BOOST_TYPE_INDEX_USER_TYPEINFO_NAME type_index;
|
||||
#elif (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC)
|
||||
typedef boost::typeind::detail::stl_type_index type_index;
|
||||
typedef boost::typeind::stl_type_index type_index;
|
||||
#else
|
||||
typedef boost::typeind::detail::ctti_type_index type_index;
|
||||
typedef boost::typeind::ctti_type_index type_index;
|
||||
#endif
|
||||
|
||||
typedef type_index::type_info_t type_info;
|
||||
|
@ -34,7 +34,9 @@
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/functional/hash_fwd.hpp>
|
||||
|
||||
namespace boost { namespace typeind { namespace detail {
|
||||
namespace boost { namespace typeind {
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct ctti_data {
|
||||
const char* typename_;
|
||||
@ -46,12 +48,13 @@ inline const ctti_data& ctti_construct() BOOST_NOEXCEPT {
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
class ctti_type_index: public type_index_facade<ctti_type_index, ctti_data> {
|
||||
const ctti_data* data_;
|
||||
class ctti_type_index: public type_index_facade<ctti_type_index, detail::ctti_data> {
|
||||
const detail::ctti_data* data_;
|
||||
|
||||
public:
|
||||
typedef ctti_data type_info_t;
|
||||
typedef detail::ctti_data type_info_t;
|
||||
|
||||
inline ctti_type_index(const type_info_t& data) BOOST_NOEXCEPT
|
||||
: data_(&data)
|
||||
@ -85,14 +88,14 @@ template <class T>
|
||||
inline ctti_type_index ctti_type_index::construct() BOOST_NOEXCEPT {
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_reference<T>::type no_ref_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_cv<no_ref_t>::type no_cvr_t;
|
||||
return ctti_construct<no_cvr_t>();
|
||||
return detail::ctti_construct<no_cvr_t>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T>
|
||||
inline ctti_type_index ctti_type_index::construct_with_cvr() BOOST_NOEXCEPT {
|
||||
return ctti_construct<T>();
|
||||
return detail::ctti_construct<T>();
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +104,7 @@ inline ctti_type_index ctti_type_index::construct_runtime(const T* rtti_val) BOO
|
||||
BOOST_STATIC_ASSERT_MSG(sizeof(T) && false,
|
||||
"type_id_runtime(const T*) and type_index::construct_runtime(const T*) require RTTI");
|
||||
|
||||
return ctti_construct<T>();
|
||||
return detail::ctti_construct<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@ -109,7 +112,7 @@ inline ctti_type_index ctti_type_index::construct_runtime(const T& rtti_val) BOO
|
||||
BOOST_STATIC_ASSERT_MSG(sizeof(T) && false,
|
||||
"type_id_runtime(const T&) and type_index::construct_runtime(const T&) require RTTI");
|
||||
|
||||
return ctti_construct<T>();
|
||||
return detail::ctti_construct<T>();
|
||||
}
|
||||
|
||||
|
||||
@ -123,7 +126,7 @@ inline const char* ctti_type_index::name() const BOOST_NOEXCEPT {
|
||||
}
|
||||
|
||||
inline std::string ctti_type_index::pretty_name() const {
|
||||
std::size_t len = std::strlen(raw_name() + ctti_skip_size_at_end);
|
||||
std::size_t len = std::strlen(raw_name() + detail::ctti_skip_size_at_end);
|
||||
while (raw_name()[len - 1] == ' ') --len; // MSVC sometimes adds whitespaces
|
||||
return std::string(raw_name(), len);
|
||||
}
|
||||
@ -144,7 +147,7 @@ inline std::size_t ctti_type_index::hash_code() const BOOST_NOEXCEPT {
|
||||
}
|
||||
|
||||
|
||||
}}} // namespace boost::typeind::detail
|
||||
}} // namespace boost::typeind
|
||||
|
||||
|
||||
#endif // BOOST_TYPE_INDEX_CTTI_TYPE_INDEX_IPP
|
||||
|
@ -59,7 +59,7 @@
|
||||
# include <boost/type_traits/is_arithmetic.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace typeind { namespace detail {
|
||||
namespace boost { namespace typeind {
|
||||
|
||||
class stl_type_index
|
||||
: public type_index_facade<
|
||||
@ -223,8 +223,9 @@ inline stl_type_index stl_type_index::construct() BOOST_NOEXCEPT {
|
||||
return typeid(no_cvr_t);
|
||||
}
|
||||
|
||||
template <class T> class cvr_saver{};
|
||||
|
||||
namespace detail {
|
||||
template <class T> class cvr_saver{};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline stl_type_index stl_type_index::construct_with_cvr() BOOST_NOEXCEPT {
|
||||
@ -232,7 +233,7 @@ inline stl_type_index stl_type_index::construct_with_cvr() BOOST_NOEXCEPT {
|
||||
boost::is_reference<T>::value
|
||||
|| boost::is_const<T>::value
|
||||
|| boost::is_volatile<T>::value,
|
||||
cvr_saver<T>,
|
||||
detail::cvr_saver<T>,
|
||||
T
|
||||
>::type type;
|
||||
|
||||
@ -257,7 +258,7 @@ inline stl_type_index stl_type_index::construct_runtime(const T& value) BOOST_NO
|
||||
return typeid(value);
|
||||
}
|
||||
|
||||
}}} // namespace boost::typeind::detail
|
||||
}} // namespace boost::typeind
|
||||
|
||||
|
||||
#endif // BOOST_TYPE_INDEX_STL_TYPE_INDEX_HPP
|
||||
|
@ -25,7 +25,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace boost { namespace typeind { namespace detail {
|
||||
namespace boost { namespace typeind {
|
||||
|
||||
/// type_index_facade - use as a public base class for defining new
|
||||
/// standard-conforming iterators.
|
||||
@ -198,7 +198,7 @@ inline std::size_t hash_value(const type_index_facade<Derived, TypeInfo>& lhs) B
|
||||
return lhs.hash_code();
|
||||
}
|
||||
|
||||
}}} // namespace boost::typeind::detail
|
||||
}} // namespace boost::typeind
|
||||
|
||||
#endif // BOOST_TYPE_INDEX_TYPE_INDEX_FACADE_HPP
|
||||
|
||||
|
Reference in New Issue
Block a user