May 13, 2008 Re: safer casts - take II | ||||
|---|---|---|---|---|
| ||||
Janice Caron Wrote: > We already have that. > > import std.conv; > > dst = to!(T)(src); > > so your base is already covered. just what I wrote about http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=71725 | ||||
May 13, 2008 Re: safer casts - take II | ||||
|---|---|---|---|---|
| ||||
Posted in reply to terranium | On 13/05/2008, terranium <spam@here.lot> wrote:
> just what I wrote about http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=71725
Seriously - to!(T) is the D standard way of doing convertions that will throw an exception on failure. It is the right function for dynamic-cast-with-throw.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply