std::get using enum class as template argument
问题 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 of doing this: std::tuple<A,B> tup; /* ... */ std::get<0>(tup) = bleh; // was it 0, or 1? I did this: enum class Something { MY_INDEX_NAME = 0, OTHER_INDEX_NAME }; std::tuple<A,B> tup; /* ... */ std::get<Something::MY_INDEX_NAME> = 0; // I don't mind the actual index... The problem is that, as this compiled using gcc 4.5.2, I've now installed the 4