capydi
Loading...
Searching...
No Matches
FunctionTraits.hpp
Go to the documentation of this file.
1#ifndef FUNCTION_TYPE_TRAITS_HPP_
2#define FUNCTION_TYPE_TRAITS_HPP_
3
5
6namespace capy::meta
7{
8
9template<typename T>
11
12template<typename ReturnValue_, bool IsNoexcept, typename... Params_>
13struct function_traits<ReturnValue_(Params_...) noexcept(IsNoexcept)>
14{
15 using ReturnValue = ReturnValue_;
16 using Params = Pack<Params_...>;
17
18 static constexpr bool IS_NOEXCEPT = IsNoexcept;
19};
20
21template<typename Class, typename ReturnValue_, bool IsNoexcept, typename... Params_>
22struct function_traits<ReturnValue_(Class::*)(Params_...) const noexcept(IsNoexcept)>
23{
24 using ReturnValue = ReturnValue_;
25 using Params = Pack<Params_...>;
26
27 static constexpr bool IS_NOEXCEPT = IsNoexcept;
28};
29
30template<typename Function>
32
33template<typename Function>
35
36template<typename Function>
38
39template<typename T>
40auto create_static_method_exists_and_is_unique(int*) -> args_pack_t<decltype(T::create)>;
41
42template<typename T>
44
45template<typename T>
46constexpr bool create_static_method_exists_and_is_unique_v = !std::same_as<
48 int
49>;
50
51}
52
53#endif //FUNCTION_TYPE_TRAITS_HPP_
Compile-time type pack utilities and metaprogramming foundations.
Definition Rebind.hpp:7
constexpr bool create_static_method_exists_and_is_unique_v
Definition FunctionTraits.hpp:46
typename function_traits< Function >::Params args_pack_t
Definition FunctionTraits.hpp:34
constexpr bool is_noexcept_v
Definition FunctionTraits.hpp:37
auto create_static_method_exists_and_is_unique(int *) -> args_pack_t< decltype(T::create)>
typename function_traits< Function >::ReturnValue return_value_t
Definition FunctionTraits.hpp:31
A compile-time heterogeneous type list.
Definition Pack.hpp:70
Pack< Params_... > Params
Definition FunctionTraits.hpp:16
static constexpr bool IS_NOEXCEPT
Definition FunctionTraits.hpp:18
Definition FunctionTraits.hpp:10