Fix buggy rebase

Former-commit-id: 6037d1f326116e5aae56be9a73a8f9ca68a45bbe
This commit is contained in:
John Sully 2019-07-18 21:57:17 -04:00
parent 4ec97fdb46
commit 9f42bb5d91

View File

@ -12,24 +12,10 @@
* *
*************************************************/ *************************************************/
<<<<<<< HEAD
<<<<<<< HEAD
template<typename T, bool MEMMOVE_SAFE=false> template<typename T, bool MEMMOVE_SAFE=false>
class compactvector class compactvector
{ {
static_assert(MEMMOVE_SAFE || std::is_trivially_copyable<T>::value, "compactvector requires trivially copyable types"); static_assert(MEMMOVE_SAFE || std::is_trivially_copyable<T>::value, "compactvector requires trivially copyable types");
=======
template<typename T>
class compactvector
{
static_assert(std::is_trivially_copyable<T>::value, "compactvector requires trivially copyable types");
>>>>>>> New expire datastructure and algorithm. Allows us to expire in sublinear time
=======
template<typename T, bool MEMMOVE_SAFE=false>
class compactvector
{
static_assert(MEMMOVE_SAFE || std::is_trivially_copyable<T>::value, "compactvector requires trivially copyable types");
>>>>>>> Initial prototype of EXPIREMEMBER command
T *m_data = nullptr; T *m_data = nullptr;
unsigned m_celem = 0; unsigned m_celem = 0;
unsigned m_max = 0; unsigned m_max = 0;
@ -40,14 +26,7 @@ public:
compactvector() noexcept = default; compactvector() noexcept = default;
~compactvector() noexcept ~compactvector() noexcept
{ {
<<<<<<< HEAD
<<<<<<< HEAD
clear(); // call dtors clear(); // call dtors
=======
>>>>>>> New expire datastructure and algorithm. Allows us to expire in sublinear time
=======
clear(); // call dtors
>>>>>>> Initial prototype of EXPIREMEMBER command
zfree(m_data); zfree(m_data);
} }
@ -99,15 +78,7 @@ public:
assert(idx < m_max); assert(idx < m_max);
where = m_data + idx; where = m_data + idx;
memmove(m_data + idx + 1, m_data + idx, (m_celem - idx)*sizeof(T)); memmove(m_data + idx + 1, m_data + idx, (m_celem - idx)*sizeof(T));
<<<<<<< HEAD
<<<<<<< HEAD
new(m_data + idx) T(std::move(val)); new(m_data + idx) T(std::move(val));
=======
m_data[idx] = val;
>>>>>>> New expire datastructure and algorithm. Allows us to expire in sublinear time
=======
new(m_data + idx) T(std::move(val));
>>>>>>> Initial prototype of EXPIREMEMBER command
++m_celem; ++m_celem;
return where; return where;
} }