3 ms·
Nope, template type deduction never implicitly converts: https://godbolt.org/g/stZBK1 https://godbolt.org/g/stZBK1
by smitherfield 9y ago
Nope, template type deduction never implicitly converts: https://godbolt.org/g/stZBK1 https://godbolt.org/g/stZBK1
- Too 9y agoOh, "conflicting types for parameter 'T' ('T2' vs. 'T1')". I'm surprised but it's a nice surprise. Finally something in c++ where safety is valued more than implicit dangerous magic.
- bstamour 9y agoC++'s type system has always been stricter than C's. Even the following, totally valid C program, is ill-formed C++ int* x = malloc(5 * sizeof (int)); because in C++ you cannot implicitly cast a void pointer.