From 2fb3af42a898c7804985c779888c1ab4b907b600 Mon Sep 17 00:00:00 2001 From: Meyer Zinn Date: Sun, 21 Apr 2024 22:10:53 +0000 Subject: [PATCH] remove unused methods of LargeVector --- libgalois/include/galois/LargeVector.h | 43 +++----------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/libgalois/include/galois/LargeVector.h b/libgalois/include/galois/LargeVector.h index 53ed33cfd..c5a408121 100644 --- a/libgalois/include/galois/LargeVector.h +++ b/libgalois/include/galois/LargeVector.h @@ -24,6 +24,10 @@ namespace galois { * 2. All iterator methods (e.g. increment) preserve generation. * 3. It is undefined behavior to compare iterators across generations. * 4. Decreasing the container size invalidates some iterators. + * + * Note also that, like LargeArray, this class does not call constructors or + * destructors for elements. If you need to call constructors or destructors, + * you can use placement new and explicit destructor calls. */ template class LargeVector : public boost::noncopyable { @@ -120,25 +124,8 @@ class LargeVector : public boost::noncopyable { uint64_t size() const noexcept { return m_size; } - template - T& emplace_back(Args&&... args) { - if (m_size == m_capacity) { - ensure_capacity(m_size + 1); - } - return *new (m_data + m_size++) T(std::forward(args)...); - } - - T& push_back(const T& t) { return emplace_back(t); } - - T& push_back(T&& t) { return emplace_back(std::move(t)); } - T& operator[](size_t index) const { return m_data[index]; } - void pop_back() { - assert(m_size > 0); - m_data[--m_size].~T(); - } - /** * Note: unlike std::vector, resize does not call constructors or * destructors. @@ -163,26 +150,4 @@ class LargeVector : public boost::noncopyable { }; // namespace galois -namespace std { -template -ostream& operator<<(std::ostream& os, const galois::LargeVector& vec) { - for (uint64_t i = 0; i < vec.getSize(); i++) { - os << vec[i]; - if (i < vec.getSize() - 1) { - os << " "; - } - } - return os; -} - -template -istream& operator>>(istream& is, galois::LargeVector& vec) { - T value; - while (is >> value) { - vec.push_back(value); - } - return is; -} -} // namespace std - #endif