mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
17 lines
365 B
C++
17 lines
365 B
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
template<typename E>
|
|
struct NamedEnumScalarTraits {
|
|
template<typename T>
|
|
static void enumeration(T &IO, E &V) {
|
|
for (unsigned I = 0; I < E::Count; ++I) {
|
|
auto Value = static_cast<E>(I);
|
|
IO.enumCase(V, getName(Value).data(), Value);
|
|
}
|
|
}
|
|
};
|