Use fmt/core.h in examples

This commit is contained in:
Victor Zverovich 2022-09-15 20:41:32 -07:00
parent d65acc4e6c
commit e4e0ae3918

View File

@ -236,6 +236,8 @@ Then you can pass objects of type ``point`` to any formatting function::
You can also reuse existing formatters via inheritance or composition, for You can also reuse existing formatters via inheritance or composition, for
example:: example::
#include <fmt/core.h>
enum class color {red, green, blue}; enum class color {red, green, blue};
template <> struct fmt::formatter<color>: formatter<string_view> { template <> struct fmt::formatter<color>: formatter<string_view> {
@ -264,7 +266,7 @@ will return ``" blue"``.
You can also write a formatter for a hierarchy of classes:: You can also write a formatter for a hierarchy of classes::
#include <type_traits> #include <type_traits>
#include <fmt/format.h> #include <fmt/core.h>
struct A { struct A {
virtual ~A() {} virtual ~A() {}