System::Collections::Generic::Details Namespace Reference

Namespaces

 CastRules
 

Classes

struct  IsEqualExist
 Checks if type provides operator ==. More...
 
struct  has_method_compareto
 Checks whether CompareTo method exists in specified type. If so, inherits std::true_type, otherwise inherits std::false_type. Can be used in std::enable_if. More...
 
struct  has_method_compareto< T, decltype((void)(std::declval< T & >().CompareTo(std::declval< T & >())))>
 Specialization for existing CompareTo method.
 
struct  has_method_compareto_shared_ptr
 Checks whether CompareTo(SharedPtr<T>) method exists in specified type. If so, inherits std::true_type, otherwise inherits std::false_type. Can be used in std::enable_if. More...
 
struct  has_method_compareto_shared_ptr< T, decltype((void)(std::declval< T & >().CompareTo(std::declval< SharedPtr< T >>())))>
 Specializations for existing CompareTo method.
 
struct  ComparerType
 Compares elements using 'less' semantics. More...
 
struct  ComparerType< SharedPtr< T > >
 Compares elements using 'less' semantics. More...
 
class  EnumeratorCastAdapter
 Enumerator used by the IEnumerable.Cast() extension method. More...
 
class  EnumeratorOfTypeAdapter
 Enumerator used by the IEnumerable.OfType() extension method. More...
 
class  EnumeratorSelectAdapter
 Enumerator used by the IEnumerable.Select() extension method. More...
 
class  EnumeratorSelectIndexAdapter
 
class  EnumerableAdapter
 Enumerable used by the IEnumerable.Cast() and IEnumerable.OfType() extension methods. More...
 
class  EnumerableSelectAdapter
 Enumerable used by the IEnumerable.Select() extension method. More...
 
class  EnumerableSelectIndexAdapter
 
class  EnumeratorSelectManyAdapter
 
class  EnumerableSelectManyAdapter
 
class  Grouping
 
class  GroupEnumerable
 

Typedefs

template<class T >
using has_operator_equals = decltype(HasOperatorEqualsHelper(std::declval< T * >(), std::declval< T * >()))
 Dummy typedef to check for operator == existance. More...
 

Functions

template<typename Container >
bool IsOutOfBounds (int idx, const Container &container)
 Checks if index is out of container bounds, excluding container size. More...
 
template<typename Container >
bool IsOutOfBounds (std::int64_t idx, const Container &container)
 Checks if index is out of container bounds, excluding container size. More...
 
template<typename Container >
bool IsOutOfSize (int count, const Container &container)
 Checks if index is out of container bounds, including container size. More...
 
template<typename Container >
bool IsOutOfSize (std::int64_t count, const Container &container)
 Checks if index is out of container bounds, including container size. More...
 
template<class T , typename Dummy = decltype(std::declval<T>() == std::declval<T>())>
std::true_type HasOperatorEqualsHelper (T *, T *)
 Helper function to determine whether specific class has operator ==. More...
 
std::false_type HasOperatorEqualsHelper (void *, void *)
 Helper function to determine whether specific class has operator ==. More...
 
template<typename T >
TryGetFirst (IEnumerable< T > &enumerable, bool &found)
 Tries to get the first element of the collection. More...
 
template<typename T >
TryGetFirst (IEnumerable< T > &enumerable, const Func< T, bool > &predicate, bool &found)
 Tries to get the first element of the collection, which satisfies to the predicate function. More...
 
template<typename T >
TryGetLast (IEnumerable< T > &enumerable, bool &found)
 Tries to get the last element of the collection. More...
 

Typedef Documentation

◆ has_operator_equals

template<class T >
using System::Collections::Generic::Details::has_operator_equals = typedef decltype(HasOperatorEqualsHelper(std::declval<T*>(), std::declval<T*>()))

Dummy typedef to check for operator == existance.

Template Parameters
TType to check.

Function Documentation

◆ HasOperatorEqualsHelper() [1/2]

template<class T , typename Dummy = decltype(std::declval<T>() == std::declval<T>())>
std::true_type System::Collections::Generic::Details::HasOperatorEqualsHelper ( T *  ,
T *   
)

Helper function to determine whether specific class has operator ==.

Template Parameters
TType to check.
DummyDummy argument for SFINAE magic.
Returns
Value of std::true_type if operator == is present and false otherwise.

◆ HasOperatorEqualsHelper() [2/2]

std::false_type System::Collections::Generic::Details::HasOperatorEqualsHelper ( void *  ,
void *   
)

Helper function to determine whether specific class has operator ==.

Returns
Value of std::true_type if operator == is present and false otherwise.

◆ IsOutOfBounds() [1/2]

template<typename Container >
bool System::Collections::Generic::Details::IsOutOfBounds ( int  idx,
const Container &  container 
)

Checks if index is out of container bounds, excluding container size.

Template Parameters
ContainerContainer type.
Parameters
idxIndex.
containerContainer to check index against.
Returns
True if index is out of container bounds, false otherwise.

◆ IsOutOfBounds() [2/2]

template<typename Container >
bool System::Collections::Generic::Details::IsOutOfBounds ( std::int64_t  idx,
const Container &  container 
)

Checks if index is out of container bounds, excluding container size.

Template Parameters
ContainerContainer type.
Parameters
idxIndex.
containerContainer to check index against.
Returns
True if index is out of container bounds, false otherwise.

◆ IsOutOfSize() [1/2]

template<typename Container >
bool System::Collections::Generic::Details::IsOutOfSize ( int  count,
const Container &  container 
)

Checks if index is out of container bounds, including container size.

Template Parameters
ContainerContainer type.
Parameters
countIndex.
containerContainer to check index against.
Returns
True if index is out of container bounds, false otherwise.

◆ IsOutOfSize() [2/2]

template<typename Container >
bool System::Collections::Generic::Details::IsOutOfSize ( std::int64_t  count,
const Container &  container 
)

Checks if index is out of container bounds, including container size.

Template Parameters
ContainerContainer type.
Parameters
countIndex.
containerContainer to check index against.
Returns
True if index is out of container bounds, false otherwise.

◆ TryGetFirst() [1/2]

template<typename T >
T System::Collections::Generic::Details::TryGetFirst ( IEnumerable< T > &  enumerable,
bool found 
)

Tries to get the first element of the collection.

Template Parameters
TThe type of the collection elements.
Parameters
enumerableThe collection from which an element is to be acquired.
foundThe output parameter. Returns true when the collection contains any element. Otherwise false is returned.
Returns
Returns the first collection element. The default value of the type will be returned when the collection is empty.

◆ TryGetFirst() [2/2]

template<typename T >
T System::Collections::Generic::Details::TryGetFirst ( IEnumerable< T > &  enumerable,
const Func< T, bool > &  predicate,
bool found 
)

Tries to get the first element of the collection, which satisfies to the predicate function.

Template Parameters
TThe type of the collection elements.
Parameters
enumerableThe collection from which an element is to be acquired.
predicateThe predicate function.
foundThe output parameter. Returns true when the collection contains any element. Otherwise false is returned.
Returns
Returns the first collection element. The default value of the type will be returned when no element satisfying the specified predicate function is found.

◆ TryGetLast()

template<typename T >
T System::Collections::Generic::Details::TryGetLast ( IEnumerable< T > &  enumerable,
bool found 
)

Tries to get the last element of the collection.

Template Parameters
TThe type of the collection elements.
Parameters
enumerableThe collection from which an element is to be acquired.
foundThe output parameter. Returns true when the collection contains any element. Otherwise false is returned.
Returns
Returns the last collection element. The default value of the type will be returned when the collection is empty.