AimRT/_deps/boost-src/libs/describe/example/printing_enums_ct.cpp
2025-01-12 20:40:08 +08:00

26 lines
452 B
C++

// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/describe.hpp>
#include <boost/mp11.hpp>
#include <cstdio>
enum E
{
v1 = 11,
v2,
v3 = 5
};
BOOST_DESCRIBE_ENUM(E, v1, v2, v3)
int main()
{
boost::mp11::mp_for_each< boost::describe::describe_enumerators<E> >([](auto D){
std::printf( "%s: %d\n", D.name, D.value );
});
}