BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
bio::ranges::const_iterable_range Concept Reference

Specifies requirements of an input range type for which the const version of that type satisfies the same strength input range concept as the non-const version. More...

#include <bio/ranges/concept.hpp>

Concept definition

template<typename type>
std::ranges::input_range<std::remove_const_t<type>> && std::ranges::input_range<type const> &&
(std::ranges::forward_range<std::remove_const_t<type>> == std::ranges::forward_range<type const>)&&(
std::ranges::bidirectional_range<std::remove_const_t<type>> ==
std::ranges::bidirectional_range<type const>)&&(std::ranges::random_access_range<std::remove_const_t<type>> ==
std::ranges::random_access_range<type const>)
Specifies requirements of an input range type for which the const version of that type satisfies the ...
Definition: concept.hpp:53

Detailed Description

Specifies requirements of an input range type for which the const version of that type satisfies the same strength input range concept as the non-const version.

For a type t it usually holds that if t is a range, t const is also a range with similar properties, but there are cases where this does not hold:

  • a const range is usually not writable so std::ranges::output_range is lost; pure output ranges (those that are not also input ranges) are therefore not const-iterable;
  • single-pass input ranges, like BioC++ readers, are not const-iterable, because "single-pass-ness" implies that there is something in the range that changes on every iterator increment (and const ranges can't change);
  • certain views store a state with their algorithm that also changes when begin() is called or an iterator is incremented; these may be not be const-iterable, because the standard library (and also BioC++) guarantees that it is safe to call const-qualified functions concurrently.