1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include <iostream> struct X { X(int) { } }; auto operator<<(std::ostream& o, X const&) -> std::ostream& { o << "exxxx"; return o; } f: (out x: _) = { x = 42; } main: ()->int = { a: int; f(out a); std::cout << a << "\n"; b: X; f(out b); std::cout << b << "\n"; }