void f(); void v = f(); void g(a){return a;} v = g(v);
template<range R, regular X, invocable<range_value<R>, X> F> requires same_as<invoke_result_t<F, R, X>, X> auto fold(R&& range, F f, X accumulator) { for(auto x: range) accumulator = f(x, accumulator); return accumulator; }
enum class void_t { Void }; fold(my_range, [](auto&& elem, void_t) { return Void; }, Void);
fold(my_range, [](auto&& elem, void) { return; }, void{});
template<typename T> T callWithState(auto f) { auto old = globalState; globalState = whatever(); T out = f(); globalState = old; return out; }
fn f() {} let mut v: () = f(); fn g(a: ()) { a } V = g(v);
Sure, it doesn’t do much useful to C save make void ever so slightly less wonky.