digitalmars.D - Maybe add init template to std.conv?
- Borislav Kosharov (13/13) Aug 07 2013 I have created 2 probably useful and short templates that enhance
I have created 2 probably useful and short templates that enhance
.init
///Returns Source's .init converted with std.conv.to to Target
property auto init(Source, Target)() {
return init!Source.to!Target;
}
///Sets target to Source's .init value
property void init(Source, Target)(out Target target) {
target = init!(Source, Target);
}
See: https://gist.github.com/nikibobi/6178215
If you like them they could be added to std.conv maybe? If you
have any suggestions on improvements please tell.
Aug 07 2013








"Borislav Kosharov" <bosak gmail.com>