.init property for char[] type
Justin Johansson
procode at adam-dott-com.au
Tue Sep 22 06:34:52 PDT 2009
Jarrett Billingsley Wrote:
> On Tue, Sep 22, 2009 at 8:07 AM, Justin Johansson
> >
> > Maybe this type of question best be asked on D.learn, but I do wonder if an empty string is a more reasonable initializer for char[] .. well maybe not .. I don't know .. I yield to your sensibilities.
> >
> There's no real difference between an empty string and a null
> reference. Both have 0 length.
Big difference if you pass char[] variable .ptr to a C function.
static if ( typeid(T) is typeid(char[])) {
}
else {
init_sequence = new ExactlyOne!(T)( T.init);
}
Tks Jeremie got specialized method working with
More information about the Digitalmars-d
mailing list