Adding deprecated to an enum member

Jeremy DeHaan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 31 18:12:28 PDT 2017


I got an error today because I added deprecated to an enum member.

Is there a way to achieve this, or am I out of luck? If it isn't 
doable, should it be?

Here's what I want:

enum PrimitiveType
{
     Points,
     Lines,
     LineStrip,
     Triangles,
     TriangleStrip,
     TriangleFan,
     Quads,

     deprecated("Use LineStrip instead.")
     LinesStrip = LineStrip,
     deprecated("Use TriangleStrip instead.")
     TrianglesStrip = TriangleStrip,
     deprecated("Use TriangleFan instead.")
     TrianglesFan   = TriangleFan
}


PrimitiveType ptype = LinesStrip; //error, Use LineStrip instead.


More information about the Digitalmars-d-learn mailing list