Tatooine
invocable_with_n_types.h
Go to the documentation of this file.
1#ifndef TATOOINE_INVOCABLE_WITH_N_TYPES_H
2#define TATOOINE_INVOCABLE_WITH_N_TYPES_H
3//==============================================================================
4#include <utility>
5//==============================================================================
6namespace tatooine {
7//==============================================================================
11template <typename F, std::size_t N, typename... Ts>
13 //----------------------------------------------------------------------------
14 private:
15 template <typename T, std::size_t... NTimes>
16 static constexpr bool check(std::index_sequence<NTimes...>) {
17 return std::is_invocable_v<F, decltype(((void)NTimes, T{}))...>;
18 }
19 //----------------------------------------------------------------------------
20 public:
21 static constexpr bool value =
22 (check<Ts>(std::make_index_sequence<N>{}) && ...);
23};
24//==============================================================================
25template <typename F, std::size_t N>
27 : is_invocable_with_n_types_impl<F, N, bool, char, unsigned char, char16_t,
28 char32_t, wchar_t, short, unsigned short, int,
29 unsigned int, long, unsigned long, long long,
30 unsigned long long> {};
31// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
32template <typename F, std::size_t N>
33static constexpr auto is_invocable_with_n_integrals =
35// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
36template <typename F, std::size_t N>
38 is_invocable_with_n_integrals<F, N>;
39// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40template <typename F, std::size_t N>
42 : is_invocable_with_n_types_impl<F, N, float, double, long double> {};
43// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
44template <typename F, std::size_t N>
47// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
48template <typename F, std::size_t N>
50 is_invocable_with_n_floating_points<F, N>;
51//==============================================================================
52} // namespace tatooine
53//==============================================================================
54#endif
Definition: invocable_with_n_types.h:49
Definition: invocable_with_n_types.h:37
Definition: algorithm.h:6
static constexpr auto is_invocable_with_n_integrals
Definition: invocable_with_n_types.h:33
static constexpr bool is_invocable_with_n_floating_points
Definition: invocable_with_n_types.h:45
Definition: invocable_with_n_types.h:42
Definition: invocable_with_n_types.h:30
Definition: invocable_with_n_types.h:12
static constexpr bool check(std::index_sequence< NTimes... >)
Definition: invocable_with_n_types.h:16
static constexpr bool value
Definition: invocable_with_n_types.h:21