Class Allocators

Kyle kyle.kyle at kyle.kyle
Sun Jan 31 23:19:09 UTC 2021


I've been doing some review of Andrei's book which has led me to 
trying to figure out how placement new works, or doesn't work. 
The new(address) Type syntax tells me "no allocator for TYPE". I 
did find information on "Class Allocators" at 
https://dlang.org/spec/class.html#allocators, but when I try to 
do things the Class Allocator way DMD tells me that "class 
allocators are obselete, consider moving the allocation strategy 
outside of the class". My best guess right now is that both class 
allocators and the placement new syntax are deprecated, but if 
that's the case I would expect a deprecation message when I try 
to use that new(address) Type syntax whether there's a class 
allocator present or not. Any insight into this? Thanks.


More information about the Digitalmars-d-learn mailing list