System::Collections::Generic::_net_binnary_search method

System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator>&, int, int, T, const SharedPtr<System::Collections::Generic::IComparer<T>>&) method

Implements binary search in random access container.

template<template< typename, typename > class,class T,class Allocator> int System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator> &container, int index, int count, T value, const SharedPtr<System::Collections::Generic::IComparer<T>> &comparer)
ParameterDescription
containerTSTL-styled container template type with two template arguments: element type and allocator type.
TElement type.
AllocatorAllocator type.
ParameterTypeDescription
containerconst containterT<T, Allocator>&Container to search in.
indexintSearch range beginning index.
countintSearch range length.
valueTValue to look for.
comparerconst SharedPtr<System::Collections::Generic::IComparer<T>>&Comparer object.

ReturnValue

If found, index of the next element; otherwise, complements of index at which the search stopped.

See Also

System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator>&, int, int, T) method

Implements binary search in random access container. Specialization for smart pointers. Uses System::Object::CompareTo method.

template<template< typename, typename > class,class T,class Allocator> std::enable_if<IsSmartPtr<T>::value, int>::type System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator> &container, int index, int count, T value)
ParameterDescription
containerTSTL-styled container template type with two template arguments: element type and allocator type.
TElement type.
AllocatorAllocator type.
ParameterTypeDescription
containerconst containterT<T, Allocator>&Container to search in.
indexintSearch range beginning index.
countintSearch range length.
valueTValue to look for.

ReturnValue

If found, index of the next element; otherwise, complements of index at which the search stopped.

See Also

System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator>&, int, int, T) method

Implements binary search in random access container. Specialization for value types. Uses CompareTo method.

template<template< typename, typename > class,class T,class Allocator> std::enable_if<!IsSmartPtr<T>::value &&!std::is_scalar<T>::value, int>::type System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator> &container, int index, int count, T value)
ParameterDescription
containerTSTL-styled container template type with two template arguments: element type and allocator type.
TElement type.
AllocatorAllocator type.
ParameterTypeDescription
containerconst containterT<T, Allocator>&Container to search in.
indexintSearch range beginning index.
countintSearch range length.
valueTValue to look for.

ReturnValue

If found, index of the next element; otherwise, complements of index at which the search stopped.

See Also

System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator>&, int, int, T) method

Implements binary search in random access container. Specialization for scalar types. Compares elements using greater and less operators.

template<template< typename, typename > class,class T,class Allocator> std::enable_if<std::is_scalar<T>::value, int>::type System::Collections::Generic::_net_binnary_search(const containterT<T, Allocator> &container, int index, int count, T value)
ParameterDescription
containerTSTL-styled container template type with two template arguments: element type and allocator type.
TElement type.
AllocatorAllocator type.
ParameterTypeDescription
containerconst containterT<T, Allocator>&Container to search in.
indexintSearch range beginning index.
countintSearch range length.
valueTValue to look for.

ReturnValue

If found, index of the next element; otherwise, complements of index at which the search stopped.

See Also