[SortedVector] Add default constructor

This commit is contained in:
Alexander Karatarakis 2017-04-03 16:36:07 -07:00
parent eeb87e1051
commit 69bfe5d0ee

View File

@ -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))
{