From 4fefd51e08d18042ff5ee9f42efd6e8a5ed5084c Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Sat, 11 Dec 2021 17:07:10 +0200 Subject: [PATCH] Fixed custom type example to work in c++11 --- example/example.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/example/example.cpp b/example/example.cpp index 0d0db6b8..54212374 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -262,12 +262,11 @@ struct my_type namespace fmt_lib = spdlog::fmt_lib; template<> -struct fmt_lib::formatter : fmt_lib::formatter +struct fmt_lib::formatter : fmt_lib::formatter { - auto format(my_type my, format_context &ctx) - { - auto &&out = ctx.out(); - return fmt_lib::format_to(out, "[my_type i={}]", my.i); + auto format(my_type my, format_context &ctx) -> decltype(ctx.out()) + { + return fmt_lib::format_to(ctx.out(), "[my_type i={}]", my.i); } };