Why free and realloc seem to include .

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 3 08:29:29 PDT 2017


On Thursday, 3 August 2017 at 15:18:17 UTC, Michael wrote:
> I've not seen that either, though I'm not a C++ programmer. 
> Does using free() on its own not assume access of a global 
> namespace?

Consider the following:

class Foo {
    void free(void*);

    void other_method() {
       free(ptr); // calls the member function
    }
}


The leading dot in D just ensures it calls the global one instead 
of a member (if present).


More information about the Digitalmars-d-learn mailing list