openMSX
Concepts | Functions
ranges Namespace Reference

Concepts

concept  range
 
concept  sized_range
 

Functions

template<typename ForwardRange , typename Compare = std::less<>, typename Proj = std::identity>
bool is_sorted (ForwardRange &&range, Compare comp={}, Proj proj={})
 
template<typename RandomAccessRange >
constexpr void sort (RandomAccessRange &&range)
 
template<typename RandomAccessRange , typename Compare >
constexpr void sort (RandomAccessRange &&range, Compare comp)
 
template<typename RAIter , typename Compare = std::less<>, typename Proj >
void sort (RAIter first, RAIter last, Compare comp, Proj proj)
 
template<typename RandomAccessRange , typename Compare = std::less<>, typename Proj >
void sort (RandomAccessRange &&range, Compare comp, Proj proj)
 
template<typename RandomAccessRange >
void stable_sort (RandomAccessRange &&range)
 
template<typename RandomAccessRange , typename Compare >
void stable_sort (RandomAccessRange &&range, Compare comp)
 
template<typename RAIter , typename Compare = std::less<>, typename Proj >
void stable_sort (RAIter first, RAIter last, Compare comp, Proj proj)
 
template<typename RandomAccessRange , typename Compare = std::less<>, typename Proj >
void stable_sort (RandomAccessRange &&range, Compare comp, Proj proj)
 
template<typename ForwardRange , typename T >
bool binary_search (ForwardRange &&range, const T &value)
 
template<typename ForwardRange , typename T , typename Compare >
bool binary_search (ForwardRange &&range, const T &value, Compare comp)
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto lower_bound (ForwardRange &&range, const T &value, Compare comp={}, Proj proj={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto upper_bound (ForwardRange &&range, const T &value, Compare comp={}, Proj proj={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>>
auto equal_range (ForwardRange &&range, const T &value, Compare comp={})
 
template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto equal_range (ForwardRange &&range, const T &value, Compare comp, Proj proj)
 
template<typename InputRange , typename T >
auto find (InputRange &&range, const T &value)
 
template<typename InputRange , typename T , typename Proj >
auto find (InputRange &&range, const T &value, Proj proj)
 
template<typename InputRange , typename UnaryPredicate >
auto find_if (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange , typename UnaryPredicate >
bool all_of (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange , typename UnaryPredicate >
bool any_of (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange , typename UnaryPredicate >
bool none_of (InputRange &&range, UnaryPredicate pred)
 
template<typename ForwardRange >
auto unique (ForwardRange &&range)
 
template<typename ForwardRange , typename BinaryPredicate >
auto unique (ForwardRange &&range, BinaryPredicate pred)
 
template<typename RAIter , typename Compare = std::equal_to<>, typename Proj >
auto unique (RAIter first, RAIter last, Compare comp, Proj proj)
 
template<typename RandomAccessRange , typename Compare = std::equal_to<>, typename Proj >
auto unique (RandomAccessRange &&range, Compare comp, Proj proj)
 
template<typename InputRange , typename OutputIter >
requires (!range<OutputIter>)
auto copy (InputRange &&range, OutputIter out)
 
template<sized_range Input, sized_range Output>
auto copy (Input &&in, Output &&out)
 
template<typename InputRange , typename OutputIter , typename UnaryPredicate >
auto copy_if (InputRange &&range, OutputIter out, UnaryPredicate pred)
 
template<typename InputRange , typename OutputIter , typename UnaryOperation >
auto transform (InputRange &&range, OutputIter out, UnaryOperation op)
 
template<typename ForwardRange , typename Generator >
void generate (ForwardRange &&range, Generator &&g)
 
template<typename ForwardRange , typename T >
auto remove (ForwardRange &&range, const T &value)
 
template<typename ForwardRange , typename UnaryPredicate >
auto remove_if (ForwardRange &&range, UnaryPredicate pred)
 
template<typename ForwardRange , typename T >
constexpr void replace (ForwardRange &&range, const T &old_value, const T &new_value)
 
template<typename ForwardRange , typename UnaryPredicate , typename T >
void replace_if (ForwardRange &&range, UnaryPredicate pred, const T &new_value)
 
template<typename ForwardRange , typename T >
constexpr void fill (ForwardRange &&range, const T &value)
 
template<typename ForwardIt , typename T >
constexpr void iota (ForwardIt first, ForwardIt last, T value)
 
template<typename ForwardRange , typename T >
constexpr void iota (ForwardRange &&range, T &&value)
 
template<typename InputRange , typename T >
accumulate (InputRange &&range, T init)
 
template<typename InputRange , typename T , typename BinaryOperation >
accumulate (InputRange &&range, T init, BinaryOperation op)
 
template<typename InputRange , typename T >
auto count (InputRange &&range, const T &value)
 
template<typename InputRange , typename UnaryPredicate >
auto count_if (InputRange &&range, UnaryPredicate pred)
 
template<typename InputRange1 , typename InputRange2 , typename OutputIter >
auto set_difference (InputRange1 &&range1, InputRange2 &&range2, OutputIter out)
 
template<range InputRange1, range InputRange2, typename Pred = std::equal_to<void>, typename Proj1 = std::identity, typename Proj2 = std::identity>
bool equal (InputRange1 &&range1, InputRange2 &&range2, Pred pred={}, Proj1 proj1={}, Proj2 proj2={})
 
template<sized_range SizedRange1, sized_range SizedRange2, typename Pred = std::equal_to<void>, typename Proj1 = std::identity, typename Proj2 = std::identity>
bool equal (SizedRange1 &&range1, SizedRange2 &&range2, Pred pred={}, Proj1 proj1={}, Proj2 proj2={})
 
template<typename InputRange , typename Proj = std::identity>
bool all_equal (InputRange &&range, Proj proj={})
 

Function Documentation

◆ accumulate() [1/2]

template<typename InputRange , typename T >
T ranges::accumulate ( InputRange &&  range,
init 
)

Definition at line 309 of file ranges.hh.

◆ accumulate() [2/2]

template<typename InputRange , typename T , typename BinaryOperation >
T ranges::accumulate ( InputRange &&  range,
init,
BinaryOperation  op 
)

Definition at line 315 of file ranges.hh.

◆ all_equal()

template<typename InputRange , typename Proj = std::identity>
bool ranges::all_equal ( InputRange &&  range,
Proj  proj = {} 
)

Definition at line 380 of file ranges.hh.

Referenced by openmsx::OSDImageBasedWidget::hasConstantAlpha().

◆ all_of()

template<typename InputRange , typename UnaryPredicate >
bool ranges::all_of ( InputRange &&  range,
UnaryPredicate  pred 
)

◆ any_of()

template<typename InputRange , typename UnaryPredicate >
bool ranges::any_of ( InputRange &&  range,
UnaryPredicate  pred 
)

◆ binary_search() [1/2]

template<typename ForwardRange , typename T >
bool ranges::binary_search ( ForwardRange &&  range,
const T &  value 
)

Definition at line 103 of file ranges.hh.

References begin(), binary_search(), and end().

Referenced by openmsx::OggReader::stopFrame().

◆ binary_search() [2/2]

template<typename ForwardRange , typename T , typename Compare >
bool ranges::binary_search ( ForwardRange &&  range,
const T &  value,
Compare  comp 
)

Definition at line 109 of file ranges.hh.

References begin(), binary_search(), openmsx::comp(), and end().

Referenced by binary_search().

◆ copy() [1/2]

template<sized_range Input, sized_range Output>
auto ranges::copy ( Input &&  in,
Output &&  out 
)

Definition at line 238 of file ranges.hh.

References begin(), copy(), end(), and utf8::unchecked::size().

Referenced by copy().

◆ copy() [2/2]

template<typename InputRange , typename OutputIter >
requires (!range<OutputIter>)
auto ranges::copy ( InputRange &&  range,
OutputIter  out 
)

Definition at line 232 of file ranges.hh.

References begin(), copy(), and end().

Referenced by openmsx::Rom::addPadding(), allocate_c_string(), openmsx::XMLDocument::allocateString(), openmsx::DeltaBlockCopy::apply(), openmsx::VDPVRAM::change4k8kMapping(), strCatImpl::ConcatViaString::copy(), strCatImpl::ConcatUnit< std::string_view >::copy(), strCatImpl::ConcatIntegral< T >::copy(), openmsx::EmptyPatch::copyBlock(), openmsx::IPSPatch::copyBlock(), openmsx::DeltaBlockCopy::DeltaBlockCopy(), openmsx::SDLRasterizer< Pixel >::drawDisplay(), Base64::encode(), openmsx::SuperImposeScalerOutput< Pixel >::fillLine(), openmsx::SettingsManager::findSetting(), openmsx::YM2413NukeYKT::YM2413::generateChannels(), openmsx::YM2413OriginalNukeYKT::YM2413::generateChannels(), make_string_storage(), openmsx::Scale_1on1< Pixel >::operator()(), view::detail::TransformIterator< Iterator, UnaryOp >::operator++(), XRange< T >::Iter::operator++(), view::detail::TransformIterator< Iterator, UnaryOp >::operator--(), XRange< T >::Iter::operator--(), openmsx::SDLSnow< Pixel >::paint(), openmsx::CompressedFileAdapter::read(), openmsx::MemoryBufferFile::read(), openmsx::SchedulerQueue< T >::remove(), openmsx::MemOutputArchive::save(), openmsx::Scaler1< Pixel >::scale1x1to1x1(), openmsx::Scaler2< Pixel >::scale1x1to1x1(), openmsx::Scaler2< Pixel >::scale1x1to1x2(), openmsx::FrameSource::scaleLine(), openmsx::NowindHost::serialize(), openmsx::MemOutputArchive::serialize_blob(), openmsx::MemInputArchive::serialize_blob(), StringOp::split_view(), openmsx::DBParser::stop(), openmsx::TC8566AF::TC8566AF(), TEST_CASE(), openmsx::tiger(), openmsx::SHA1::update(), openmsx::SDLSoundDriver::uploadBuffer(), openmsx::YM2413NukeYKT::YM2413::YM2413(), openmsx::AviWriter::~AviWriter(), openmsx::Scheduler::~Scheduler(), and openmsx::Subject< T >::~Subject().

◆ copy_if()

template<typename InputRange , typename OutputIter , typename UnaryPredicate >
auto ranges::copy_if ( InputRange &&  range,
OutputIter  out,
UnaryPredicate  pred 
)

Definition at line 245 of file ranges.hh.

References begin(), copy_if(), and end().

Referenced by copy_if().

◆ count()

template<typename InputRange , typename T >
auto ranges::count ( InputRange &&  range,
const T &  value 
)

Definition at line 321 of file ranges.hh.

References begin(), count(), and end().

Referenced by count(), and subspan().

◆ count_if()

template<typename InputRange , typename UnaryPredicate >
auto ranges::count_if ( InputRange &&  range,
UnaryPredicate  pred 
)

Definition at line 327 of file ranges.hh.

References begin(), count_if(), and end().

Referenced by count_if().

◆ equal() [1/2]

template<range InputRange1, range InputRange2, typename Pred = std::equal_to<void>, typename Proj1 = std::identity, typename Proj2 = std::identity>
bool ranges::equal ( InputRange1 &&  range1,
InputRange2 &&  range2,
Pred  pred = {},
Proj1  proj1 = {},
Proj2  proj2 = {} 
)

◆ equal() [2/2]

template<sized_range SizedRange1, sized_range SizedRange2, typename Pred = std::equal_to<void>, typename Proj1 = std::identity, typename Proj2 = std::identity>
bool ranges::equal ( SizedRange1 &&  range1,
SizedRange2 &&  range2,
Pred  pred = {},
Proj1  proj1 = {},
Proj2  proj2 = {} 
)

Definition at line 361 of file ranges.hh.

◆ equal_range() [1/2]

template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto ranges::equal_range ( ForwardRange &&  range,
const T &  value,
Compare  comp,
Proj  proj 
)

Definition at line 138 of file ranges.hh.

References begin().

◆ equal_range() [2/2]

template<typename ForwardRange , typename T , typename Compare = std::less<>>
auto ranges::equal_range ( ForwardRange &&  range,
const T &  value,
Compare  comp = {} 
)

◆ fill()

template<typename ForwardRange , typename T >
constexpr void ranges::fill ( ForwardRange &&  range,
const T &  value 
)
constexpr

Definition at line 287 of file ranges.hh.

References begin(), end(), and fill().

Referenced by openmsx::AbstractIDEDevice::AbstractIDEDevice(), openmsx::Rom::addPadding(), openmsx::BlipBuffer::BlipBuffer(), openmsx::Sha1Sum::clear(), openmsx::V9990VRAM::clear(), openmsx::VDPVRAM::clear(), strCatImpl::ConcatSpaces::copy(), openmsx::EmptyPatch::copyBlock(), openmsx::DirAsDSK::DirAsDSK(), fill(), openmsx::DiskImageUtils::format(), openmsx::SpriteChecker::frameStart(), openmsx::YM2413Burczynski::YM2413::generateChannels(), hash_set< Value, Extractor, Hasher, Equal >::grow(), openmsx::HardwareConfig::HardwareConfig(), openmsx::MSXCPU::invalidateAllSlotsRWCache(), openmsx::Keyboard::Keyboard(), openmsx::MB89352::MB89352(), openmsx::SRAM::memset(), openmsx::SoundDevice::mixChannels(), openmsx::MsxChar2Unicode::MsxChar2Unicode(), openmsx::MSXCPUInterface::MSXCPUInterface(), openmsx::MSXDeviceSwitch::MSXDeviceSwitch(), openmsx::MSXSCCPlusCart::MSXSCCPlusCart(), openmsx::NinjaTap::NinjaTap(), openmsx::OSDImageBasedWidget::OSDImageBasedWidget(), openmsx::Paper::Paper(), openmsx::SCC::powerUp(), hash_set< Value, Extractor, Hasher, Equal >::reserve(), openmsx::VLM5030::reset(), openmsx::YM2413Okazaki::Slot::reset(), openmsx::YM2413NukeYKT::YM2413::reset(), openmsx::YM2413OriginalNukeYKT::YM2413::reset(), openmsx::WD33C93::reset(), openmsx::Y8950::reset(), openmsx::MSXMemoryMapperBase::reset(), openmsx::RomHolyQuran2::reset(), openmsx::ROMHunterMk2::reset(), openmsx::RomNettouYakyuu::reset(), openmsx::RomPanasonic::reset(), openmsx::V9990::reset(), openmsx::SCC::SCC(), openmsx::SDLOffScreenSurface::SDLOffScreenSurface(), openmsx::SpriteChecker::serialize(), openmsx::SoundDevice::SoundDevice(), openmsx::AbstractIDEDevice::startShortReadTransfer(), TEST_CASE(), openmsx::GLHQLiteScaler::uploadBlock(), openmsx::GLHQScaler::uploadBlock(), openmsx::WD33C93::WD33C93(), openmsx::ImagePrinter::write(), openmsx::YM2413OriginalNukeYKT::YM2413::writePort(), openmsx::Wav16Writer::writeSilence(), openmsx::YM2413Burczynski::YM2413::YM2413(), openmsx::YM2413Okazaki::YM2413::YM2413(), and openmsx::YMF278::YMF278().

◆ find() [1/2]

template<typename InputRange , typename T >
auto ranges::find ( InputRange &&  range,
const T &  value 
)

◆ find() [2/2]

template<typename InputRange , typename T , typename Proj >
auto ranges::find ( InputRange &&  range,
const T &  value,
Proj  proj 
)

Definition at line 166 of file ranges.hh.

References Math::e, and find_if().

Referenced by find().

◆ find_if()

template<typename InputRange , typename UnaryPredicate >
auto ranges::find_if ( InputRange &&  range,
UnaryPredicate  pred 
)

◆ generate()

template<typename ForwardRange , typename Generator >
void ranges::generate ( ForwardRange &&  range,
Generator &&  g 
)

Definition at line 257 of file ranges.hh.

References begin(), end(), g, and generate().

Referenced by generate(), and openmsx::GLSnow::GLSnow().

◆ iota() [1/2]

template<typename ForwardIt , typename T >
constexpr void ranges::iota ( ForwardIt  first,
ForwardIt  last,
value 
)
constexpr

◆ iota() [2/2]

template<typename ForwardRange , typename T >
constexpr void ranges::iota ( ForwardRange &&  range,
T &&  value 
)
constexpr

Definition at line 303 of file ranges.hh.

References begin(), end(), and iota().

Referenced by iota().

◆ is_sorted()

template<typename ForwardRange , typename Compare = std::less<>, typename Proj = std::identity>
bool ranges::is_sorted ( ForwardRange &&  range,
Compare  comp = {},
Proj  proj = {} 
)

Definition at line 40 of file ranges.hh.

◆ lower_bound()

template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto ranges::lower_bound ( ForwardRange &&  range,
const T &  value,
Compare  comp = {},
Proj  proj = {} 
)

◆ none_of()

template<typename InputRange , typename UnaryPredicate >
bool ranges::none_of ( InputRange &&  range,
UnaryPredicate  pred 
)

Definition at line 198 of file ranges.hh.

References begin(), end(), and none_of().

Referenced by openmsx::MSXMultiMemDevice::canAdd(), and none_of().

◆ remove()

template<typename ForwardRange , typename T >
auto ranges::remove ( ForwardRange &&  range,
const T &  value 
)

Definition at line 263 of file ranges.hh.

References begin(), end(), and remove().

Referenced by openmsx::Subject< T >::notify(), and remove().

◆ remove_if()

template<typename ForwardRange , typename UnaryPredicate >
auto ranges::remove_if ( ForwardRange &&  range,
UnaryPredicate  pred 
)

Definition at line 269 of file ranges.hh.

References begin(), end(), and remove_if().

Referenced by openmsx::SchedulerQueue< T >::remove_all(), and remove_if().

◆ replace()

template<typename ForwardRange , typename T >
constexpr void ranges::replace ( ForwardRange &&  range,
const T &  old_value,
const T &  new_value 
)
constexpr

Definition at line 275 of file ranges.hh.

References begin(), end(), and replace().

Referenced by replace().

◆ replace_if()

template<typename ForwardRange , typename UnaryPredicate , typename T >
void ranges::replace_if ( ForwardRange &&  range,
UnaryPredicate  pred,
const T &  new_value 
)

Definition at line 281 of file ranges.hh.

References begin(), end(), and replace_if().

Referenced by replace_if().

◆ set_difference()

template<typename InputRange1 , typename InputRange2 , typename OutputIter >
auto ranges::set_difference ( InputRange1 &&  range1,
InputRange2 &&  range2,
OutputIter  out 
)

Definition at line 333 of file ranges.hh.

References begin(), end(), and set_difference().

Referenced by set_difference().

◆ sort() [1/4]

template<typename RAIter , typename Compare = std::less<>, typename Proj >
void ranges::sort ( RAIter  first,
RAIter  last,
Compare  comp,
Proj  proj 
)

Definition at line 61 of file ranges.hh.

References sort().

◆ sort() [2/4]

template<typename RandomAccessRange >
constexpr void ranges::sort ( RandomAccessRange &&  range)
constexpr

◆ sort() [3/4]

template<typename RandomAccessRange , typename Compare >
constexpr void ranges::sort ( RandomAccessRange &&  range,
Compare  comp 
)
constexpr

Definition at line 55 of file ranges.hh.

References begin(), openmsx::comp(), end(), and sort().

◆ sort() [4/4]

template<typename RandomAccessRange , typename Compare = std::less<>, typename Proj >
void ranges::sort ( RandomAccessRange &&  range,
Compare  comp,
Proj  proj 
)

Definition at line 70 of file ranges.hh.

References begin(), openmsx::comp(), end(), and sort().

Referenced by sort().

◆ stable_sort() [1/4]

template<typename RAIter , typename Compare = std::less<>, typename Proj >
void ranges::stable_sort ( RAIter  first,
RAIter  last,
Compare  comp,
Proj  proj 
)

Definition at line 88 of file ranges.hh.

References stable_sort().

◆ stable_sort() [2/4]

template<typename RandomAccessRange >
void ranges::stable_sort ( RandomAccessRange &&  range)

Definition at line 76 of file ranges.hh.

References begin(), end(), and stable_sort().

Referenced by stable_sort().

◆ stable_sort() [3/4]

template<typename RandomAccessRange , typename Compare >
void ranges::stable_sort ( RandomAccessRange &&  range,
Compare  comp 
)

Definition at line 82 of file ranges.hh.

References begin(), openmsx::comp(), end(), and stable_sort().

◆ stable_sort() [4/4]

template<typename RandomAccessRange , typename Compare = std::less<>, typename Proj >
void ranges::stable_sort ( RandomAccessRange &&  range,
Compare  comp,
Proj  proj 
)

Definition at line 97 of file ranges.hh.

References begin(), openmsx::comp(), end(), and stable_sort().

Referenced by stable_sort().

◆ transform()

template<typename InputRange , typename OutputIter , typename UnaryOperation >
auto ranges::transform ( InputRange &&  range,
OutputIter  out,
UnaryOperation  op 
)

Definition at line 251 of file ranges.hh.

References begin(), end(), and transform().

Referenced by transform(), transform_in_place(), and openmsx::Wav16Writer::write().

◆ unique() [1/4]

template<typename ForwardRange >
auto ranges::unique ( ForwardRange &&  range)

Definition at line 204 of file ranges.hh.

References begin(), end(), and unique().

Referenced by openmsx::Reactor::getHwConfigs(), test(), and unique().

◆ unique() [2/4]

template<typename ForwardRange , typename BinaryPredicate >
auto ranges::unique ( ForwardRange &&  range,
BinaryPredicate  pred 
)

Definition at line 210 of file ranges.hh.

References begin(), end(), and unique().

◆ unique() [3/4]

template<typename RAIter , typename Compare = std::equal_to<>, typename Proj >
auto ranges::unique ( RAIter  first,
RAIter  last,
Compare  comp,
Proj  proj 
)

Definition at line 216 of file ranges.hh.

References unique().

◆ unique() [4/4]

template<typename RandomAccessRange , typename Compare = std::equal_to<>, typename Proj >
auto ranges::unique ( RandomAccessRange &&  range,
Compare  comp,
Proj  proj 
)

Definition at line 225 of file ranges.hh.

References begin(), openmsx::comp(), end(), and unique().

Referenced by unique().

◆ upper_bound()

template<typename ForwardRange , typename T , typename Compare = std::less<>, typename Proj = std::identity>
auto ranges::upper_bound ( ForwardRange &&  range,
const T &  value,
Compare  comp = {},
Proj  proj = {} 
)