2
0
mirror of https://github.com/boostorg/compat.git synced 2026-01-19 04:02:16 +00:00

Rename detail::nontype11 to nttp_holder

This commit is contained in:
Peter Dimov
2025-11-01 19:45:39 +02:00
parent 4c9e9079c1
commit 6b9e52c284
4 changed files with 21 additions and 21 deletions

View File

@@ -91,19 +91,19 @@ public:
}
template <class F, F f>
function_ref_base(mem_fn_tag, nontype11<F, f>)
function_ref_base(mem_fn_tag, nttp_holder<F, f>)
: thunk_{}, invoke_(&invoke_mem_fn_holder<F, f, Const, NoEx, R, Args...>::invoke_mem_fn) {
thunk_.pobj_ = nullptr;
}
template <class F, F f, class U>
function_ref_base(mem_fn_tag, nontype11<F, f>, U&& obj)
function_ref_base(mem_fn_tag, nttp_holder<F, f>, U&& obj)
: thunk_{}, invoke_(&invoke_target_mem_fn_holder<F, f, U, Const, NoEx, R, Args...>::invoke_mem_fn) {
thunk_.pobj_ = const_cast<void*>(static_cast<void const*>(std::addressof(obj)));
}
template <class F, F f, class T>
function_ref_base(mem_fn_tag, nontype11<F, f>, T* obj)
function_ref_base(mem_fn_tag, nttp_holder<F, f>, T* obj)
: thunk_{}, invoke_(&invoke_ptr_mem_fn_holder<F, f, T, Const, NoEx, R, Args...>::invoke_mem_fn) {
thunk_.pobj_ = const_cast<void*>(static_cast<void const*>(obj));
}
@@ -138,14 +138,14 @@ public:
function_ref(F&& fn) noexcept : base_type(obj_tag{}, fn) {}
template <class F, F f, enable_if_t<is_invocable_using<F>::value, int> = 0>
function_ref(detail::nontype11<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
function_ref(detail::nttp_holder<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
template <class F, F f, class U, class T = remove_reference_t<U>,
enable_if_t<!std::is_rvalue_reference<U&&>::value && is_invocable_using<F, T&>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
function_ref(detail::nttp_holder<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
template <class F, F f, class T, enable_if_t<is_invocable_using<F, T*>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, T* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(detail::nttp_holder<F, f> x, T* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(const function_ref&) noexcept = default;
function_ref& operator=(const function_ref&) noexcept = default;
@@ -176,14 +176,14 @@ public:
function_ref(F&& fn) noexcept : base_type(obj_tag{}, fn) {}
template <class F, F f, enable_if_t<is_invocable_using<F>::value, int> = 0>
function_ref(detail::nontype11<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
function_ref(detail::nttp_holder<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
template <class F, F f, class U, class T = remove_reference_t<U>,
enable_if_t<!std::is_rvalue_reference<U&&>::value && is_invocable_using<F, T const&>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
function_ref(detail::nttp_holder<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
template <class F, F f, class T, enable_if_t<is_invocable_using<F, T const*>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, T const* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(detail::nttp_holder<F, f> x, T const* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(const function_ref&) noexcept = default;
function_ref& operator=(const function_ref&) noexcept = default;
@@ -216,14 +216,14 @@ public:
function_ref(F&& fn) noexcept : base_type(obj_tag{}, fn) {}
template <class F, F f, enable_if_t<is_invocable_using<F>::value, int> = 0>
function_ref(detail::nontype11<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
function_ref(detail::nttp_holder<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
template <class F, F f, class U, class T = remove_reference_t<U>,
enable_if_t<!std::is_rvalue_reference<U&&>::value && is_invocable_using<F, T&>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
function_ref(detail::nttp_holder<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
template <class F, F f, class T, enable_if_t<is_invocable_using<F, T*>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, T* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(detail::nttp_holder<F, f> x, T* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(const function_ref&) noexcept = default;
function_ref& operator=(const function_ref&) noexcept = default;
@@ -254,14 +254,14 @@ public:
function_ref(F&& fn) noexcept : base_type(obj_tag{}, fn) {}
template <class F, F f, enable_if_t<is_invocable_using<F>::value, int> = 0>
function_ref(detail::nontype11<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
function_ref(detail::nttp_holder<F, f> x) noexcept : base_type(mem_fn_tag{}, x) {}
template <class F, F f, class U, class T = remove_reference_t<U>,
enable_if_t<!std::is_rvalue_reference<U&&>::value && is_invocable_using<F, T const&>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
function_ref(detail::nttp_holder<F, f> x, U&& obj) noexcept : base_type(mem_fn_tag{}, x, std::forward<U>(obj)) {}
template <class F, F f, class T, enable_if_t<is_invocable_using<F, T const*>::value, int> = 0>
function_ref(detail::nontype11<F, f> x, T const* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(detail::nttp_holder<F, f> x, T const* obj) noexcept : base_type(mem_fn_tag{}, x, obj) {}
function_ref(const function_ref&) noexcept = default;
function_ref& operator=(const function_ref&) noexcept = default;

View File

@@ -13,7 +13,7 @@ namespace compat {
namespace detail {
template<class V, V v> struct nontype11
template<class V, V v> struct nttp_holder
{
};
@@ -21,7 +21,7 @@ template<class V, V v> struct nontype11
#if defined(__cpp_nontype_template_parameter_auto) && __cpp_nontype_template_parameter_auto >= 201606L
template<auto V> struct nontype_t: public detail::nontype11<decltype(V), V>
template<auto V> struct nontype_t: public detail::nttp_holder<decltype(V), V>
{
explicit nontype_t() = default;
};

View File

@@ -19,8 +19,8 @@
#else
#define NONTYPE(fn) compat::detail::nontype11<decltype(fn), fn>{}
#define NONTYPE_T(fn) compat::detail::nontype11<decltype(fn), fn>
#define NONTYPE(fn) compat::detail::nttp_holder<decltype(fn), fn>{}
#define NONTYPE_T(fn) compat::detail::nttp_holder<decltype(fn), fn>
#endif

View File

@@ -19,8 +19,8 @@
#else
#define NONTYPE(fn) compat::detail::nontype11<decltype(fn), fn>{}
#define NONTYPE_T(fn) compat::detail::nontype11<decltype(fn), fn>
#define NONTYPE(fn) compat::detail::nttp_holder<decltype(fn), fn>{}
#define NONTYPE_T(fn) compat::detail::nttp_holder<decltype(fn), fn>
#endif