Bug 11340 – ElementType and ElementEncodingType return oddly qualified element types

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-24T04:41:00Z
Last change time
2013-10-24T07:40:12Z
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-10-24T04:41:51Z
----- import std.range; void main() { pragma(msg, ElementType!(string)); // dchar pragma(msg, ElementType!(wstring)); // dchar pragma(msg, ElementType!(dstring)); // immutable(dchar) pragma(msg, ElementEncodingType!(string)); // immutable(char) pragma(msg, ElementEncodingType!(wstring)); // immutable(wchar) pragma(msg, ElementEncodingType!(dstring)); // immutable(dchar) } ----- As far as I know these should all be const(T). Am I wrong?
Comment #1 by andrej.mitrovich — 2013-10-24T07:40:12Z
As commented here: https://github.com/D-Programming-Language/phobos/pull/1660#discussion_r7189412 > dstring is a non-narrows string. Because of this, calling front gives you an > lvalue of the actual elements, as opposed to narrows strings, which give you > decoded dchar: They're mutable, but rvalues.