Skip to content

Commit

Permalink
Fix SortedVector constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkaratarakis committed Apr 3, 2017
1 parent 35ccbc8 commit f6840ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toolsrc/include/SortedVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace vcpkg
using size_type = typename std::vector<T>::size_type;
using iterator = typename std::vector<T>::const_iterator;

explicit SortedVector<T>(std::vector<T> v) : m_data(std::move(v))
explicit SortedVector(std::vector<T> v) : m_data(std::move(v))
{
if (!std::is_sorted(m_data.begin(), m_data.end()))
{
std::sort(m_data.begin(), m_data.end());
}
}
template <class Compare>
SortedVector<T>(std::vector<T> v, Compare comp) : m_data(std::move(v))
SortedVector(std::vector<T> v, Compare comp) : m_data(std::move(v))
{
if (!std::is_sorted(m_data.cbegin(), m_data.cend(), comp))
{
Expand Down

0 comments on commit f6840ab

Please sign in to comment.