diff options
author | vskipin <vskipin@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
commit | 4d8b546b89b5afc08cf3667e176271c7ba935f33 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/containers/stack_vector/stack_vec.h | |
parent | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (diff) | |
download | ydb-4d8b546b89b5afc08cf3667e176271c7ba935f33.tar.gz |
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/stack_vector/stack_vec.h')
-rw-r--r-- | library/cpp/containers/stack_vector/stack_vec.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/containers/stack_vector/stack_vec.h b/library/cpp/containers/stack_vector/stack_vec.h index 6fe57e2e91..fcc5d9a2a5 100644 --- a/library/cpp/containers/stack_vector/stack_vec.h +++ b/library/cpp/containers/stack_vector/stack_vec.h @@ -135,21 +135,21 @@ public: { } - template <class A> + template <class A> TStackVec(const TVector<T, A>& src) : TStackVec(src.begin(), src.end()) - { - } - + { + } + TStackVec(std::initializer_list<T> il, const TAllocator& alloc = TAllocator()) : TStackVec(il.begin(), il.end(), alloc) - { - } - - template <class TIter> + { + } + + template <class TIter> TStackVec(TIter first, TIter last, const TAllocator& alloc = TAllocator()) : TBase(alloc) - { + { // NB(eeight) Since we want to call 'reserve' here, we cannot just delegate to TVector ctor. // The best way to insert values afterwards is to call TVector::insert. However there is a caveat. // In order to call this ctor of TVector, T needs to be just move-constructible. Insert however @@ -164,27 +164,27 @@ public: TBase::push_back(*first); } } - } - + } + public: void swap(TStackVec&) = delete; void shrink_to_fit() = delete; TStackVec& operator=(const TStackVec& src) { - TBase::assign(src.begin(), src.end()); + TBase::assign(src.begin(), src.end()); return *this; } - - template <class A> + + template <class A> TStackVec& operator=(const TVector<T, A>& src) { - TBase::assign(src.begin(), src.end()); - return *this; - } - + TBase::assign(src.begin(), src.end()); + return *this; + } + TStackVec& operator=(std::initializer_list<T> il) { - TBase::assign(il.begin(), il.end()); - return *this; - } + TBase::assign(il.begin(), il.end()); + return *this; + } }; template <typename T, size_t CountOnStack, class Alloc> |