Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以有一个枚举数组并在 C++11 中的那个数组中搜索一个特定的枚举,或者只是检查它是否存在?
是的你可以。
if (std::find(begin(array), end(array), expectedValue) != end(array)) { // Found the expected enum value }