www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16207] New: CTFE cast from void* to ubyte* doesn't work

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

          Issue ID: 16207
           Summary: CTFE cast from void* to ubyte* doesn't work
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

int hashOf( const(void)[] buf )
{
    auto data = cast(const(ubyte)*) buf.ptr;
    return 3;
}

enum hashval = hashOf("Sample_string");

-------------------------

bug.d(4): Error: pointer cast from const(void)* to const(ubyte)* is not
supported at compile time
bug.d(8):        called from here: hashOf("Sample_string")

--
Jun 26 2016