bool foo() { return [](){return false;}(); }
> The amusing thing is that C++ still doesn't have nested functions.
Also amusingly, it does have anonymous types which can have function members.
bool bar() { struct { bool orly() { return false; } } a{}; return a.orly(); }
Edit: Oh and I forgot; you can refine the member to be static so you don't need to instantiate it first.
bool bar() { struct a { static bool orly() { return false; } }; return a::orly(); }
[1] https://gcc.godbolt.org/z/hc73GP
> The amusing thing is that C++ still doesn't have nested functions.
Also amusingly, it does have anonymous types which can have function members.
It's fun to send this type of stuff to code review.Edit: Oh and I forgot; you can refine the member to be static so you don't need to instantiate it first.
[0] https://gcc.godbolt.org/z/Pjdnre[1] https://gcc.godbolt.org/z/hc73GP