[Issue 7989] isInputRange and isForwardRange declare unused variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 26 07:57:12 PDT 2012


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



--- Comment #3 from Stewart Gordon <smjg at iname.com> 2012-04-26 07:58:16 PDT ---
(In reply to comment #1)
> I suppose you could pass it to a function template?

I've just figured that would work as well.  Define

void nop(T...)(T t) {}

then this could be used to
(a) require that something is of a non-void type
(b) require that something is implicitly convertible to a given type
(c) reference an otherwise unreferenced variable, thus suppress the unused
variable error/warning

so the lines I suggested would become

nop(r.front);
nop!(R)(r1.save);

-- 
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