|
|
|
|
|
by fbkr
2070 days ago
|
|
> C language has some very limited implicit type conversions What? C will happily compile this: void g() {
float f = 3.14;
int* ip = &f;
}
C++ has no such _craziness_. Your strawman actually has pretty good uses: complex c = 3i;
... = c + 4;
Would you rather have the last line not compile because 4 is not a complex number? Because one _could_ argue that 4 is a complex number, and C++ can represent this with an implicit constructor.The issue with C++ is that implicit is the default, not that it exists. |
|
With that said, C programmers also seem to love their implicit behavior so it's pretty clear where this kind of thinking comes from.