Skip to content

Commit

Permalink
Move to std::optional like the rest of mantid
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Oct 22, 2024
1 parent 2d15aea commit 540c68d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Framework/DataHandling/src/AlignAndFocusPowderSlim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ class Histogrammer {
}
}

boost::optional<size_t> findBin(const double tof) const {
std::optional<size_t> findBin(const double tof) const {
// return boost::none;
if (tof < m_xmin || tof >= m_xmax) {
return boost::none;
return std::nullopt;
} else {
return m_findBin(*m_binedges, tof, m_bin_divisor, m_bin_offset, true);
}
Expand All @@ -101,7 +101,7 @@ class Histogrammer {
double m_xmin;
double m_xmax;
const std::vector<double> *m_binedges;
boost::optional<size_t> (*m_findBin)(const MantidVec &, const double, const double, const double, const bool);
std::optional<size_t> (*m_findBin)(const MantidVec &, const double, const double, const double, const bool);
};

template <typename CountsType> class ProcessEventsTask {
Expand All @@ -118,7 +118,7 @@ template <typename CountsType> class ProcessEventsTask {

const auto binnum = m_histogrammer->findBin(tof);
if (binnum)
y_temp->at(binnum.get())++;
y_temp->at(binnum.value())++;
}
}

Expand Down

0 comments on commit 540c68d

Please sign in to comment.