|
My Project
|
Random access range of values. More...
#include <ActionResult.hpp>
Public Types | |
| using | RandIt = typename std::vector< T >::const_iterator |
| Random access iterator. | |
Public Member Functions | |
| ValueRange (RandIt first, RandIt last, bool isSorted=false) | |
| Constructor. | |
| auto | begin () const |
| Beginning of value range's elements. | |
| auto | end () const |
| End of value range's elements. | |
| auto | empty () const |
| Predicate for an empty value range. | |
| auto | size () const |
| Number of elements in the value range. | |
| std::vector< T > | asVector () const |
| Convert value range to a std::vector. | |
| bool | hasElement (const T &elem) const |
| Element existence predicate. | |
Random access range of values.
Poor-man's substitute for C++20's std::span<T>.
| T | Element type of range. Typically std::string since the common use case of class ValueRange<> is to represent a sequence of well or group names. |
| using Opm::Action::Result::ValueRange< T >::RandIt = typename std::vector<T>::const_iterator |
Random access iterator.
Class ValueRange<> assumes that the underlying sequence is a std::vector<T> of sufficient lifetime.
|
inlineexplicit |
Constructor.
Forms a ValueRange object from an iterator range.
| [in] | first | First element in value range. |
| [in] | last | One past the end of the elements in the value range. |
| [in] | isSorted | Wether or not the value range is sorted by std::less<>
|
|
inline |
Convert value range to a std::vector.
Copies elements.
|
inline |
Element existence predicate.
| [in] | elem | Element for which to check existence. |
elem exists in the value range.