formatting

This commit is contained in:
2025-05-22 10:54:02 +02:00
parent 376514606f
commit 9bb25445f5
2 changed files with 5 additions and 7 deletions

View File

@ -113,10 +113,12 @@ template <typename T, size_t Capacity> class StaticVector {
// auto begin() noexcept -> decltype(data_.begin()) { return data_.begin();
// }
const_iterator begin() const noexcept { return data_.begin(); }
iterator end() noexcept { return data_.begin()+current_size; }
const_iterator end() const noexcept { return data_.begin()+current_size; }
iterator end() noexcept { return data_.begin() + current_size; }
const_iterator end() const noexcept { return data_.begin() + current_size; }
const_iterator cbegin() const noexcept { return data_.cbegin(); }
const_iterator cend() const noexcept { return data_.cbegin()+current_size; }
const_iterator cend() const noexcept {
return data_.cbegin() + current_size;
}
void size_check(size_type s) const {
if (s > Capacity) {

View File

@ -8,15 +8,12 @@
#include <sstream>
#include <vector>
using sls::StaticVector;
TEST_CASE("StaticVector is a container") {
REQUIRE(sls::is_container<StaticVector<int, 7>>::value == true);
}
TEST_CASE("Comparing StaticVector containers") {
StaticVector<int, 5> a{0, 1, 2};
StaticVector<int, 5> b{0, 1, 2};
@ -344,4 +341,3 @@ TEST_CASE("StaticVector stream") {
oss << vec;
REQUIRE(oss.str() == "[33, 85667, 2]");
}