codex
Loading...
Searching...
No Matches
c_wrapper.hpp
Go to the documentation of this file.
1
#ifndef CODEX_C_WRAPPER_H
2
#define CODEX_C_WRAPPER_H
3
4
#include <cassert>
5
#include <utility>
6
7
namespace
codex
{
8
12
template
<auto F>
struct
CWrapper
;
13
17
template
<
typename
T
,
typename
R
,
typename
...Args,
R
(
T
::*
f
)(Args...)>
18
struct
CWrapper
<
f
> {
19
static
R
wrapper
(
void
*
p
, Args ...args) {
20
assert(
p
);
21
return
(
static_cast<
T
*
>
(
p
)->*
f
)(std::forward<Args>(args)...);
22
}
23
(*
operator
R
())(
void
*, Args...) {
return
&CWrapper::wrapper; }
24
};
25
26
}
27
28
#endif
f
#define f(x)
Definition
5.c:2
T
#define T(f, T, C)
Definition
bench.cpp:136
R
#define R(i, c, t0, t1, t2, t3, t4, t5, t6, t7)
Definition
chess0.c:55
codex
Definition
rotate.hpp:6
T
codex::refl::field_tuple_t< E > T
Definition
soa.cpp:9
p
#define p()
Definition
std2.c:11
codex::CWrapper< f >::wrapper
static R wrapper(void *p, Args ...args)
Definition
c_wrapper.hpp:19
codex::CWrapper
Wrapper for C-style void* + function pointer pair.
Definition
c_wrapper.hpp:12
tmp
c_wrapper
c_wrapper.hpp
Generated by
1.11.0