Skip to content

Commit 73dc841

Browse files
committed
refactor: Remove unused push_back functionality from vectorn
Signed-off-by: Sietze van Buuren <[email protected]>
1 parent 8ef10e6 commit 73dc841

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

src/vectorn.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,6 @@ class VectorN {
115115
return mdspan(std::forward<IndexArray>(indices));
116116
}
117117

118-
void push_back(const T& value) {
119-
if (current_index >= data_.capacity()) {
120-
throw std::out_of_range("Exceeded allocated size for VectorN");
121-
}
122-
data_[current_index++] = value;
123-
}
124-
125-
void push_back(T&& value) {
126-
if (current_index >= data_.capacity()) {
127-
throw std::out_of_range("Exceeded allocated size for VectorN");
128-
}
129-
data_[current_index++] = std::move(value);
130-
}
131-
132118
template <typename... Args>
133119
void emplace_back(Args... args) {
134120
if (current_index >= data_.capacity()) {

tests/test_vectorn.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,6 @@ TEST(TestVectorNMdspan, test_vectorn_mdspan)
143143
}
144144

145145

146-
TEST(TestVectorPushBack, test_vector_push_back)
147-
{
148-
cip::VectorN<int, 3> vec({2, 3, 4}); // A 3D array with dimensions 2x3x4
149-
int counter = 0;
150-
151-
// Fill the vector
152-
for (size_t i = 0; i < 2; ++i) {
153-
for (size_t j = 0; j < 3; ++j) {
154-
for (size_t k = 0; k < 4; ++k) {
155-
vec.push_back(counter++);
156-
}
157-
}
158-
}
159-
ASSERT_EQ(vec(1, 2, 3), 23);
160-
161-
// Create a submdspan
162-
auto sub = vec.submdspan(std::pair{0, 1}, std::pair{1, 3}, std::pair{0, 2});
163-
ASSERT_EQ(sub(0, 0, 0), 4);
164-
}
165-
166146
TEST(TestVectorEmplaceBack, test_vector_emplace_back)
167147
{
168148

0 commit comments

Comments
 (0)