Bug 17247 – std.bitmanip.read should not assume sliceable range is assign-copyable to ubyte[].
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-03-08T19:12:12Z
Last change time
2018-01-05T13:27:36Z
Keywords
pull
Assigned to
No Owner
Creator
hsteoh
Comments
Comment #0 by hsteoh — 2017-03-08T19:12:12Z
std.bitmanip.read wrongly assumes that if an input range has elements that are implicitly convertible to const(ubyte), and it supports slicing operations, then it is possible to copy range elements to a ubyte[] static array using the assignment operator. Obviously this only works if the range is ubyte[] or a similar built-in type, but it fails horribly for user-defined ubyte ranges that support slicing.
Comment #1 by hsteoh — 2017-03-08T19:13:32Z
In other words, std.bitmanip.read should not assume that slicing a ubyte range will return ubyte[] or similar, since it could be a user-defined type.