www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - isInputRange bug?

reply Jonas Drewsen <jdrewsen nospam.com> writes:
isInputRange!(immutable(void)[]) => false
isInputRange!(immutable(char)[]) => true

shouldn't both of them return true?

/Jonas
Sep 21 2011
parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 09/21/2011 09:42 PM, Jonas Drewsen wrote:
 isInputRange!(immutable(void)[]) => false
 isInputRange!(immutable(char)[]) => true

 shouldn't both of them return true?

 /Jonas

immutable(void)[] is not a range because you cannot get it's front element.
Sep 21 2011
parent Jonas Drewsen <jdrewsen nospam.com> writes:
On 21/09/11 21.52, Timon Gehr wrote:
 On 09/21/2011 09:42 PM, Jonas Drewsen wrote:
 isInputRange!(immutable(void)[]) => false
 isInputRange!(immutable(char)[]) => true

 shouldn't both of them return true?

 /Jonas

immutable(void)[] is not a range because you cannot get it's front element.

I see. Thank you. /Jonas
Sep 21 2011