3 ms·
I missed your mention of the 'most vexing parse' before writing this up, but for those not in the know, here's another fun quirk of C++ syntax: Declare a local
by MaxBarraclough 7y ago
I missed your mention of the 'most vexing parse' before writing this up, but for those not in the know, here's another fun quirk of C++ syntax:
Declare a local named neko of type Kitten, passing a value to its constructor:
Kitten neko(42);
Declare a local named neko of type Kitten, without passing a value to its constructor:
Kitten neko;
Declare a function named neko with zero parameters and with return type Kitten:
Kitten neko();
https://en.wikipedia.org/wiki/Most_vexing_parse https://en.wikipedia.org/wiki/Most_vexing_parse , https://stackoverflow.com/a/620149/ https://stackoverflow.com/a/620149/
- a1369209993 7y agoAnd Ceiling Cat help you if you try to declare something like: Kitten neko(Felis<0xCA7>::catus); where catus may be either a typename or a variable depending which template instantiation you landed on. There's probably some way to say: Kitten neko(Felis<is_function_type<typeof neko>::value_of>::catus);
- MaxBarraclough 7y agoBeautifully terrible!