[Issue 9229] Private default arguments
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 28 02:17:06 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9229
--- Comment #3 from bearophile_hugs at eml.cc 2012-12-28 02:17:03 PST ---
One more trait is useful:
void fooprivate(int x = 1, private int y = 1) {
static assert(!__traits(isPrivate, x));
static assert(__traits(isPrivate, y));
}
And std.traits.ParameterStorageClass needs "private_":
alias ParameterStorageClass STC; // shorten the enum name
void func(ref int ctx, out real result, real param, private int x = 1) { }
alias ParameterStorageClassTuple!(func) pstc;
static assert(pstc.length == 4); // three parameters
static assert(pstc[0] == STC.ref_);
static assert(pstc[1] == STC.out_);
static assert(pstc[2] == STC.none);
static assert(pstc[3] == STC.private_);
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list