www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Cannot overload on constness of a struct

struct A(uint N)
{
    private ubyte[N] data;

    ubyte * ptr() { return &data[0]; }
    const const(ubyte) * ptr() { return &data[0]; }
}

Error: function ptr conflicts with function ptr


If A is mutable, then ptr should return a pointer to ubyte.
If A is const, then ptr should return a pointer to const ubyte.

Please tell me this will work after the revamp of const?
Nov 07 2007