Open
Description
I propose for:
(bool? isHomogeneous, T value) IsHomogeneous<T>(this IEnumerable<T> source, IEqualitityComparer<T> comparer = null);
DefaultEqualitityComparer<T>
is used if comparer
is null.
The return tuple contains:
isHomogeneous
:null
if the source is emptytrue
if the source has one element or if all the elements in the source are equals to the first element relatively tocomparer
false
otherwise.
value
: the first value of the source ifisHomogeneous
is true,default(T)
otherwise.
I'm open to give this method any other relevant name.
Metadata
Metadata
Assignees
Labels
No labels