struct Foo
{
int Something () { return 5; }
int Other () { return 0; }
};
void DoSmth (int t)
{
Foo foo;
auto f = foo.Something () > 0 ? [] (Foo f) { return f.Something (); } : [] (Foo f) { return f.Other (); };
}
int main ()
{
DoSmth (5);
}
c3RydWN0IEZvbwp7CiAgICAgICAgaW50IFNvbWV0aGluZyAoKSB7IHJldHVybiA1OyB9CiAgICAgICAgaW50IE90aGVyICgpIHsgcmV0dXJuIDA7IH0KfTsKCnZvaWQgRG9TbXRoIChpbnQgdCkKewogICAgICAgIEZvbyBmb287CiAgICAgICAgYXV0byBmID0gZm9vLlNvbWV0aGluZyAoKSA+IDAgPyBbXSAoRm9vIGYpIHsgcmV0dXJuIGYuU29tZXRoaW5nICgpOyB9IDogW10gKEZvbyBmKSB7IHJldHVybiBmLk90aGVyICgpOyB9Owp9CgppbnQgbWFpbiAoKQp7CiAgICAgICAgRG9TbXRoICg1KTsKfQ==