Bläddra i källkod

FIX: initializer-list contruct size error

master
förälder
incheckning
d4493c2994
2 ändrade filer med 6 tillägg och 1 borttagningar
  1. +1
    -1
      include/cont/deque.h
  2. +5
    -0
      test/tests/deque.cpp

+ 1
- 1
include/cont/deque.h Visa fil

@@ -92,7 +92,7 @@ class deque {
template <typename ...It>
deque(It&& ...it) noexcept :
data_{{std::forward<It>(it)...}},
f(data_.data(), sizeof...(It)),
f(data_.data(), N),
r(data_.data(), sizeof...(It)) { }
deque(const deque&) = delete; //!< No copies


+ 5
- 0
test/tests/deque.cpp Visa fil

@@ -39,9 +39,14 @@ namespace Tdeque {
TEST(Tdeque, contruct) {
deque<int, 8> q1;
deque<int, 8> q2{1, 2, 3, 4, 5, 6, 7, 8};
deque<int, 8> q3{1, 2, 3, 4, 5};
EXPECT_EQ (8UL, q1.capacity());
EXPECT_EQ (0UL, q1.size());
EXPECT_EQ (8UL, q2.capacity());
EXPECT_EQ (8UL, q2.size());
EXPECT_EQ (8UL, q3.capacity());
EXPECT_EQ (5UL, q3.size());
}
// simple push-pop functionality


Laddar…
Avbryt
Spara