> such treads belongs to Lounge as there is no problem to solve.
http://www.cplusplus.com/forum/ has a description for each sub-forum. Note that `problem' is not used
Lounge is meta and not c++
I think that is fine here.
> C++
compiler does not gets to see multiple definitions,
The
compiler does see
redefinitions in the same translation unit.
That's one of the reason to not include source files.
> compiler will complain on the redefinition, which is stupid, very inconvenient.
> Well, if a function is defined twice, if they are the same, what problem will there be???
that the compiler must analyze the code to check that they are in fact the same
> If they are different, why not post a warning and adopt the latest version first.
that's an awful solution, ¿why not use the first? ¿how do you even know the order of the functions?
1 2 3 4 5 6 7 8
|
#include "mylib" //provides `foo()' and `bar()'
int foo(){ //redefining foo()
return 42;
}
int main(){
bar(); //¿which foo() should use?
}
|
The other thing is inertia. Current c++ programmers should realize that a redefinition should never happen, as it would indicate some error on the setup