AsmGrader 0.0.0
Loading...
Searching...
No Matches
functional_traits.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <boost/mp11/algorithm.hpp>
6#include <boost/mp11/detail/mp_list.hpp>
7
8#include <cstddef>
9
10namespace asmgrader {
11
12template <typename Func>
14{
15 static_assert(always_false_v<Func>, "Must be instantiated with a callable type");
16};
17
18template <typename FuncRet, typename... FuncArgs>
19struct FunctionTraits<FuncRet(FuncArgs...)>
20{
21 using Ret = FuncRet;
22
23 using Args = boost::mp11::mp_list<FuncArgs...>;
24
25 template <std::size_t I>
26 requires(I < boost::mp11::mp_size<Args>::value)
27 struct Arg
28 {
29 using type = boost::mp11::mp_at_c<Args, I>;
30 };
31};
32
33} // namespace asmgrader
Definition asm_buffer.hpp:19
constexpr bool always_false_v
Definition always_false.hpp:16
boost::mp11::mp_at_c< Args, I > type
Definition functional_traits.hpp:29
boost::mp11::mp_list< FuncArgs... > Args
Definition functional_traits.hpp:23
FuncRet Ret
Definition functional_traits.hpp:21
Definition functional_traits.hpp:14