Code fails with linker error. Why?

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 4 09:52:08 PDT 2014


On Saturday, 4 October 2014 at 15:54:26 UTC, ketmar via 
Digitalmars-d-learn wrote:
> On Sat, 04 Oct 2014 15:29:55 +0000
> John Colvin via Digitalmars-d-learn 
> <digitalmars-d-learn at puremagic.com>
> wrote:
>
>> I don't really see the point though.
>> 
>> class A
>> {
>>      void foo(int a) { Afoo(this, a); }
>> }
>> 
>> then declare and define Afoo however you like.
> it's noisy hackery and namespace pollution. sure i can do this 
> and i'm
> using this trick when it's better to define some methods for
> class/struct in another module, but i don't like it.

It is a little noisy, but really very little. The only extra 
noise is the call to Afoo.

Namespace pollution? In what way would that cause a problem here?


More information about the Digitalmars-d-learn mailing list