c++ mark enum value as deprecated?

后端 未结 8 1865
再見小時候
再見小時候 2020-12-30 23:41

Is it possible to mark an enum value as deprecated?

e.g.

enum MyEnum {
    firstvalue = 0
    secondvalue,
    thirdvalue, // deprecated
    fourthva         


        
8条回答
  •  时光取名叫无心
    2020-12-31 00:22

    You can use the [[deprecated]] attribute from C++14 on.

    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html

提交回复
热议问题