P
poiuz24
You still seem to misunderstand what a using declaration does - it
you're right: this was probably my core misunderstanding. please
let me rephrase to check if i got it now:
"using foo::f;" in above introduces a synonym ::f -> foo::f ..
but this is only for the compiler in the translation unit
it is working on. this synonym information is no longer present
in the object the compiler leaves for the linker. IOW: the symbol
table will NOT look like this:
....
00000018 T _foo_f
00000018 T _f
....
but instead will plainly look so:
....
00000018 T _foo_f
....
from my point of view (hope i got it this time), this is tribute
to the ideosyncracies of traditional C++ build environments, in
particular the lack of adequate type information left by the
compiler for the linker. even above (non-existing) symbol table
loses information. think of this (also non-existing) symbol table:
....
00000018 T _foo_f
_foo_f SYNONYM _f
....
this one would preserve which symbol is "real" and which is just
a synonym.
thx for pressing me so hard to get the point
*doesn't* modify the linkage of the original function in any way. e.g.
namespace foo
{
void f();
}
using foo::f;
//linker still expects foo::f, it's just that code below this point
//looks up f to be foo::f.
you're right: this was probably my core misunderstanding. please
let me rephrase to check if i got it now:
"using foo::f;" in above introduces a synonym ::f -> foo::f ..
but this is only for the compiler in the translation unit
it is working on. this synonym information is no longer present
in the object the compiler leaves for the linker. IOW: the symbol
table will NOT look like this:
....
00000018 T _foo_f
00000018 T _f
....
but instead will plainly look so:
....
00000018 T _foo_f
....
from my point of view (hope i got it this time), this is tribute
to the ideosyncracies of traditional C++ build environments, in
particular the lack of adequate type information left by the
compiler for the linker. even above (non-existing) symbol table
loses information. think of this (also non-existing) symbol table:
....
00000018 T _foo_f
_foo_f SYNONYM _f
....
this one would preserve which symbol is "real" and which is just
a synonym.
thx for pressing me so hard to get the point