std.conv.to

Salih Dincer salihdb at hotmail.com
Sat Jun 18 04:33:50 UTC 2022


On Friday, 17 June 2022 at 18:40:59 UTC, Ali Çehreli wrote:
> On 6/17/22 10:04, Salih Dincer wrote:
>
> > Isn't foo and bar the same thing?  I don't understand what's
> the
> > difference!
> > ```d
> >    auto foo = to!Foo("123"); //??
> >    auto bar = Foo("321");
> > ```
> Yes, they are the same thing.

But (!) `to!` inconsiderately smuggled into the code is bubble. 
So we will obviously be deceived at a later moment. Thereby 
making nonsense further clamour for shorten...:)

Then how did the evolution of the code evolve into the current 
form?

```d
    auto zar = "123".to!Foo;
    auto bar = to!(Foo)("123");
    auto foo = to!Foo("123"); // <-- this line is bubble
```

SDB at 79


More information about the Digitalmars-d-learn mailing list