Replace boost::optional with std::optional (#6611)
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
#include "util/coordinate.hpp"
|
||||
|
||||
#include <boost/math/constants/constants.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <numeric>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -109,9 +109,9 @@ double bearing(const Coordinate first_coordinate, const Coordinate second_coordi
|
||||
double computeAngle(const Coordinate first, const Coordinate second, const Coordinate third);
|
||||
|
||||
// find the center of a circle through three coordinates
|
||||
boost::optional<Coordinate> circleCenter(const Coordinate first_coordinate,
|
||||
const Coordinate second_coordinate,
|
||||
const Coordinate third_coordinate);
|
||||
std::optional<Coordinate> circleCenter(const Coordinate first_coordinate,
|
||||
const Coordinate second_coordinate,
|
||||
const Coordinate third_coordinate);
|
||||
|
||||
// find the radius of a circle through three coordinates
|
||||
double circleRadius(const Coordinate first_coordinate,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef OSRM_GEOJSON_DEBUG_POLICIES
|
||||
#define OSRM_GEOJSON_DEBUG_POLICIES
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "extractor/query_node.hpp"
|
||||
@@ -9,8 +10,6 @@
|
||||
#include "util/node_based_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
@@ -20,7 +19,7 @@ struct NodeIdVectorToLineString
|
||||
|
||||
// converts a vector of node ids into a linestring geojson feature
|
||||
util::json::Object operator()(const std::vector<NodeID> &node_ids,
|
||||
const boost::optional<json::Object> &properties = {}) const;
|
||||
const std::optional<json::Object> &properties = {}) const;
|
||||
|
||||
const std::vector<util::Coordinate> &node_coordinates;
|
||||
};
|
||||
@@ -29,7 +28,7 @@ struct CoordinateVectorToLineString
|
||||
{
|
||||
// converts a vector of node ids into a linestring geojson feature
|
||||
util::json::Object operator()(const std::vector<util::Coordinate> &coordinates,
|
||||
const boost::optional<json::Object> &properties = {}) const;
|
||||
const std::optional<json::Object> &properties = {}) const;
|
||||
};
|
||||
|
||||
struct NodeIdVectorToMultiPoint
|
||||
@@ -38,7 +37,7 @@ struct NodeIdVectorToMultiPoint
|
||||
|
||||
// converts a vector of node ids into a linestring geojson feature
|
||||
util::json::Object operator()(const std::vector<NodeID> &node_ids,
|
||||
const boost::optional<json::Object> &properties = {}) const;
|
||||
const std::optional<json::Object> &properties = {}) const;
|
||||
|
||||
const std::vector<util::Coordinate> &node_coordinates;
|
||||
};
|
||||
@@ -47,7 +46,7 @@ struct CoordinateVectorToMultiPoint
|
||||
{
|
||||
// converts a vector of node ids into a linestring geojson feature
|
||||
util::json::Object operator()(const std::vector<util::Coordinate> &coordinates,
|
||||
const boost::optional<json::Object> &properties = {}) const;
|
||||
const std::optional<json::Object> &properties = {}) const;
|
||||
};
|
||||
|
||||
} // namespace osrm::util
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
namespace osrm::util
|
||||
{
|
||||
@@ -84,7 +83,7 @@ struct NodeIdToCoordinate
|
||||
|
||||
inline util::json::Object makeFeature(std::string type,
|
||||
util::json::Array coordinates,
|
||||
const boost::optional<util::json::Object> &properties = {})
|
||||
const std::optional<util::json::Object> &properties = {})
|
||||
{
|
||||
util::json::Object result;
|
||||
result.values["type"] = "Feature";
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/heap/d_ary_heap.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
@@ -290,26 +290,26 @@ class QueryHeap
|
||||
return inserted_nodes[index].node == node;
|
||||
}
|
||||
|
||||
boost::optional<HeapNode &> GetHeapNodeIfWasInserted(const NodeID node)
|
||||
HeapNode *GetHeapNodeIfWasInserted(const NodeID node)
|
||||
{
|
||||
const auto index = node_index.peek_index(node);
|
||||
if (index >= static_cast<decltype(index)>(inserted_nodes.size()) ||
|
||||
inserted_nodes[index].node != node)
|
||||
{
|
||||
return {};
|
||||
return nullptr;
|
||||
}
|
||||
return inserted_nodes[index];
|
||||
return &inserted_nodes[index];
|
||||
}
|
||||
|
||||
boost::optional<const HeapNode &> GetHeapNodeIfWasInserted(const NodeID node) const
|
||||
const HeapNode *GetHeapNodeIfWasInserted(const NodeID node) const
|
||||
{
|
||||
const auto index = node_index.peek_index(node);
|
||||
if (index >= static_cast<decltype(index)>(inserted_nodes.size()) ||
|
||||
inserted_nodes[index].node != node)
|
||||
{
|
||||
return {};
|
||||
return nullptr;
|
||||
}
|
||||
return inserted_nodes[index];
|
||||
return &inserted_nodes[index];
|
||||
}
|
||||
|
||||
NodeID Min() const
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/geometry.hpp>
|
||||
#include <boost/geometry/index/rtree.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <optional>
|
||||
|
||||
namespace osrm::updater
|
||||
{
|
||||
@@ -34,7 +34,7 @@ class Timezoner
|
||||
Timezoner(const char geojson[], std::time_t utc_time_now);
|
||||
Timezoner(const boost::filesystem::path &tz_shapes_filename, std::time_t utc_time_now);
|
||||
|
||||
boost::optional<struct tm> operator()(const point_t &point) const;
|
||||
std::optional<struct tm> operator()(const point_t &point) const;
|
||||
|
||||
private:
|
||||
void LoadLocalTimesRTree(rapidjson::Document &geojson, std::time_t utc_time);
|
||||
|
||||
Reference in New Issue
Block a user