diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-13 18:37:41 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-10-13 18:37:41 -0700 |
| commit | e17de99599a2f114faab1bb4821fbaad4d266c95 (patch) | |
| tree | 397fec8a85af3ef002c125ce013eceb60d27116d /toolsrc/include/SortedVector.h | |
| parent | 1fb5313a881fe0fcfd90dff5255045c8367ee00b (diff) | |
| download | vcpkg-e17de99599a2f114faab1bb4821fbaad4d266c95.tar.gz vcpkg-e17de99599a2f114faab1bb4821fbaad4d266c95.zip | |
[vcpkg] Re-layout all files using new organization scheme.
All filenames and directories are lowercase. Use dots for namespace separation.
Diffstat (limited to 'toolsrc/include/SortedVector.h')
| -rw-r--r-- | toolsrc/include/SortedVector.h | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/toolsrc/include/SortedVector.h b/toolsrc/include/SortedVector.h deleted file mode 100644 index 62808cc2f..000000000 --- a/toolsrc/include/SortedVector.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include <algorithm> -#include <vector> - -// Add more forwarding functions to the m_data std::vector as needed. -namespace vcpkg -{ - template<class T> - class SortedVector - { - public: - 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())) - { - std::sort(m_data.begin(), m_data.end()); - } - } - - template<class Compare> - SortedVector(std::vector<T> v, Compare comp) : m_data(std::move(v)) - { - if (!std::is_sorted(m_data.cbegin(), m_data.cend(), comp)) - { - std::sort(m_data.begin(), m_data.end(), comp); - } - } - - iterator begin() const { return this->m_data.cbegin(); } - - iterator end() const { return this->m_data.cend(); } - - iterator cbegin() const { return this->m_data.cbegin(); } - - iterator cend() const { return this->m_data.cend(); } - - bool empty() const { return this->m_data.empty(); } - - size_type size() const { return this->m_data.size(); } - - private: - std::vector<T> m_data; - }; -} |
