diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-12-04 11:04:16 +0200 | 
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-12-04 11:04:16 +0200 | 
| commit | 5d4b4ef80d8dc427b0e2803d50e439f76f06e17a (patch) | |
| tree | a5869136c1e5e869d8e232927e06f27422f31234 /lib | |
| parent | 2253da61e9b3dd5408bed182ea08e5270156c17e (diff) | |
| download | fwd-5d4b4ef80d8dc427b0e2803d50e439f76f06e17a.tar.gz fwd-5d4b4ef80d8dc427b0e2803d50e439f76f06e17a.zip | |
implement expression handling further
+ Add some notes about returning functions that I started thinking about
  as a result of the fib example
Diffstat (limited to 'lib')
| -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>{}); | 
