On Monday, 23 May 2022 at 12:17:56 UTC, bauss wrote:
On Monday, 23 May 2022 at 11:39:22 UTC, Adam D Ruppe wrote:
On Monday, 23 May 2022 at 09:38:07 UTC, JG wrote:
Hi,

Is there any more standard way to achieve something to the effect of:

```d
  import std.experimental.allocator;
  string* name = theAllocator.make!string;
 ```

Why do you want that?

Easiest way I know of is to just wrap it in a struct, then `new that_struct`, which is also a better way for all the use cases I know.... but those use cases are pretty rare so there's probably a better way to do what you're trying to do.

My guess is @nogc in which case your solution doesn't work.

Same with Ferhat's examples.

Oops wait, I just saw that it says "via the GC" in the title. I completely missed that until I had of course sent my other message.

Reply via email to