www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18303] New: Unqual gives weird results for const types

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

          Issue ID: 18303
           Summary: Unqual gives weird results for const types
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: simen.kjaras gmail.com

When a type T is declared as const, Unqual!T is not T, or perhaps more
correctly, T is not T, but const(T). Confusing enough yet? Have a look-see:

import std.traits : Unqual;

const struct T { }

pragma(msg, T); // const(T)
pragma(msg, Unqual!T); // T

static assert(!is(T == Unqual!T));

--
Jan 26