coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Ensures a sequence has at least one element. More...
Functions | |
template<typename = void> | |
auto | coveo::linq::default_if_empty () -> detail::default_if_empty_impl_0<> |
Ensures sequence has at least one element. More... | |
template<typename T > | |
auto | coveo::linq::default_if_empty (const T &obj) -> detail::default_if_empty_impl_1< T > |
Ensures sequence has at least one element, specifying said element. More... | |
The default_if_empty
operator either returns the source sequence or, if that sequence is empty, a new sequence with a single, default element.
.NET equivalent: DefaultIfEmpty
auto coveo::linq::default_if_empty | ( | ) | -> detail::default_if_empty_impl_0<> |
Either returns the source sequence or, if that sequence is empty, a new sequence containing a single, default element.
Use like this:
auto coveo::linq::default_if_empty | ( | const T & | obj | ) | -> detail::default_if_empty_impl_1<T> |
Either returns the source sequence or, if that sequence is empty, a new sequence containing the provided default element.
Use like this:
obj | Default element to use if sequence is empty. |
obj
.