Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using of qualified eastl functions. #407

Merged
merged 1 commit into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions include/EASTL/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2922,7 +2922,7 @@ namespace eastl
if(count <= 0)
return first;
else if(count == 1)
return find(first, last, value);
return eastl::find(first, last, value);
else if(last > first)
{
RandomAccessIterator lookAhead;
Expand Down Expand Up @@ -3758,7 +3758,7 @@ namespace eastl
{
typedef typename eastl::iterator_traits<BidirectionalIterator>::value_type value_type;

return next_permutation(first, last, eastl::less<value_type>());
return eastl::next_permutation(first, last, eastl::less<value_type>());
}


Expand Down Expand Up @@ -4061,12 +4061,6 @@ namespace eastl
///
/// http://en.cppreference.com/w/cpp/algorithm/clamp
///
template <class T>
EA_CONSTEXPR const T& clamp(const T& v, const T& lo, const T& hi)
{
return clamp(v, lo, hi, eastl::less<>());
}

template <class T, class Compare>
EA_CONSTEXPR const T& clamp(const T& v, const T& lo, const T& hi, Compare comp)
{
Expand All @@ -4075,6 +4069,11 @@ namespace eastl
comp(v, lo) ? lo : comp(hi, v) ? hi : v;
}

template <class T>
EA_CONSTEXPR const T& clamp(const T& v, const T& lo, const T& hi)
{
return eastl::clamp(v, lo, hi, eastl::less<>());
}

} // namespace eastl

Expand Down
8 changes: 4 additions & 4 deletions include/EASTL/bonus/adaptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ namespace eastl
};

template <typename Container>
auto begin(const reverse_wrapper<Container>& w) -> decltype(rbegin(w.mContainer))
auto begin(const reverse_wrapper<Container>& w) -> decltype(eastl::rbegin(w.mContainer))
{
return rbegin(w.mContainer);
return eastl::rbegin(w.mContainer);
}

template <typename Container>
auto end(const reverse_wrapper<Container>& w) -> decltype(rend(w.mContainer))
auto end(const reverse_wrapper<Container>& w) -> decltype(eastl::rend(w.mContainer))
{
return rend(w.mContainer);
return eastl::rend(w.mContainer);
}

template <typename Container>
Expand Down
8 changes: 4 additions & 4 deletions include/EASTL/bonus/tuple_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ class TupleVecImpl<Allocator, index_sequence<Indices...>, Ts...> : public TupleV
{
if (newNumElements > oldNumCapacity)
{
const size_type newCapacity = max(GetNewCapacity(oldNumCapacity), newNumElements);
const size_type newCapacity = eastl::max(GetNewCapacity(oldNumCapacity), newNumElements);

void* ppNewLeaf[sizeof...(Ts)];
pair<void*, size_type> allocation = TupleRecurser<Ts...>::template DoAllocate<allocator_type, 0, index_sequence_type, Ts...>(
Expand Down Expand Up @@ -774,7 +774,7 @@ class TupleVecImpl<Allocator, index_sequence<Indices...>, Ts...> : public TupleV
{
if (newNumElements > oldNumCapacity)
{
const size_type newCapacity = max(GetNewCapacity(oldNumCapacity), newNumElements);
const size_type newCapacity = eastl::max(GetNewCapacity(oldNumCapacity), newNumElements);

void* ppNewLeaf[sizeof...(Ts)];
pair<void*, size_type> allocation = TupleRecurser<Ts...>::template DoAllocate<allocator_type, 0, index_sequence_type, Ts...>(
Expand Down Expand Up @@ -826,7 +826,7 @@ class TupleVecImpl<Allocator, index_sequence<Indices...>, Ts...> : public TupleV
{
if (newNumElements > oldNumCapacity)
{
const size_type newCapacity = max(GetNewCapacity(oldNumCapacity), newNumElements);
const size_type newCapacity = eastl::max(GetNewCapacity(oldNumCapacity), newNumElements);

void* ppNewLeaf[sizeof...(Ts)];
pair<void*, size_type> allocation = TupleRecurser<Ts...>::template DoAllocate<allocator_type, 0, index_sequence_type, Ts...>(
Expand Down Expand Up @@ -880,7 +880,7 @@ class TupleVecImpl<Allocator, index_sequence<Indices...>, Ts...> : public TupleV
{
if (newNumElements > oldNumCapacity)
{
const size_type newCapacity = max(GetNewCapacity(oldNumCapacity), newNumElements);
const size_type newCapacity = eastl::max(GetNewCapacity(oldNumCapacity), newNumElements);

void* ppNewLeaf[sizeof...(Ts)];
pair<void*, size_type> allocation = TupleRecurser<Ts...>::template DoAllocate<allocator_type, 0, index_sequence_type, Ts...>(
Expand Down
2 changes: 1 addition & 1 deletion include/EASTL/internal/functional_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace eastl

template <typename T>
reference_wrapper<T>::reference_wrapper(T &v) EA_NOEXCEPT
: val(addressof(v))
: val(eastl::addressof(v))
{}

template <typename T>
Expand Down
18 changes: 9 additions & 9 deletions include/EASTL/internal/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2701,8 +2701,8 @@ namespace eastl
inline typename hashtable<K, V, A, EK, Eq, H1, H2, H, RP, bC, bM, bU>::insert_return_type
hashtable<K, V, A, EK, Eq, H1, H2, H, RP, bC, bM, bU>::try_emplace(const key_type& key, Args&&... args)
{
return DoInsertValue(has_unique_keys_type(), piecewise_construct, forward_as_tuple(key),
forward_as_tuple(eastl::forward<Args>(args)...));
return DoInsertValue(has_unique_keys_type(), piecewise_construct, eastl::forward_as_tuple(key),
eastl::forward_as_tuple(eastl::forward<Args>(args)...));
}

template <typename K, typename V, typename A, typename EK, typename Eq,
Expand All @@ -2712,8 +2712,8 @@ namespace eastl
inline typename hashtable<K, V, A, EK, Eq, H1, H2, H, RP, bC, bM, bU>::insert_return_type
hashtable<K, V, A, EK, Eq, H1, H2, H, RP, bC, bM, bU>::try_emplace(key_type&& key, Args&&... args)
{
return DoInsertValue(has_unique_keys_type(), piecewise_construct, forward_as_tuple(eastl::move(key)),
forward_as_tuple(eastl::forward<Args>(args)...));
return DoInsertValue(has_unique_keys_type(), piecewise_construct, eastl::forward_as_tuple(eastl::move(key)),
eastl::forward_as_tuple(eastl::forward<Args>(args)...));
}

template <typename K, typename V, typename A, typename EK, typename Eq,
Expand All @@ -2724,7 +2724,7 @@ namespace eastl
{
insert_return_type result = DoInsertValue(
has_unique_keys_type(),
value_type(piecewise_construct, forward_as_tuple(key), forward_as_tuple(eastl::forward<Args>(args)...)));
value_type(piecewise_construct, eastl::forward_as_tuple(key), eastl::forward_as_tuple(eastl::forward<Args>(args)...)));

return DoGetResultIterator(has_unique_keys_type(), result);
}
Expand All @@ -2736,8 +2736,8 @@ namespace eastl
hashtable<K, V, A, EK, Eq, H1, H2, H, RP, bC, bM, bU>::try_emplace(const_iterator, key_type&& key, Args&&... args)
{
insert_return_type result =
DoInsertValue(has_unique_keys_type(), value_type(piecewise_construct, forward_as_tuple(eastl::move(key)),
forward_as_tuple(eastl::forward<Args>(args)...)));
DoInsertValue(has_unique_keys_type(), value_type(piecewise_construct, eastl::forward_as_tuple(eastl::move(key)),
eastl::forward_as_tuple(eastl::forward<Args>(args)...)));

return DoGetResultIterator(has_unique_keys_type(), result);
}
Expand Down Expand Up @@ -2850,7 +2850,7 @@ namespace eastl
auto iter = find(k);
if(iter == end())
{
return insert(value_type(piecewise_construct, forward_as_tuple(k), forward_as_tuple(eastl::forward<M>(obj))));
return insert(value_type(piecewise_construct, eastl::forward_as_tuple(k), eastl::forward_as_tuple(eastl::forward<M>(obj))));
}
else
{
Expand All @@ -2868,7 +2868,7 @@ namespace eastl
auto iter = find(k);
if(iter == end())
{
return insert(value_type(piecewise_construct, forward_as_tuple(eastl::move(k)), forward_as_tuple(eastl::forward<M>(obj))));
return insert(value_type(piecewise_construct, eastl::forward_as_tuple(eastl::move(k)), eastl::forward_as_tuple(eastl::forward<M>(obj))));
}
else
{
Expand Down
16 changes: 8 additions & 8 deletions include/EASTL/internal/red_black_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1105,15 +1105,15 @@ namespace eastl
inline eastl::pair<typename rbtree<K, V, C, A, E, bM, bU>::iterator, bool>
rbtree<K, V, C, A, E, bM, bU>::try_emplace(const key_type& key, Args&&... args)
{
return DoInsertValue(has_unique_keys_type(), piecewise_construct, forward_as_tuple(key), forward_as_tuple(eastl::forward<Args>(args)...));
return DoInsertValue(has_unique_keys_type(), piecewise_construct, eastl::forward_as_tuple(key), eastl::forward_as_tuple(eastl::forward<Args>(args)...));
}

template <typename K, typename V, typename C, typename A, typename E, bool bM, bool bU>
template <class... Args>
inline eastl::pair<typename rbtree<K, V, C, A, E, bM, bU>::iterator, bool>
rbtree<K, V, C, A, E, bM, bU>::try_emplace(key_type&& key, Args&&... args)
{
return DoInsertValue(has_unique_keys_type(), piecewise_construct, forward_as_tuple(eastl::move(key)), forward_as_tuple(eastl::forward<Args>(args)...));
return DoInsertValue(has_unique_keys_type(), piecewise_construct, eastl::forward_as_tuple(eastl::move(key)), eastl::forward_as_tuple(eastl::forward<Args>(args)...));
}

template <typename K, typename V, typename C, typename A, typename E, bool bM, bool bU>
Expand All @@ -1123,7 +1123,7 @@ namespace eastl
{
return DoInsertValueHint(
has_unique_keys_type(), position,
piecewise_construct, forward_as_tuple(key), forward_as_tuple(eastl::forward<Args>(args)...));
piecewise_construct, eastl::forward_as_tuple(key), eastl::forward_as_tuple(eastl::forward<Args>(args)...));
}

template <typename K, typename V, typename C, typename A, typename E, bool bM, bool bU>
Expand All @@ -1133,7 +1133,7 @@ namespace eastl
{
return DoInsertValueHint(
has_unique_keys_type(), position,
piecewise_construct, forward_as_tuple(eastl::move(key)), forward_as_tuple(eastl::forward<Args>(args)...));
piecewise_construct, eastl::forward_as_tuple(eastl::move(key)), eastl::forward_as_tuple(eastl::forward<Args>(args)...));
}


Expand Down Expand Up @@ -1180,7 +1180,7 @@ namespace eastl

if(iter == end())
{
return insert(value_type(piecewise_construct, forward_as_tuple(k), forward_as_tuple(eastl::forward<M>(obj))));
return insert(value_type(piecewise_construct, eastl::forward_as_tuple(k), eastl::forward_as_tuple(eastl::forward<M>(obj))));
}
else
{
Expand All @@ -1198,7 +1198,7 @@ namespace eastl

if(iter == end())
{
return insert(value_type(piecewise_construct, forward_as_tuple(eastl::move(k)), forward_as_tuple(eastl::forward<M>(obj))));
return insert(value_type(piecewise_construct, eastl::forward_as_tuple(eastl::move(k)), eastl::forward_as_tuple(eastl::forward<M>(obj))));
}
else
{
Expand All @@ -1216,7 +1216,7 @@ namespace eastl

if(iter == end())
{
return insert(hint, value_type(piecewise_construct, forward_as_tuple(k), forward_as_tuple(eastl::forward<M>(obj))));
return insert(hint, value_type(piecewise_construct, eastl::forward_as_tuple(k), eastl::forward_as_tuple(eastl::forward<M>(obj))));
}
else
{
Expand All @@ -1234,7 +1234,7 @@ namespace eastl

if(iter == end())
{
return insert(hint, value_type(piecewise_construct, forward_as_tuple(eastl::move(k)), forward_as_tuple(eastl::forward<M>(obj))));
return insert(hint, value_type(piecewise_construct, eastl::forward_as_tuple(eastl::move(k)), eastl::forward_as_tuple(eastl::forward<M>(obj))));
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions include/EASTL/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ namespace eastl
inline void destroy(ForwardIterator first, ForwardIterator last)
{
for (; first != last; ++first)
destroy_at(addressof(*first));
eastl::destroy_at(eastl::addressof(*first));
}


Expand All @@ -1404,7 +1404,7 @@ namespace eastl
ForwardIterator destroy_n(ForwardIterator first, Size n)
{
for (; n > 0; ++first, --n)
destroy_at(addressof(*first));
eastl::destroy_at(eastl::addressof(*first));

return first;
}
Expand Down
2 changes: 1 addition & 1 deletion include/EASTL/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace eastl
inline explicit optional_storage(in_place_t, Args&&... args)
: engaged(true)
{
::new (eastl::addressof(val)) T{std::forward<Args>(args)...};
::new (eastl::addressof(val)) T{eastl::forward<Args>(args)...};
}

template <typename U,
Expand Down
2 changes: 1 addition & 1 deletion include/EASTL/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ namespace eastl

if (lastSortedEnd < 1)
{
lastSortedEnd = is_sorted_until<RandomAccessIterator, StrictWeakOrdering>(first, last, compare) - first;
lastSortedEnd = eastl::is_sorted_until<RandomAccessIterator, StrictWeakOrdering>(first, last, compare) - first;
}

// Sort the region unless lastSortedEnd indicates it is already sorted.
Expand Down
Loading