Re: Static convertability testing?

2015-02-12 Thread ketmar via Digitalmars-d-learn
On Thu, 12 Feb 2015 19:09:45 +, Chris Williams wrote: Is there something like isConvertible() in the library somewhere? there is at least `std.traits.isImplicitlyConvertible`: http://dlang.org/phobos/std_traits.html#isImplicitlyConvertible signature.asc Description: PGP signature

Static convertability testing?

2015-02-12 Thread Chris Williams via Digitalmars-d-learn
I have a template function that gets values out of a tree of variant types. My goal is to be able to write code like; node.get!string(path, to, leaf); Inside get(), I would like to use std.conv to dynamically convert (where able) to the target type (T) or, if that is not possible, to return

Re: Static convertability testing?

2015-02-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, February 12, 2015 19:09:45 Chris Williams via Digitalmars-d-learn wrote: I have a template function that gets values out of a tree of variant types. My goal is to be able to write code like; node.get!string(path, to, leaf); Inside get(), I would like to use std.conv to