summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2021-10-27 21:24:26 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2021-10-27 21:24:26 -0400
commitbd337588f051119f367e3b8b69525f8d697760d5 (patch)
tree251d960831fbc21bd3e10165f2e4fdd96f0e01a5
parent8f300171790b642743a2ca78f4db194dfff18594 (diff)
downloadorcus-bd337588f051119f367e3b8b69525f8d697760d5.tar.gz
Replace the rest of boost::optional with std::optional.
-rw-r--r--include/orcus/spreadsheet/pivot.hpp13
-rw-r--r--src/spreadsheet/factory_pivot.cpp1
-rw-r--r--src/spreadsheet/factory_sheet.cpp6
-rw-r--r--src/spreadsheet/factory_sheet.hpp4
4 files changed, 12 insertions, 12 deletions
diff --git a/include/orcus/spreadsheet/pivot.hpp b/include/orcus/spreadsheet/pivot.hpp
index 401d4c44..dee25596 100644
--- a/include/orcus/spreadsheet/pivot.hpp
+++ b/include/orcus/spreadsheet/pivot.hpp
@@ -16,8 +16,7 @@
#include <vector>
#include <limits>
#include <variant>
-
-#include <boost/optional.hpp>
+#include <optional>
namespace ixion {
@@ -125,7 +124,7 @@ struct ORCUS_SPM_DLLPUBLIC pivot_cache_group_data_t
*/
pivot_cache_indices_t base_to_group_indices;
- boost::optional<range_grouping_type> range_grouping;
+ std::optional<range_grouping_type> range_grouping;
/**
* Individual items comprising the group.
@@ -152,11 +151,11 @@ struct ORCUS_SPM_DLLPUBLIC pivot_cache_field_t
pivot_cache_items_t items;
- boost::optional<double> min_value;
- boost::optional<double> max_value;
+ std::optional<double> min_value;
+ std::optional<double> max_value;
- boost::optional<date_time_t> min_date;
- boost::optional<date_time_t> max_date;
+ std::optional<date_time_t> min_date;
+ std::optional<date_time_t> max_date;
std::unique_ptr<pivot_cache_group_data_t> group_data;
diff --git a/src/spreadsheet/factory_pivot.cpp b/src/spreadsheet/factory_pivot.cpp
index ff1cae3e..7e7a067c 100644
--- a/src/spreadsheet/factory_pivot.cpp
+++ b/src/spreadsheet/factory_pivot.cpp
@@ -13,6 +13,7 @@
#include <sstream>
#include <iostream>
+#include <cassert>
namespace orcus { namespace spreadsheet {
diff --git a/src/spreadsheet/factory_sheet.cpp b/src/spreadsheet/factory_sheet.cpp
index 8a60cc0e..3e04295c 100644
--- a/src/spreadsheet/factory_sheet.cpp
+++ b/src/spreadsheet/factory_sheet.cpp
@@ -322,12 +322,12 @@ void import_formula::set_shared_formula_index(size_t index)
void import_formula::set_result_value(double value)
{
- m_result.reset(ixion::formula_result(value));
+ m_result = ixion::formula_result(value);
}
void import_formula::set_result_string(std::string_view value)
{
- m_result.reset(ixion::formula_result(std::string{value}));
+ m_result = ixion::formula_result(std::string{value});
}
void import_formula::set_result_empty() {}
@@ -371,7 +371,7 @@ void import_formula::commit()
void import_formula::set_missing_formula_result(ixion::formula_result result)
{
- m_result.reset(std::move(result));
+ m_result = std::move(result);
}
void import_formula::set_formula_error_policy(formula_error_policy_t policy)
diff --git a/src/spreadsheet/factory_sheet.hpp b/src/spreadsheet/factory_sheet.hpp
index d762e6ad..20b753d5 100644
--- a/src/spreadsheet/factory_sheet.hpp
+++ b/src/spreadsheet/factory_sheet.hpp
@@ -18,10 +18,10 @@
#include "shared_formula.hpp"
#include <memory>
+#include <optional>
#include <ixion/formula_name_resolver.hpp>
#include <ixion/formula_result.hpp>
#include <ixion/matrix.hpp>
-#include <boost/optional.hpp>
namespace orcus {
@@ -165,7 +165,7 @@ class import_formula : public iface::import_formula
bool m_shared;
ixion::formula_tokens_store_ptr_t m_tokens_store;
- boost::optional<ixion::formula_result> m_result;
+ std::optional<ixion::formula_result> m_result;
formula_error_policy_t m_error_policy;
public: