diff options
author | sobols <[email protected]> | 2022-02-10 16:47:08 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:08 +0300 |
commit | 03335cb18337a0ef51966452a66a69b01abea218 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 /contrib/libs/yaml-cpp/src/ptr_vector.h | |
parent | 09961b69c61f471ddd594e0fd877df62a8021562 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/yaml-cpp/src/ptr_vector.h')
-rw-r--r-- | contrib/libs/yaml-cpp/src/ptr_vector.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/libs/yaml-cpp/src/ptr_vector.h b/contrib/libs/yaml-cpp/src/ptr_vector.h index b4f899035b4..955aebd8d56 100644 --- a/contrib/libs/yaml-cpp/src/ptr_vector.h +++ b/contrib/libs/yaml-cpp/src/ptr_vector.h @@ -16,27 +16,27 @@ namespace YAML { -// TODO: This class is no longer needed +// TODO: This class is no longer needed template <typename T> class ptr_vector : private YAML::noncopyable { public: ptr_vector() {} - void clear() { m_data.clear(); } + void clear() { m_data.clear(); } std::size_t size() const { return m_data.size(); } bool empty() const { return m_data.empty(); } - void push_back(std::unique_ptr<T>&& t) { m_data.push_back(std::move(t)); } + void push_back(std::unique_ptr<T>&& t) { m_data.push_back(std::move(t)); } T& operator[](std::size_t i) { return *m_data[i]; } const T& operator[](std::size_t i) const { return *m_data[i]; } - T& back() { return *(m_data.back().get()); } + T& back() { return *(m_data.back().get()); } + + const T& back() const { return *(m_data.back().get()); } - const T& back() const { return *(m_data.back().get()); } - private: - std::vector<std::unique_ptr<T>> m_data; + std::vector<std::unique_ptr<T>> m_data; }; } |