Visual Computing Library
Loading...
Searching...
No Matches
vcl::InputRange Concept Reference

Utility concept that is evaluated true the Range R is an Input Range and has a value_type that is convertible to T. More...

#include <vclib/concepts/ranges/range.h>

Concept definition

template<typename R, typename T>
concept vcl::InputRange =
Range<R> && std::convertible_to<std::ranges::range_value_t<R>, T>
Utility concept that is evaluated true the Range R is an Input Range and has a value_type that is con...
Definition range.h:89
Utility concept that is evaluated true if T is a range, e.g. if has a begin and an end.
Definition range.h:39

Detailed Description

Utility concept that is evaluated true the Range R is an Input Range and has a value_type that is convertible to T.

This concept is useful when you need to check that a range has a value_type that is convertible to T. When this concept is satisfied the following code will always compile:

for (T value : range) {
// do something with value
...
}
Template Parameters
RThe range type.
TThe value type.