C++ operator new

Daniel Keep daniel.keep.lists at gmail.com
Sun Jan 25 06:16:34 PST 2009



BLS wrote:
> Hi,
> 
> I wonder if this is doable in D ?
> 
> class Cpp
>     {
> public:
>     void* operator new(size_t n);
>     void* operator new(size_t n, void* p)
>         { return p; }
> 
>     }
> 
> Just guessing that operator new means this in D
> class D
>     {
>     new(uint n);
>     new(uint n,void* p)
>         { return p; }
> 
>     }
> 
> Am I wrong ?
> TIA, Bjoern
> 

http://digitalmars.com/d/1.0/class.html#allocators


More information about the Digitalmars-d-learn mailing list