Re: Class Allocators

2021-01-31 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 January 2021 at 23:19:09 UTC, Kyle wrote: 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

Re: Class Allocators

2021-01-31 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 31 January 2021 at 23:19:09 UTC, Kyle wrote: 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)

Class Allocators

2021-01-31 Thread Kyle via Digitalmars-d-learn
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#

Re: Class allocators

2017-11-12 Thread Nordlöw via Digitalmars-d-learn
On Sunday, 12 November 2017 at 20:41:03 UTC, Basile B. wrote: No, the classes and structs of the examples are simply declared as 'static' because they are located in a 'unittest' block. You can ignore the keyword...it just means that they are declared as if they would stand at the global

Re: Class allocators

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 18:46:54 UTC, Per Nordlöw wrote: On Sunday, 12 November 2017 at 18:34:42 UTC, Eduard Staniloiu wrote: On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are

Re: Class allocators

2017-11-12 Thread Per Nordlöw via Digitalmars-d-learn
On Sunday, 12 November 2017 at 18:34:42 UTC, Eduard Staniloiu wrote: On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are looking for std.experimental.allocator.make [0] [0] -

Re: Class allocators

2017-11-12 Thread Eduard Staniloiu via Digitalmars-d-learn
On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are looking for std.experimental.allocator.make [0] [0] - https://dlang.org/phobos/std_experimental_allocator.html#make

Re: Class allocators

2017-11-11 Thread Eugene Wissner via Digitalmars-d-learn
On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? Do you mean phobos allocators? or allocators as concept? What is the problem?

Class allocators

2017-11-11 Thread Nordlöw via Digitalmars-d-learn
Have anybody used allocators to construct class instances?