std.sumtype?
ryuukk_
ryuukk_ at gmail.com
Thu Mar 18 18:33:34 UTC 2021
> More general question: why phobos so bad structured? No way to
> determine what can be used without gc, that need it (other D
> features like betterC in the same situation). Some basic
> actions requires couple of std libs (std.file, std.path etc).
> Why something things placed in experimental will be in
> experimental during several years, other placed to std directly
> (sumtype)?
>
> May be it's time to restructure std, and determine algorithm
> for place new code to it (like DIPs)?
I agree 1000% things are confusing when you want to manage memory
yourself, you either have to check every functions and see if
they allocate or no, or force yourself to add @nogc everywhere
OR use @betterC and have access to no std at all
I personally picked the @betterC option and use D like i'd use
C/C++, and it feels much better, i have my own Allocator struct,
and whenever i need to allocate memory, i ask for an allocator
If only the std was designed like this, whenever you want to
allocate, you ask user to provide an allocator
Want use GC? use gc allocator, everyone wins
More information about the Digitalmars-d
mailing list