Docs: Section on local variables
Stewart Gordon
smjg_1998 at yahoo.com
Thu Apr 26 07:05:57 PDT 2012
On 26/04/2012 08:26, Timon Gehr wrote:
<snip>
> template isInputRange(R)
> {
> enum bool isInputRange = is(typeof(
> {
> R r; // can define a range object
> if (r.empty) {} // can test for empty
> r.popFront(); // can invoke popFront()
> auto h = r.front; // can declare an unused variable
> }()));
> }
<snip>
This is indeed a blocker for fixing it to work according to the current spec. I've just filed
http://d.puremagic.com/issues/show_bug.cgi?id=7989
to address it.
Stewart.
More information about the Digitalmars-d-learn
mailing list