Overload issue between char[] and char*, inwhich the postfix should solve
David L. Davis
SpottedTiger at yahoo.com
Thu Nov 30 08:19:43 PST 2006
== Quote from Walter Bright (newshound at digitalmars.com)'s article
> David L. Davis wrote:
> > // Now a problem without a cast(), but when using the
> > // 'c' postfix, it should make it clear that it's a char[]
> > // parameter.
> Why? A 'c' postfix means it's a char[56], and a static array can
> be implicitly converted to both char* and char[], hence the
> ambiguity error.
Walter thanks for the reply.
Yeah I know what you're saying here. But, I guess I was hoping you
would see the value of not forcing a cast() everytime you pass a
static array into a function that overloads both a char[], and a
char * parameter. (Myself, it would be nice to have it default to
one or other, and to only use a cast() to force the other). Anyway
it works as designed and thus not a bug...inwhich I'll just have
to live with the cast() statements then. (The cast statements are
so ugly in code, as they are meant to be...as to discourage their
use whenever possible.)
Thanks again for all the hardwork you're been putting into D
(you're a real super lean and mean, bug killing machine). :) I'm
really looking forward to the D v1.0 release on the 1st of Jan
2007.
David L.
More information about the Digitalmars-d-bugs
mailing list