TryGetFirst()
Contents
[
Hide
]System::Collections::Generic::Details::TryGetFirst(IEnumerable<T>&, bool&) function
Tries to get the first element of the collection.
template<typename T> T System::Collections::Generic::Details::TryGetFirst(IEnumerable<T> &enumerable, bool &found)
Template parameters
Parameter | Description |
---|---|
T | The type of the collection elements. |
Arguments
Parameter | Type | Description |
---|---|---|
enumerable | IEnumerable<T>& | The collection from which an element is to be acquired. |
found | bool& | The output parameter. Returns true when the collection contains any element. Otherwise false is returned. |
Return Value
Returns the first collection element. The default value of the type will be returned when the collection is empty.
System::Collections::Generic::Details::TryGetFirst(IEnumerable<T>&, const Func<T, bool>&, bool&) function
Tries to get the first element of the collection, which satisfies to the predicate function.
template<typename T> T System::Collections::Generic::Details::TryGetFirst(IEnumerable<T> &enumerable, const Func<T, bool> &predicate, bool &found)
Template parameters
Parameter | Description |
---|---|
T | The type of the collection elements. |
Arguments
Parameter | Type | Description |
---|---|---|
enumerable | IEnumerable<T>& | The collection from which an element is to be acquired. |
predicate | const Func<T, bool>& | The predicate function. |
found | bool& | The output parameter. Returns true when the collection contains any element. Otherwise false is returned. |
Return Value
Returns the first collection element. The default value of the type will be returned when no element satisfying the specified predicate function is found.
See Also
- Class IEnumerable
- Class Func
- Namespace System::Collections::Generic::Details
- Library Aspose.Slides