Passing a module in a template parameter list to __traits(allMembers, module)

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Feb 26 11:13:20 PST 2013


On Tue, Feb 26, 2013 at 08:07:42PM +0100, Andrej Mitrovic wrote:
[...]
> Also make sure you parenthesize the call in GetMembers. For some
> reason these two are different:
> 
> GetMembers!std.stdio  // actually calls (GetMembers!std).stdio
> GetMembers!(std.stdio)
> 
> That could be a bug though.

I think it's a problem with the precedence of the binary ! operator. It
has higher precedence than '.', so GetMembers!std.stdio gets parsed as
(GetMembers!std).stdio. Anyway, I've learned that if the argument after
'!' is more than a single token, you should just parenthesize the whole
thing, to be on the safe side.


T

-- 
BREAKFAST.COM halted...Cereal Port Not Responding. -- YHL


More information about the Digitalmars-d mailing list