added implementation for non-member definitions for const_list
This commit is contained in:
parent
0ad394b45d
commit
c6cf7bcb37
|
|
@ -219,33 +219,33 @@ namespace cc {
|
||||||
constexpr bool operator==(const const_list<N1, Alloc1>& lhs,
|
constexpr bool operator==(const const_list<N1, Alloc1>& lhs,
|
||||||
const const_list<N2, Alloc2>& rhs)
|
const const_list<N2, Alloc2>& rhs)
|
||||||
{
|
{
|
||||||
|
return lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename N1, typename N2, typename Alloc1, typename Alloc2>
|
template<typename N1, typename N2, typename Alloc1, typename Alloc2>
|
||||||
constexpr auto operator<=>(const const_list<N1, Alloc1>& lhs,
|
constexpr auto operator<=>(const const_list<N1, Alloc1>& lhs,
|
||||||
const const_list<N2, Alloc2>& rhs)
|
const const_list<N2, Alloc2>& rhs)
|
||||||
{
|
{
|
||||||
|
return std::lexicographical_compare_three_way(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename N, typename Alloc>
|
template<typename N, typename Alloc>
|
||||||
constexpr void swap(const const_list<N, Alloc>& lhs,
|
constexpr void swap(const const_list<N, Alloc>& lhs,
|
||||||
const const_list<N, Alloc>& rhs)
|
const const_list<N, Alloc>& rhs)
|
||||||
{
|
{
|
||||||
|
lhs.swap(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename N, typename Alloc>
|
template<typename N, typename Alloc>
|
||||||
constexpr const_list<N>::size_type erase(const_list<N, Alloc>& c, const N& value)
|
constexpr const_list<N, Alloc>::size_type erase(const_list<N, Alloc>& c, const N& value)
|
||||||
{
|
{
|
||||||
|
c.remove(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename N, typename Alloc, typename Pred>
|
template<typename N, typename Alloc, typename Pred>
|
||||||
constexpr const_list<N>::size_type erase(const_list<N, Alloc>& c, Pred pred)
|
constexpr const_list<N, Alloc>::size_type erase(const_list<N, Alloc>& c, Pred pred)
|
||||||
{
|
{
|
||||||
|
c.remove_if(pred);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename N, typename Alloc>
|
template<typename N, typename Alloc>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue