[OT] Modules dropped out of C++17
Shachar Shemesh via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jun 9 01:40:20 PDT 2015
On 09/06/15 11:17, Kagamin wrote:
> Not sure what you compare it to. Even finding declaration was never an
> easy job in C, and definition can be anywhere in the source tree. In D
> symbols are at least tied to modules, so you can look only in the
> respective module, this never worked for C though.
But that's just it. With UFCS, the function no longer needs to be in the
same module as the class/struct to which it is referring. In fact, that
is the whole point.
In the relevant C++ proposal, at least you can be sure that there is at
most one such function. Otherwise, the linker will complain (namespaces
notwithstanding). In D, you can't even say that. There may be three (or
three thousand) such functions, each in its own module, and until/unless
you try to import two such modules, you won't even notice it.
Shachar
More information about the Digitalmars-d
mailing list