mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 07:47:12 +02:00
formatting
This commit is contained in:
@ -113,10 +113,12 @@ template <typename T, size_t Capacity> class StaticVector {
|
|||||||
// auto begin() noexcept -> decltype(data_.begin()) { return data_.begin();
|
// auto begin() noexcept -> decltype(data_.begin()) { return data_.begin();
|
||||||
// }
|
// }
|
||||||
const_iterator begin() const noexcept { return data_.begin(); }
|
const_iterator begin() const noexcept { return data_.begin(); }
|
||||||
iterator end() 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 end() const noexcept { return data_.begin() + current_size; }
|
||||||
const_iterator cbegin() const noexcept { return data_.cbegin(); }
|
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 {
|
void size_check(size_type s) const {
|
||||||
if (s > Capacity) {
|
if (s > Capacity) {
|
||||||
|
@ -8,15 +8,12 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
using sls::StaticVector;
|
using sls::StaticVector;
|
||||||
|
|
||||||
TEST_CASE("StaticVector is a container") {
|
TEST_CASE("StaticVector is a container") {
|
||||||
REQUIRE(sls::is_container<StaticVector<int, 7>>::value == true);
|
REQUIRE(sls::is_container<StaticVector<int, 7>>::value == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Comparing StaticVector containers") {
|
TEST_CASE("Comparing StaticVector containers") {
|
||||||
StaticVector<int, 5> a{0, 1, 2};
|
StaticVector<int, 5> a{0, 1, 2};
|
||||||
StaticVector<int, 5> b{0, 1, 2};
|
StaticVector<int, 5> b{0, 1, 2};
|
||||||
@ -344,4 +341,3 @@ TEST_CASE("StaticVector stream") {
|
|||||||
oss << vec;
|
oss << vec;
|
||||||
REQUIRE(oss.str() == "[33, 85667, 2]");
|
REQUIRE(oss.str() == "[33, 85667, 2]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user