mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 11:37:12 +01:00
[SortedVector] Add default constructor
This commit is contained in:
parent
eeb87e1051
commit
69bfe5d0ee
@ -13,6 +13,8 @@ namespace vcpkg
|
||||
using size_type = typename std::vector<T>::size_type;
|
||||
using iterator = typename std::vector<T>::const_iterator;
|
||||
|
||||
SortedVector() : m_data() {}
|
||||
|
||||
explicit SortedVector(std::vector<T> v) : m_data(std::move(v))
|
||||
{
|
||||
if (!std::is_sorted(m_data.begin(), m_data.end()))
|
||||
@ -20,6 +22,7 @@ namespace vcpkg
|
||||
std::sort(m_data.begin(), m_data.end());
|
||||
}
|
||||
}
|
||||
|
||||
template <class Compare>
|
||||
SortedVector(std::vector<T> v, Compare comp) : m_data(std::move(v))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user