Skip to content

Commit

Permalink
Update contrib/restricted/boost/type_index to 1.84.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-piglet committed Dec 21, 2023
1 parent f65299c commit 756d6bb
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ target_link_libraries(restricted-boost-type_index INTERFACE
restricted-boost-config
restricted-boost-container_hash
restricted-boost-core
restricted-boost-preprocessor
restricted-boost-static_assert
restricted-boost-throw_exception
restricted-boost-type_traits
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ target_link_libraries(restricted-boost-type_index INTERFACE
restricted-boost-config
restricted-boost-container_hash
restricted-boost-core
restricted-boost-preprocessor
restricted-boost-static_assert
restricted-boost-throw_exception
restricted-boost-type_traits
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ target_link_libraries(restricted-boost-type_index INTERFACE
restricted-boost-config
restricted-boost-container_hash
restricted-boost-core
restricted-boost-preprocessor
restricted-boost-static_assert
restricted-boost-throw_exception
restricted-boost-type_traits
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ target_link_libraries(restricted-boost-type_index INTERFACE
restricted-boost-config
restricted-boost-container_hash
restricted-boost-core
restricted-boost-preprocessor
restricted-boost-static_assert
restricted-boost-throw_exception
restricted-boost-type_traits
)
26 changes: 3 additions & 23 deletions contrib/restricted/boost/type_index/include/boost/type_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,6 @@
# pragma once
#endif



#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || \
defined(BOOST_NO_CXX11_CONSTEXPR) || \
defined(BOOST_NO_CXX11_NULLPTR) || \
defined(BOOST_NO_CXX11_NOEXCEPT) || \
defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || \
defined(BOOST_NO_CXX11_FINAL) || \
defined(BOOST_NO_CXX11_ALIGNOF) || \
defined(BOOST_NO_CXX11_STATIC_ASSERT) || \
defined(BOOST_NO_CXX11_SMART_PTR) || \
defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || \
defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)

BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.TypeIndex 1.82 and will be removed in Boost.TypeIndex 1.84.")

#endif

#if defined(BOOST_TYPE_INDEX_USER_TYPEINDEX)
# error #include BOOST_TYPE_INDEX_USER_TYPEINDEX
# ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH
Expand Down Expand Up @@ -228,7 +208,7 @@ typedef type_index::type_info_t type_info;
/// \throw Nothing.
/// \return boost::typeindex::type_index with information about the specified type T.
template <class T>
inline type_index type_id() BOOST_NOEXCEPT {
inline type_index type_id() noexcept {
return type_index::type_id<T>();
}

Expand All @@ -248,7 +228,7 @@ inline type_index type_id() BOOST_NOEXCEPT {
/// \throw Nothing.
/// \return boost::typeindex::type_index with information about the specified type T.
template <class T>
inline type_index type_id_with_cvr() BOOST_NOEXCEPT {
inline type_index type_id_with_cvr() noexcept {
return type_index::type_id_with_cvr<T>();
}

Expand All @@ -273,7 +253,7 @@ inline type_index type_id_with_cvr() BOOST_NOEXCEPT {
/// \throw Nothing.
/// \return boost::typeindex::type_index with information about the specified variable.
template <class T>
inline type_index type_id_runtime(const T& runtime_val) BOOST_NOEXCEPT {
inline type_index type_id_runtime(const T& runtime_val) noexcept {
return type_index::type_id_runtime(runtime_val);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
#include <boost/type_index/detail/compile_time_type_info.hpp>

#include <cstring>
#include <type_traits>
#include <boost/container_hash/hash.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
Expand Down Expand Up @@ -58,24 +56,17 @@ namespace detail {
/// std::cout << ti.pretty_name();
/// \endcode
class ctti_data {
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
public:
ctti_data() = delete;
ctti_data(const ctti_data&) = delete;
ctti_data& operator=(const ctti_data&) = delete;
#else
private:
ctti_data();
ctti_data(const ctti_data&);
ctti_data& operator=(const ctti_data&);
#endif
};

} // namespace detail

/// Helper method for getting detail::ctti_data of a template parameter T.
template <class T>
inline const detail::ctti_data& ctti_construct() BOOST_NOEXCEPT {
inline const detail::ctti_data& ctti_construct() noexcept {
// Standard C++11, 5.2.10 Reinterpret cast:
// An object pointer can be explicitly converted to an object pointer of a different type. When a prvalue
// v of type "pointer to T1" is converted to the type "pointer to cv T2", the result is static_cast<cv
Expand Down Expand Up @@ -105,93 +96,93 @@ inline const detail::ctti_data& ctti_construct() BOOST_NOEXCEPT {
class ctti_type_index: public type_index_facade<ctti_type_index, detail::ctti_data> {
const char* data_;

inline std::size_t get_raw_name_length() const BOOST_NOEXCEPT;
inline std::size_t get_raw_name_length() const noexcept;

BOOST_CXX14_CONSTEXPR inline explicit ctti_type_index(const char* data) BOOST_NOEXCEPT
BOOST_CXX14_CONSTEXPR inline explicit ctti_type_index(const char* data) noexcept
: data_(data)
{}

public:
typedef detail::ctti_data type_info_t;

BOOST_CXX14_CONSTEXPR inline ctti_type_index() BOOST_NOEXCEPT
BOOST_CXX14_CONSTEXPR inline ctti_type_index() noexcept
: data_(boost::detail::ctti<void>::n())
{}

inline ctti_type_index(const type_info_t& data) BOOST_NOEXCEPT
inline ctti_type_index(const type_info_t& data) noexcept
: data_(reinterpret_cast<const char*>(&data))
{}

inline const type_info_t& type_info() const BOOST_NOEXCEPT;
BOOST_CXX14_CONSTEXPR inline const char* raw_name() const BOOST_NOEXCEPT;
BOOST_CXX14_CONSTEXPR inline const char* name() const BOOST_NOEXCEPT;
inline const type_info_t& type_info() const noexcept;
BOOST_CXX14_CONSTEXPR inline const char* raw_name() const noexcept;
BOOST_CXX14_CONSTEXPR inline const char* name() const noexcept;
inline std::string pretty_name() const;
inline std::size_t hash_code() const BOOST_NOEXCEPT;
inline std::size_t hash_code() const noexcept;

BOOST_CXX14_CONSTEXPR inline bool equal(const ctti_type_index& rhs) const BOOST_NOEXCEPT;
BOOST_CXX14_CONSTEXPR inline bool before(const ctti_type_index& rhs) const BOOST_NOEXCEPT;
BOOST_CXX14_CONSTEXPR inline bool equal(const ctti_type_index& rhs) const noexcept;
BOOST_CXX14_CONSTEXPR inline bool before(const ctti_type_index& rhs) const noexcept;

template <class T>
BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id() BOOST_NOEXCEPT;
BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id() noexcept;

template <class T>
BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id_with_cvr() BOOST_NOEXCEPT;
BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id_with_cvr() noexcept;

template <class T>
inline static ctti_type_index type_id_runtime(const T& variable) BOOST_NOEXCEPT;
inline static ctti_type_index type_id_runtime(const T& variable) noexcept;
};


inline const ctti_type_index::type_info_t& ctti_type_index::type_info() const BOOST_NOEXCEPT {
inline const ctti_type_index::type_info_t& ctti_type_index::type_info() const noexcept {
return *reinterpret_cast<const detail::ctti_data*>(data_);
}


BOOST_CXX14_CONSTEXPR inline bool ctti_type_index::equal(const ctti_type_index& rhs) const BOOST_NOEXCEPT {
BOOST_CXX14_CONSTEXPR inline bool ctti_type_index::equal(const ctti_type_index& rhs) const noexcept {
const char* const left = raw_name();
const char* const right = rhs.raw_name();
return /*left == right ||*/ !boost::typeindex::detail::constexpr_strcmp(left, right);
}

BOOST_CXX14_CONSTEXPR inline bool ctti_type_index::before(const ctti_type_index& rhs) const BOOST_NOEXCEPT {
BOOST_CXX14_CONSTEXPR inline bool ctti_type_index::before(const ctti_type_index& rhs) const noexcept {
const char* const left = raw_name();
const char* const right = rhs.raw_name();
return /*left != right &&*/ boost::typeindex::detail::constexpr_strcmp(left, right) < 0;
}


template <class T>
BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id() 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;
BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id() noexcept {
typedef typename std::remove_reference<T>::type no_ref_t;
typedef typename std::remove_cv<no_ref_t>::type no_cvr_t;
return ctti_type_index(boost::detail::ctti<no_cvr_t>::n());
}



template <class T>
BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id_with_cvr() BOOST_NOEXCEPT {
BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id_with_cvr() noexcept {
return ctti_type_index(boost::detail::ctti<T>::n());
}


template <class T>
inline ctti_type_index ctti_type_index::type_id_runtime(const T& variable) BOOST_NOEXCEPT {
inline ctti_type_index ctti_type_index::type_id_runtime(const T& variable) noexcept {
return variable.boost_type_index_type_id_runtime_();
}


BOOST_CXX14_CONSTEXPR inline const char* ctti_type_index::raw_name() const BOOST_NOEXCEPT {
BOOST_CXX14_CONSTEXPR inline const char* ctti_type_index::raw_name() const noexcept {
return data_;
}


BOOST_CXX14_CONSTEXPR inline const char* ctti_type_index::name() const BOOST_NOEXCEPT {
BOOST_CXX14_CONSTEXPR inline const char* ctti_type_index::name() const noexcept {
return data_;
}

inline std::size_t ctti_type_index::get_raw_name_length() const BOOST_NOEXCEPT {
return std::strlen(raw_name() + detail::ctti_skip_size_at_end);
inline std::size_t ctti_type_index::get_raw_name_length() const noexcept {
return std::strlen(raw_name() + detail::skip().size_at_end);
}


Expand All @@ -202,7 +193,7 @@ inline std::string ctti_type_index::pretty_name() const {
}


inline std::size_t ctti_type_index::hash_code() const BOOST_NOEXCEPT {
inline std::size_t ctti_type_index::hash_code() const noexcept {
return boost::hash_range(raw_name(), raw_name() + get_raw_name_length());
}

Expand Down
Loading

0 comments on commit 756d6bb

Please sign in to comment.