-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcond.h
More file actions
36 lines (26 loc) · 1.14 KB
/
cond.h
File metadata and controls
36 lines (26 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef ZAKAROUF__ZPREP_NM_CONDITIONAL_H
#define ZAKAROUF__ZPREP_NM_CONDITIONAL_H
#include "../call.h"
#include "ident.h"
// Condtionals
#define zpp__do_construct(method1, method2) \
for(int zpp__macIdent(keep) = 1; \
zpp__macIdent(keep) && ({ zpp__call_raw method1; 1;});\
zpp__macIdent(keep) = 0, zpp__call_raw method2)
#define zpp__doif_construct_onlypre(condition, method, ...)\
if(condition)\
for(int keep = 1 ; keep?({ method(__VA_ARGS__); 1; }):0 ; keep ^= 1)
#define zpp__doif_construct_onlypost(condition, method, ...)\
if(condition)\
for(int keep = 1; keep; keep ^= 1, method(__VA_ARGS__) )
#define zpp__doif_construct(condition, methodandArgs1, methodandArgs2)\
if(condition)\
zpp__do_construct(methodandArgs1, methodandArgs2)
#define zpp__ter__if(exp) (exp)?
#define zpp__ter__elif(exp) :(exp)?
#define zpp__ter__else :
#define zpp__ter__op_if(exp) zpp__ter__if(exp) (
#define zpp__ter__op_elif(exp) ) zpp__ter__elif(exp) (
#define zpp__ter__op_else ) zpp__ter__else (
#define zpp__ter__op_endif )
#endif