Skip to content

Commit

Permalink
赋初始值时先判断是否已经有值;初始化方式由小括号更改为花括号;
Browse files Browse the repository at this point in the history
  • Loading branch information
TreatTrick committed Dec 12, 2024
1 parent 18990a7 commit ea69f67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ormpp/mysql.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ class mysql {
using U = std::remove_const_t<std::remove_reference_t<T>>;
if constexpr (is_optional_v<U>::value) {
using value_type = typename U::value_type;
value = value_type();
if(!value.has_value()) {
value = value_type{};
}
return set_param_bind(param_bind, *value, i, mp, is_null);
}
else if constexpr (std::is_enum_v<U>) {
Expand Down

0 comments on commit ea69f67

Please sign in to comment.