diff options
Diffstat (limited to 'lib/fwdlib.hpp')
-rw-r--r-- | lib/fwdlib.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/fwdlib.hpp b/lib/fwdlib.hpp index 0462c52..034c91a 100644 --- a/lib/fwdlib.hpp +++ b/lib/fwdlib.hpp @@ -9,7 +9,15 @@ using namespace std; -static inline void fwd_getline(auto next) +static void fwd_if(auto cond, auto ok, auto fail) +{ + if (cond) + ok(); + else + fail(); +} + +static void fwd_getline(auto next) { if (cin.eof()) next(optional<string>{}); |