Skip to content

Enum class not supported? #984

Description

@LouisDuVerdier

Hello,

There might be an issue here, I'm using Git hash d66fa22 (quite recent but I could upgrade) and the support for enum class looks broken:

enum class TestEnumClass
{
    A,
    B,
    C
};

void doSomething()
{
    fmt::print("{}\n", TestEnumClass::A);
}

That prints the following error:

fmt/include/fmt/core.h:329:3: error: static assertion failed: don't know how to format the type, include fmt/ostream.h if it provides an operator<< that should be used
   static_assert(internal::no_formatter_error<T>::value,
   ^~~~~~~~~~~~~

Classical enums work fine. It might be related to the management of convert_to_int in which std::is_convertible<T, int>::value returns false. I tried to include ostream.h, to make a custom formatter, etc., without success.

Does it ring any bell to you? Sorry if I'm missing something simple here, I'm a new user of fmt.

Thanks,
Best regards,
Louis

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions