From b86e64ea05341c10e42efbd8c3df09062d832b79 Mon Sep 17 00:00:00 2001 From: blazingkin Date: Mon, 21 Nov 2022 22:51:15 -0800 Subject: [PATCH] Fix an issue with CZ_DEFER working in this context. CZ_DEFER was not working in this context, leading to errors when compiling with g++. Remove the CZ_DEFER and manually move the drop to the end. Fixes #1 --- include/cz/format.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cz/format.hpp b/include/cz/format.hpp index aa3d69d..bbea547 100644 --- a/include/cz/format.hpp +++ b/include/cz/format.hpp @@ -11,9 +11,9 @@ namespace cz { template void print(FILE* file, Allocator allocator, Ts... ts) { String string = {}; - CZ_DEFER(string.drop(allocator)); append(allocator, &string, ts...); fwrite(string.buffer, 1, string.len, file); + string.drop(allocator); } template