Ver código fonte

FIX: initializer-list contruct size error

master
Christos Choutouridis 3 anos atrás
pai
commit
d4493c2994
2 arquivos alterados com 6 adições e 1 exclusões
  1. +1
    -1
      include/cont/deque.h
  2. +5
    -0
      test/tests/deque.cpp

+ 1
- 1
include/cont/deque.h Ver arquivo

@@ -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 Ver arquivo

@@ -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


Carregando…
Cancelar
Salvar