Use std::optional instead of mbgl::optional (#911)

This commit is contained in:
Bart Louwers
2023-03-17 12:51:59 +01:00
committed by GitHub
parent 36846439c6
commit 15ad65dd3d
482 changed files with 2605 additions and 2652 deletions

View File

@@ -5,7 +5,7 @@
namespace mbgl {
void SourceFeatureState::updateState(const optional<std::string>& sourceLayerID, const std::string& featureID,
void SourceFeatureState::updateState(const std::optional<std::string>& sourceLayerID, const std::string& featureID,
const FeatureState& newState) {
std::string sourceLayer = sourceLayerID.value_or(std::string());
for (const auto& state : newState) {
@@ -15,7 +15,7 @@ void SourceFeatureState::updateState(const optional<std::string>& sourceLayerID,
}
}
void SourceFeatureState::getState(FeatureState& result, const optional<std::string>& sourceLayerID,
void SourceFeatureState::getState(FeatureState& result, const std::optional<std::string>& sourceLayerID,
const std::string& featureID) const {
std::string sourceLayer = sourceLayerID.value_or(std::string());
FeatureState current;
@@ -101,8 +101,8 @@ void SourceFeatureState::coalesceChanges(std::vector<RenderTile>& tiles) {
}
}
void SourceFeatureState::removeState(const optional<std::string>& sourceLayerID, const optional<std::string>& featureID,
const optional<std::string>& stateKey) {
void SourceFeatureState::removeState(const std::optional<std::string>& sourceLayerID, const std::optional<std::string>& featureID,
const std::optional<std::string>& stateKey) {
std::string sourceLayer = sourceLayerID.value_or(std::string());
bool sourceLayerDeleted = (deletedStates.count(sourceLayer) > 0) && deletedStates[sourceLayer].empty();