std::get using enum class as template argument

后端 未结 6 1589
孤街浪徒
孤街浪徒 2021-01-04 07:40

I\'m using a std::tuple and defined a class enum to somehow \"naming\" each of the tuple\'s fields, forgetting about their actual indexes.

So instead o

6条回答
  •  有刺的猬
    2021-01-04 07:57

    2018 update:

    It's not a problem anymore. I did have a problem when I tried variations of "enum class int", but this now works fine with VS 2017 15.7.2

    enum 
    {
      WIDTH,
      HEIGHT
    };
    std::get( Remaining ) = std::get( Remaining ) - MinHeight;
    

提交回复
热议问题