digitalmars.D.learn - Class allocators
- =?UTF-8?B?Tm9yZGzDtnc=?= (1/1) Nov 11 2017 Have anybody used allocators to construct class instances?
- Eugene Wissner (3/4) Nov 11 2017 Do you mean phobos allocators? or allocators as concept?
- Eduard Staniloiu (5/6) Nov 12 2017 I might be wrong, but I think you are looking for
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (6/12) Nov 12 2017 Thanks!
- Basile B. (5/19) Nov 12 2017 No, the classes and structs of the examples are simply declared
- =?UTF-8?B?Tm9yZGzDtnc=?= (2/6) Nov 12 2017 Thanks.
Have anybody used allocators to construct class instances?
Nov 11 2017
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?
Nov 11 2017
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
Nov 12 2017
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:Thanks! In the example the classes are declared as static. What effect does this have here and is it required for classes allocated via make?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
Nov 12 2017
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: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 scope.On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote:Thanks! In the example the classes are declared as static. What effect does this have here and is it required for classes allocated via make?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
Nov 12 2017
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 scope.Thanks.
Nov 12 2017