summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2021-10-27 21:14:08 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2021-10-27 21:14:08 -0400
commit8f300171790b642743a2ca78f4db194dfff18594 (patch)
tree13e58a5e6a041bb633c9bcc9d49b49bc852fdc1d
parentde870554e43297e1db63b1d4e55f4c7a52a7ce9c (diff)
downloadorcus-8f300171790b642743a2ca78f4db194dfff18594.tar.gz
Replace boost::optional with std::optional.
This also helped remove the following warnings: xlsx_pivot_context.cpp:964:37: warning: ‘*((void*)& max_value +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized] 964 | m_pcache.set_field_max_value(*max_value); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ xlsx_pivot_context.cpp:961:37: warning: ‘*((void*)& min_value +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized] 961 | m_pcache.set_field_min_value(*min_value); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
-rw-r--r--src/liborcus/xlsx_pivot_context.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/liborcus/xlsx_pivot_context.cpp b/src/liborcus/xlsx_pivot_context.cpp
index 66470734..72b8e9c5 100644
--- a/src/liborcus/xlsx_pivot_context.cpp
+++ b/src/liborcus/xlsx_pivot_context.cpp
@@ -16,7 +16,7 @@
#include "orcus/spreadsheet/import_interface_pivot.hpp"
#include <iostream>
-#include <boost/optional.hpp>
+#include <optional>
#include <mdds/sorted_string_map.hpp>
using namespace std;
@@ -344,8 +344,8 @@ void xlsx_pivot_cache_def_context::start_element(xmlns_id_t ns, xml_token_t name
double end = 0.0;
double interval = 1.0;
- boost::optional<date_time_t> start_date;
- boost::optional<date_time_t> end_date;
+ std::optional<date_time_t> start_date;
+ std::optional<date_time_t> end_date;
// Default group-by type appears to be 'range'.
spreadsheet::pivot_cache_group_by_t group_by =
@@ -899,10 +899,10 @@ void xlsx_pivot_cache_def_context::start_element_shared_items(
bool has_long_text = false;
long count = -1;
- boost::optional<double> min_value;
- boost::optional<double> max_value;
- boost::optional<date_time_t> min_date;
- boost::optional<date_time_t> max_date;
+ std::optional<double> min_value;
+ std::optional<double> max_value;
+ std::optional<date_time_t> min_date;
+ std::optional<date_time_t> max_date;
for_each(attrs.begin(), attrs.end(),
[&](const xml_token_attr_t& attr)