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


Steven Schveighoffer <schvei...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schvei...@yahoo.com


--- Comment #1 from Steven Schveighoffer <schvei...@yahoo.com> 2012-04-26 
07:17:50 PDT ---
(In reply to comment #0)

> -        auto h = r.front; // can get the front of the range
> +        cast(void) r.front; // can get the front of the range

front should return a value, returning void is not acceptable, but this would
pass your code.

I think this might work better:

static assert(is(typeof(r.front) != void));

It may also be required that front can be used to initialize a variable (I
think there may be some cases where a non-void value cannot be used this way,
but I'm not sure).  How do you test for this, and then 'use' the variable later
when you have no idea how it can be used?  I suppose you could pass it to a
function template?

This kind of requirement is going to be problematic, possibly in a lot of
places.  It might make sense to define some more helper enums for this, like
isNonVoidInitializer or something like that.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to