It’s a typo in the book. Look at Errata for 2nd and 3rd printings of The C++ Programming Language. The example must be like below:
auto z3 =[y]() { return (y) ? 1 : 2; }
It’s a typo in the book. Look at Errata for 2nd and 3rd printings of The C++ Programming Language. The example must be like below:
auto z3 =[y]() { return (y) ? 1 : 2; }