3 ms·
I can think of many counter examples, e.g auto v = MAX(a, b); where max infers the result type from the input types using generics or compiler intrinsics. aut
by eska 3y ago
I can think of many counter examples, e.g
auto v = MAX(a, b); where max infers the result type from the input types using generics or compiler intrinsics.
auto v = (struct foo){.a = 1}; where one wouldn’t want to repeat the type as in C++ auto v = make_unique<foo>(1);
- cozzyd 3y agoan auto cast based on the destination type might be cleaner, a la struct foo v = (auto) {.a = 1 };