From 066d985eed48ec8bf123da8a2de93187bc939c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rimas=20Misevi=C4=8Dius?= Date: Thu, 24 Oct 2024 22:28:30 +0300 Subject: [PATCH] Use the CTAD with upa::str_arg in test-str_arg.cpp CTAD - Class template argument deduction (since C++17) --- test/test-str_arg.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/test-str_arg.cpp b/test/test-str_arg.cpp index 76fbd8e..7c094d4 100644 --- a/test/test-str_arg.cpp +++ b/test/test-str_arg.cpp @@ -66,30 +66,30 @@ inline void test_char() { procfn(vptr); // upa::str_arg - upa::str_arg arg(arr); + upa::str_arg arg{ arr }; procfn(arg); - const upa::str_arg carg(arr); + const upa::str_arg carg{ arr }; procfn(carg); - procfn(upa::str_arg{arr, N}); - procfn(upa::str_arg{carr, N}); - procfn(upa::str_arg{ptr, N}); - procfn(upa::str_arg{cptr, N}); - procfn(upa::str_arg{vptr, N}); + procfn(upa::str_arg{ arr, N }); + procfn(upa::str_arg{ carr, N }); + procfn(upa::str_arg{ ptr, N }); + procfn(upa::str_arg{ cptr, N }); + procfn(upa::str_arg{ vptr, N }); // int size - procfn(upa::str_arg(arr, static_cast(N))); - procfn(upa::str_arg(cptr, static_cast(N))); + procfn(upa::str_arg{ arr, static_cast(N) }); + procfn(upa::str_arg{ cptr, static_cast(N) }); - procfn(upa::str_arg{arr, arr + N}); - procfn(upa::str_arg{carr, carr + N}); - procfn(upa::str_arg{ptr, ptr + N}); - procfn(upa::str_arg{cptr, cptr + N}); - procfn(upa::str_arg{vptr, vptr + N}); + procfn(upa::str_arg{ arr, arr + N }); + procfn(upa::str_arg{ carr, carr + N }); + procfn(upa::str_arg{ ptr, ptr + N }); + procfn(upa::str_arg{ cptr, cptr + N }); + procfn(upa::str_arg{ vptr, vptr + N }); // std::basic_string - const std::basic_string str(arr); + const std::basic_string str{ arr }; procfn(str); - procfn(std::basic_string(arr)); + procfn(std::basic_string{ arr }); // custom string procfn(CustomString{cptr, N});