I'm trying to specialize fmt::formatter for all Q_ENUM enums types,
and for that I need to come up with constexpr bool function/variable
template that somehow checks if Q_ENUM was declared for enum (to use
with SFINAE).
I know that QMetaEnum::fromType() fails with static_assert if Q_ENUM
is not declared for type, which means that this information is
available at compile time. But I'm not experienced enough with
templates to derive boolean constant from this (without using private
Qt internals). Is it possible to "convert" function template failing
with static_assert to boolean compile time constant (i.e. extract
condition from outside)?
Interest mailing list

Reply via email to