Bug 17273 – why is a const range not a range

Status
RESOLVED
Resolution
INVALID
Severity
critical
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2017-03-24T18:12:00Z
Last change time
2017-03-24T20:18:19Z
Keywords
rejects-valid
Assigned to
nobody
Creator
sahmi.soulaimane

Comments

Comment #0 by sahmi.soulaimane — 2017-03-24T18:12:59Z
the following code works for me. the second assert should fail: import std.range; unittest { static assert(isInputRange!(InputRange!int)); static assert(!isInputRange!(const(InputRange!int))); } $ dmd --version DMD32 D Compiler v2.073.0 Copyright (c) 1999-2016 by Digital Mars written by Walter Bright
Comment #1 by ag0aep6g — 2017-03-24T20:18:19Z
Because you can't call popFront on it. Closing as invalid. Please make a thread in the learn forum if this doesn't make sense to you. https://forum.dlang.org/group/learn