The D standard library is built on GC, is that a negative or positive?

H. S. Teoh hsteoh at qfbox.info
Wed Dec 14 20:30:39 UTC 2022


On Wed, Dec 14, 2022 at 07:38:51PM +0000, torhu via Digitalmars-d wrote:
> On Wednesday, 14 December 2022 at 01:47:29 UTC, Steven Schveighoffer wrote:
> > 
> > ```d
> > void main() @nogc
> > {
> >    import std.conv;
> >    auto v = "42".to!int;
> > }
> > ```
> 
> 
> I have been wondering why there isn't a basic variation like this
> available:
> 
> ```d
> auto i = "42".toOr!int(-1);
> auto s = i.toOr!string(null);
> ```

This would be a nice addition to Phobos IMO.  Though we should think of
a better name for it. :-P


T

-- 
Never step over a puddle, always step around it. Chances are that whatever made it is still dripping.


More information about the Digitalmars-d mailing list