www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20117] New: std.typecons.Typedef has opCmp when base type

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

          Issue ID: 20117
           Summary: std.typecons.Typedef has opCmp when base type does not
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: atila.neves gmail.com

----------------------------------
import std.traits;
import std.typecons;

alias MyInt = Typedef!int;
pragma(msg, hasMember!(int, "opCmp"));
pragma(msg, hasMember!(MyInt, "opCmp"));
----------------------------------

This prints false then true. It doesn't work very well in generic code.

--
Aug 08 2019