coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Returns nth element in a sequence, or a default value. More...
Functions | |
template<typename = void> | |
auto | coveo::linq::element_at_or_default (std::size_t n) -> detail::element_at_or_default_impl<> |
Returns nth element in sequence or default value. More... | |
The element_at
operator returns the nth element in the sequence. If the sequence does not have enough elements, a default value is returned instead.
This is a terminal operator.
.NET equivalent: ElementAtOrDefault
auto coveo::linq::element_at_or_default | ( | std::size_t | n | ) | -> detail::element_at_or_default_impl<> |
Returns the n
th element in a sequence. If the sequence does not have enough elements, a default-initialized value is returned instead.
Use like this:
n | 0-based index of element to return. |
n
th element in sequence or, if sequence does not have enough elements, a default value.