diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/fwdlib.hpp | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/fwdlib.hpp b/lib/fwdlib.hpp index 51450c1..8e6be16 100644 --- a/lib/fwdlib.hpp +++ b/lib/fwdlib.hpp @@ -26,7 +26,10 @@ static fwd_err_t fwd_getline(auto next)  static fwd_err_t fwd_foreach(auto container, auto next)  {  	for (auto &n : container) -		next(n); +		if (auto e = next(n)) +			return e; + +	return nullptr;  }  static fwd_err_t fwd_some(auto option, auto ok, auto fail) @@ -65,7 +68,7 @@ static fwd_err_t fwd_println(auto elem)  static fwd_err_t fwd_intalloc(auto ok)  {  	int *p = new int{20}; -	ok(p); +	return ok(p);  }  #endif /* FWDLIB_HPP */  | 
