August 07, 2013 Maybe add init template to std.conv? | ||||
|---|---|---|---|---|
| ||||
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.
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply