From 5f744eaf48a60f3a1c4179f092b7494c2371e7cd Mon Sep 17 00:00:00 2001 From: Jacyking <791026912@qq.com> Date: Fri, 15 Dec 2023 10:06:27 +0800 Subject: [PATCH] support for enum --- include/postgresql.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/postgresql.hpp b/include/postgresql.hpp index 2e25513d..e71a9d2a 100644 --- a/include/postgresql.hpp +++ b/include/postgresql.hpp @@ -520,22 +520,22 @@ class postgresql { } } else if constexpr (std::is_enum_v && !iguana::is_int64_v) { - std::vector temp(20, 0); + char temp[20] = {}; itoa_fwd(static_cast(value), temp.data()); param_values.push_back(std::move(temp)); } else if constexpr (std::is_integral_v && !iguana::is_int64_v) { - std::vector temp(20, 0); + char temp[20] = {}; itoa_fwd(value, temp.data()); param_values.push_back(std::move(temp)); } else if constexpr (iguana::is_int64_v) { - std::vector temp(65, 0); + char temp[65] = {}; xtoa(value, temp.data(), 10, std::is_signed_v); param_values.push_back(std::move(temp)); } else if constexpr (std::is_floating_point_v) { - std::vector temp(20, 0); + char temp[20] = {}; sprintf(temp.data(), "%f", value); param_values.push_back(std::move(temp)); }