mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 21:16:56 +00:00
Use fmt/core.h in examples
This commit is contained in:
parent
d65acc4e6c
commit
e4e0ae3918
@ -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() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user