3 ms·
Yes, those things creep up in various places. Some are fixed, like when you have std::vector<std::vector<int>> where it used to give an error because it thought
by gsliepen 5y ago
Yes, those things creep up in various places. Some are fixed, like when you have std::vector<std::vector<int>> where it used to give an error because it thought >> was an operator. But recently I discovered this one:
int x[100] = {}; // just a regular array
int val = x[[]{return 42;}()]; // compile error!
Once again, greedy parsing is the culprit; here it thinks [[ is the start of an attribute.
- klyrs 5y agoOn one hand, nice catch... on the other hand... why do you want to do that??