[Issue 16207] New: CTFE cast from void* to ubyte* doesn't work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jun 26 15:13:43 PDT 2016


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 at puremagic.com
          Reporter: bugzilla at 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")

--


More information about the Digitalmars-d-bugs mailing list