boostorg / describe

A C++14 reflection library
https://boost.org/libs/describe
69 stars 24 forks source link

No compile-time error when incorrectly using BOOST_DESCRIBE_STRUCT on an enum type #8

Closed ddevienne closed 3 years ago

ddevienne commented 3 years ago

Made that mistake, because my descriptions are not hand-written, but code-generated, and I forgot that container I was using had all types, not just structs. I fixed my generator since, but the code should probably static_assert the type is not an enum (or primitive).

Of course, I generated something like

BOOST_DESCRIBE_STRUCT(
    MyEnum, (),
    () // No state
)