ae2f_docs
Loading...
Searching...
No Matches
Keys.h
Go to the documentation of this file.
1/**
2 * @file Keys.h
3 * @brief Non-casting keywords migrated from Cast.h
4 * */
5#ifndef ae2f_Keys_h
6#define ae2f_Keys_h
7
8#include "./Cxx.h"
9#include "./cc.h"
10
11/**
12 @brief
13 In C, keyword 'struct' must be written in front of the structure's name in
14 order to use as a type name. \n In C++ that keyword is not required.
15
16 This keyword resolves the difference of the rules of two.
17 */
18#define ae2f_struct ae2f_WhenC(struct)
19
20/**
21 @brief
22 Suggests the existence of external variable or function, in naming of C.
23 [non-mangling]
24 */
25#define ae2f_extern ae2f_WhenC(extern) ae2f_WhenCXX(extern "C")
26
27/** @brief Class */
28#define ae2f_class ae2f_WhenC(struct) ae2f_WhenCXX(class)
29
30/** @brief Makes the global variable in naming of C. [non-mangling] */
31#define ae2f_var ae2f_WhenCXX(extern "C")
32
33/** @brief Invokes when condition is `false`. */
34#define unless(a) if (!(a))
35
36#define ae2f_tmpldef(a) template<a>
37#define ae2f_tmpluse(a) <a>
38
39/**
40 * @brief
41 * Make two pair of function as [eval] and [expr]. \n
42 * [expr] will just call [eval]. \n
43 * You will implement the body of [eval].
44 *
45 * Following is an use case.
46 * @code
47 * ae2f_evaldef(
48 template<int a>, <0>
49 , consteval, constexprfun
50 , int, Hello, _Hello, char v, v)
51 { return v; }
52 * */
53#define ae2f_evaldef(tmpldef, tmpluse, keyeval, keyexpr, ret_t, nameeval, nameexpr, prmdef, prmuse)
54 tmpldef keyeval ret_t nameeval(prmdef);
55 tmpldef keyexpr ret_t nameexpr(prmdef) {
56 return nameeval tmpluse (prmuse);
57 }
58 tmpldef keyeval ret_t nameeval(prmdef)
59
60#endif
#define ae2f_WhenCXX(a)
Appears when the current language is C.
Definition Cxx.h:44
#define ae2f_WhenC(a)
Appears when the current language is C++.
Definition Cxx.h:38
#define ae2f_PackCount
Definition Num.auto.h:6