diff options
author | louiz’ <louiz@louiz.org> | 2018-03-17 17:33:17 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-03-17 17:34:00 +0100 |
commit | f8a1048ffeec6322c1e64a0eda7636a977669898 (patch) | |
tree | e5e4f8055e73437318a36bddebd1c6d426fdce8e /src/database/query.cpp | |
parent | b956b9d1aa27ac71432839e286f3db0a19aebf6b (diff) | |
download | biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.tar.gz biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.tar.bz2 biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.tar.xz biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.zip |
Re-apply "Use std::optional<bool> instead of OptionalBool"
This reverts commit 03714c6cebf90dc7db8e3997a18cdd19e039c667.
Diffstat (limited to 'src/database/query.cpp')
-rw-r--r-- | src/database/query.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/database/query.cpp b/src/database/query.cpp index d72066e..13c881b 100644 --- a/src/database/query.cpp +++ b/src/database/query.cpp @@ -11,11 +11,11 @@ void actual_bind(Statement& statement, const std::int64_t& value, int index) statement.bind_int64(index, value); } -void actual_bind(Statement& statement, const OptionalBool& value, int index) +void actual_bind(Statement& statement, const std::optional<bool>& value, int index) { - if (!value.is_set) + if (!value) statement.bind_int64(index, 0); - else if (value.value) + else if (*value) statement.bind_int64(index, 1); else statement.bind_int64(index, -1); @@ -26,11 +26,11 @@ void actual_add_param(Query& query, const std::string& val) query.params.push_back(val); } -void actual_add_param(Query& query, const OptionalBool& val) +void actual_add_param(Query& query, const std::optional<bool>& val) { - if (!val.is_set) + if (!val) query.params.push_back("0"); - else if (val.value) + else if (*val) query.params.push_back("1"); else query.params.push_back("-1"); |