[Issue 1547] Struct can't be given default value of null in param list

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 28 08:27:03 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1547


walter at mail.math.uni-magdeburg.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |walter at mail.math.uni-
                   |                            |magdeburg.de




------- Comment #1 from walter at mail.math.uni-magdeburg.de  2007-11-28 10:27 -------
This bug does not only apply to null as a default parameter, but in every case
where a struct OR class should get initialized by another type.

To point out the importance of this issue, I'd like to mention the application
of a GMP wrapper library which wraps the GMP types (from the C library) in
structs and expression templates. For GMP it is important that one can use
these structs like native datatypes:

void foo (mpz arg = 0)
{
  ...
}

one may argue, that you can write "arg = T(0)" (via static opCall), but this
does not work for int, so using mpz like int would not work!

best regards
Matthias Walter


-- 



More information about the Digitalmars-d-bugs mailing list