From e483d06fe31a2569c58aed429fe6d69f4e7f208c Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sun, 21 Jul 2019 22:02:19 +0200 Subject: Add compile time checked variant (needs C++20) --- main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index d7fb862..bea2436 100644 --- a/main.cpp +++ b/main.cpp @@ -1,8 +1,8 @@ #include "cxxformat.hpp" #include +#include #include - template struct format::FormatConvert, char>>> { @@ -42,8 +42,9 @@ struct format::AutoConversion array[] = {std::array{1, 2, 3, 4, 5}, std::array{1, 2, 3, 4, 5}, std::array{1, 2, 3, 4, 5}, std::array{1, 2, 3, 4, 5}, std::array{1, 2, 3, 4, 5}}; + std::cout << format::format_s("World", 7, 3.5, &array) << std::endl; + std::cout << format::format("%v%v%v%v%v", 'H', 'e', 'l', 'l', 'o') << std::endl; std::cout << format::format("%V", &array) << std::endl; std::cout << format::format("%s", std::array{1, 2, 3, 4, 5}) << std::endl; std::cout << format::format("Hello %v: %-7v %v", "World", 3.5, 5) << std::endl; -- cgit v1.2.3-54-g00ecf