Commit Graph

5 Commits

Author SHA1 Message Date
gabime
6dffd7c6e8 update clang format again 2023-09-25 16:40:05 +03:00
gabime
66de161355 fix fwd 2023-09-25 02:20:13 +03:00
Dave Rigby
2a4c34b878 Allow forward-declaration of level_enum
spdlog::level::level_enum cannot be forward-declared at present, as
the definition does not specify an underlying type.

To allow users to make use of <spdlog/fwd.h> to refer to
level::level_enum without pulling in all of <spdlog/common.h> (which
can be quite costly), specify an underlying type (int) for
level::level_enum, then add a forward-declaration for it to
spdlog/fwd.h.

Note this required explicitly casting level_enum to size_t within ansicolor_sink due to sign-conversion errors:

    implicit conversion changes signedness: 'const level::level_enum' to 'std::__1::array::size_type' (aka 'unsigned long') [-Wsign-conversion]

It would appear that an enum with an unspecified underlying type is in
some kind of superposition - it can be treated as both signed _and_
unsigned - using an underlying type of 'unsigned int' triggers even
more warnings of this kind...
2022-01-11 15:12:23 +00:00
Gabi Melman
bd43403f5a
Update fwd.h 2020-03-22 00:54:23 +02:00
gabime
d3997cc4d1 Fix #1481 2020-03-22 00:50:22 +02:00