Answer the question
In order to leave comments, you need to log in
How to iterate over 2 enum classes in 1 function?
enum class abc_t
{
a,
b,
c,
};
enum class tde_t
{
t,
d,
e,
};
//для перебора одного перечисляемого типа
std::string test(abc_t function)
{
switch(function)
{
case abc_t::a: return "a";
// и т.д
}
}
template<typename T>
std::string test(T function)
switch(function)
{
case abc_t::a: return "a";
case tde_t:t return "t";
}
Answer the question
In order to leave comments, you need to log in
No way. There is no introspection in C++. So the solution may be to use all sorts of crutches like boost or similar
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question