Loading...
Searching...
No Matches
or.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include "indep/macro/to.hpp"
7
8namespace by {
9
125#define __OR_DO__(_expr_) \
126 | [&](auto&& __p) -> void { \
127 __orStack__::push(nul(__p) ? _expr_ : false); \
128 }; \
129 if(__orStack__::pop())
130
131#define OR_DO __OR_DO__(nul(__p))
132
133#define __OR__(expr) __OR_DO__(expr) return BY_WHEN
134#define OR __OR__(nul(__p))
135#define OR_RET_CTOR __OR_DO__(nul(__p)) return
136
137#define OR_CONTINUE OR_DO continue
138
139 struct __orStack__ {
140 static void push(nbool val) { _stack.push_back(val); }
141
142 static nbool pop() {
143 nbool ret = _stack.back();
144 _stack.pop_back();
145 return ret;
146 }
147
148 private:
149 inline static std::vector<nbool> _stack;
150 };
151
152} // namespace by
Definition or.hpp:139
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34