5#include "system/shared_ptr.h"
6#include "system/collections/icomparer.h"
22template<
template<
typename,
typename>
class containterT,
class T,
class Allocator>
26 int f = index + count - 1;
31 m = s + ((f - s) / 2);
32 c = comparer->Compare(value, container[m]);
57template<
template<
typename,
typename>
class containterT,
class T,
class Allocator>
58typename std::enable_if<IsSmartPtr<T>::value,
int>::type
_net_binnary_search(
const containterT<T, Allocator> &container,
int index,
int count, T value)
61 int f = index + count - 1;
66 m = s + ((f - s) / 2);
67 c = value->CompareTo(container[m]);
92template<
template<
typename,
typename>
class containterT,
class T,
class Allocator>
93typename std::enable_if<!IsSmartPtr<T>::value && !std::is_scalar<T>::value,
int>::type
_net_binnary_search(
const containterT<T, Allocator> &container,
int index,
int count, T value)
96 int f = index + count - 1;
101 m = s + ((f - s) / 2);
103 c = value.CompareTo(container[m]);
128template<
template<
typename,
typename>
class containterT,
class T,
class Allocator>
129typename std::enable_if<std::is_scalar<T>::value,
int>::type
_net_binnary_search(
const containterT<T, Allocator> &container,
int index,
int count, T value)
132 int f = index + count - 1;
137 m = s + ((f - s) / 2);
139 if (value < container[m]) {
142 else if (value > container[m]) {
Interface that compares two objects in greater-equal-less sense. Objects of this class should only be...
Definition: icomparer.h:20
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
int _net_binnary_search(const containterT< T, Allocator > &container, int index, int count, T value, const SharedPtr< System::Collections::Generic::IComparer< T > > &comparer)
Implements binary search in random access container.
Definition: algorithms.h:23
Definition: db_command.h:9