Switch boost::optional to std::optional

This commit is contained in:
V.Kalyuzhny 2018-10-15 00:17:56 +03:00 committed by MerryMage
parent 85bc96a61c
commit 764a93bf5a
42 changed files with 137 additions and 125 deletions

View file

@ -57,7 +57,7 @@ void Block::SetCondition(Cond condition) {
}
LocationDescriptor Block::ConditionFailedLocation() const {
return cond_failed.get();
return *cond_failed;
}
void Block::SetConditionFailedLocation(LocationDescriptor fail_location) {
@ -73,7 +73,7 @@ const size_t& Block::ConditionFailedCycleCount() const {
}
bool Block::HasConditionFailedLocation() const {
return cond_failed.is_initialized();
return cond_failed.has_value();
}
Block::InstructionList& Block::Instructions() {

View file

@ -8,10 +8,9 @@
#include <initializer_list>
#include <memory>
#include <optional>
#include <string>
#include <boost/optional.hpp>
#include "common/common_types.h"
#include "common/intrusive_list.h"
#include "common/memory_pool.h"
@ -139,7 +138,7 @@ private:
/// Conditional to pass in order to execute this block
Cond cond = Cond::AL;
/// Block to execute next if `cond` did not pass.
boost::optional<LocationDescriptor> cond_failed = {};
std::optional<LocationDescriptor> cond_failed = {};
/// Number of cycles this block takes to execute if the conditional fails.
size_t cond_failed_cycle_count = 0;