fixed clear()
This commit is contained in:
parent
9fb3eb0419
commit
a5f5e45fbd
|
|
@ -114,7 +114,7 @@ namespace cc {
|
||||||
[[nodiscard]] constexpr size_type capacity() const noexcept { return _len; }
|
[[nodiscard]] constexpr size_type capacity() const noexcept { return _len; }
|
||||||
[[nodiscard]] constexpr size_type size() const noexcept { return _size; }
|
[[nodiscard]] constexpr size_type size() const noexcept { return _size; }
|
||||||
|
|
||||||
constexpr void clear() { std::fill(begin(), end(), T()); }
|
constexpr void clear();
|
||||||
|
|
||||||
constexpr iterator insert(const_iterator pos, const T& value);
|
constexpr iterator insert(const_iterator pos, const T& value);
|
||||||
constexpr iterator insert(const_iterator pos, T&& value);
|
constexpr iterator insert(const_iterator pos, T&& value);
|
||||||
|
|
@ -386,6 +386,13 @@ namespace cc {
|
||||||
return _arr[pos];
|
return _arr[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, std::size_t N>
|
||||||
|
constexpr void const_vector<T, N>::clear()
|
||||||
|
{
|
||||||
|
std::destroy(begin(), end());
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T, std::size_t N>
|
template<typename T, std::size_t N>
|
||||||
constexpr const_vector<T, N>::iterator const_vector<T, N>::insert(const_vector::const_iterator pos, const T &value)
|
constexpr const_vector<T, N>::iterator const_vector<T, N>::insert(const_vector::const_iterator pos, const T &value)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue