www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17247] New: std.bitmanip.read should not assume sliceable

https://issues.dlang.org/show_bug.cgi?id=17247

          Issue ID: 17247
           Summary: std.bitmanip.read should not assume sliceable range is
                    assign-copyable to ubyte[].
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

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.

--
Mar 08