SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
small_vector.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <array>
16 #include <type_traits>
17 
18 #if SEQAN3_WITH_CEREAL
19 #include <cereal/types/array.hpp>
20 #endif // SEQAN3_WITH_CEREAL
21 
26 
27 namespace seqan3
28 {
29 
43 template <typename value_type_, size_t capacity_>
45 {
46 private:
48  static constexpr bool is_noexcept = std::is_nothrow_copy_constructible_v<value_type_>;
49 
50 public:
54  using value_type = value_type_;
55  using reference = value_type &;
56  using const_reference = const value_type &;
57  using iterator = value_type *;
58  using const_iterator = value_type const *;
59  using difference_type = ptrdiff_t;
61 
63 
65  // this signals to range-v3 that something is a container :|
66  using allocator_type = void;
68 
72  constexpr small_vector() noexcept = default;
73  constexpr small_vector(small_vector const &) noexcept = default;
74  constexpr small_vector(small_vector &&) noexcept = default;
75  constexpr small_vector & operator=(small_vector const &) noexcept = default;
76  constexpr small_vector & operator=(small_vector &&) noexcept = default;
77  ~small_vector() noexcept = default;
78 
90  explicit constexpr small_vector(std::array<value_type, capacity_> const & array) noexcept(is_noexcept) :
91  data_{array}, sz{capacity_}
92  {}
93 
95  template <size_t capacity2>
96  explicit constexpr small_vector(std::array<value_type, capacity2> const & array) noexcept(is_noexcept) :
97  sz{capacity2}
98  {
99  static_assert(capacity2 <= capacity_, "You can only initialize from array that has smaller or equal capacity.");
100  std::ranges::copy(array, data_.begin());
101  }
103 
115  template <size_t capacity2>
116  explicit constexpr small_vector(value_type const (&array)[capacity2]) noexcept(is_noexcept) :
117  sz{capacity2}
118  {
119  static_assert(capacity2 <= capacity_, "You can only initialize from array that has smaller or equal capacity.");
120  std::ranges::copy(array, data_.begin());
121  }
122 
134  template <typename ...other_value_type>
138  constexpr small_vector(other_value_type... args) noexcept(is_noexcept) :
139  data_{args...}, sz{sizeof...(other_value_type)}
140  {
141  static_assert(sizeof...(other_value_type) <= capacity_, "Value list must not exceed the capacity.");
142  }
143 
159  template <std::forward_iterator begin_it_type, typename end_it_type>
161  requires std::sentinel_for<end_it_type, begin_it_type> &&
162  std::constructible_from<value_type, /*ranges::iter_reference_t*/reference_t<begin_it_type>>
164  constexpr small_vector(begin_it_type begin_it, end_it_type end_it) noexcept(is_noexcept) :
165  small_vector{}
166  {
167  assign(begin_it, end_it);
168  }
169 
183  template <std::ranges::input_range other_range_t>
185  requires !std::is_same_v<remove_cvref_t<other_range_t>, small_vector>
186  /*ICE: && std::constructible_from<value_type, reference_t<other_range_t>>*/
188  explicit constexpr small_vector(other_range_t && range) noexcept(is_noexcept) :
189  small_vector{std::ranges::begin(range), std::ranges::end(range)}
190  {}
191 
204  constexpr small_vector(size_type n, value_type value) noexcept(is_noexcept) :
205  small_vector{}
206  {
207  assign(n, value);
208  }
209 
221  constexpr small_vector & operator=(std::initializer_list<value_type> ilist) noexcept(is_noexcept)
222  {
223  assign(std::ranges::begin(ilist), std::ranges::end(ilist));
224  return *this;
225  }
226 
238  constexpr void assign(std::initializer_list<value_type> ilist) noexcept(is_noexcept)
239  {
240  assign(std::ranges::begin(ilist), std::ranges::end(ilist));
241  }
242 
255  constexpr void assign(size_type const count, value_type const value) noexcept(is_noexcept)
256  {
257  clear();
258  auto tmp = views::repeat_n(value, count);
259  assign(std::ranges::begin(tmp), std::ranges::end(tmp));
260  }
261 
275  template <std::ranges::input_range other_range_t>
277  requires std::constructible_from<value_type, /*ranges::range_reference_t*/reference_t<other_range_t>>
279  constexpr void assign(other_range_t && range) noexcept(is_noexcept)
280  {
281  assign(std::ranges::begin(range), std::ranges::end(range));
282  }
283 
299  template <std::forward_iterator begin_it_type, typename end_it_type>
301  requires std::sentinel_for<end_it_type, begin_it_type> &&
304  constexpr void assign(begin_it_type begin_it, end_it_type end_it) noexcept(is_noexcept)
305  {
306  clear();
307  insert(cbegin(), begin_it, end_it);
308  }
310 
314  constexpr iterator begin() noexcept
316  {
317  return &data_[0];
318  }
319 
321  constexpr const_iterator begin() const noexcept
322  {
323  return &data_[0];
324  }
325 
327  constexpr const_iterator cbegin() const noexcept
328  {
329  return &data_[0];
330  }
331 
333  constexpr iterator end() noexcept
334  {
335  return &data_[sz];
336  }
337 
339  constexpr const_iterator end() const noexcept
340  {
341  return &data_[sz];
342  }
343 
345  constexpr const_iterator cend() const noexcept
346  {
347  return &data_[sz];
348  }
350 
370  {
371  if (i >= size()) // [[unlikely]]
372  {
373  throw std::out_of_range{"Trying to access element behind the last in small_vector."};
374  }
375  return (*this)[i];
376  }
377 
379  const_reference at(size_type const i) const
380  {
381  if (i >= size()) // [[unlikely]]
382  {
383  throw std::out_of_range{"Trying to access element behind the last in small_vector."};
384  }
385  return (*this)[i];
386  }
387 
403  constexpr reference operator[](size_type const i) noexcept
404  {
405  assert(i < size());
406  return data_[i];
407  }
408 
410  constexpr const_reference operator[](size_type const i) const noexcept
411  {
412  assert(i < size());
413  return data_[i];
414  }
415 
429  constexpr reference front() noexcept
430  {
431  assert(size() > 0);
432  return (*this)[0];
433  }
434 
436  constexpr const_reference front() const noexcept
437  {
438  assert(size() > 0);
439  return (*this)[0];
440  }
441 
455  constexpr reference back() noexcept
456  {
457  assert(size() > 0);
458  return (*this)[size()-1];
459  }
460 
462  constexpr const_reference back() const noexcept
463  {
464  assert(size() > 0);
465  return (*this)[size()-1];
466  }
467 
469  constexpr value_type * data() noexcept
470  {
471  return data_.data();
472  }
473 
475  constexpr value_type const * data() const noexcept
476  {
477  return data_.data();
478  }
480 
495  constexpr bool empty() const noexcept
496  {
497  return size() == 0;
498  }
499 
511  constexpr size_type size() const noexcept
512  {
513  return sz;
514  }
515 
530  constexpr size_type max_size() const noexcept
531  {
532  return capacity_;
533  }
534 
546  constexpr size_type capacity() const noexcept
547  {
548  return capacity_;
549  }
550 
552  constexpr void reserve(size_type) const noexcept
553  {
554  // no-op
555  }
556 
558  constexpr void shrink_to_fit() const noexcept
559  {
560  // no-op
561  }
563 
577  constexpr void clear() noexcept
578  {
579  sz = 0;
580  }
581 
597  constexpr iterator insert(const_iterator pos, value_type const value) noexcept(is_noexcept)
598  {
599  return insert(pos, 1, value);
600  }
601 
618  constexpr iterator insert(const_iterator pos, size_type const count, value_type const value) noexcept(is_noexcept)
619  {
620  auto tmp = views::repeat_n(value, count);
621  return insert(pos, std::ranges::begin(tmp), std::ranges::end(tmp));
622  }
623 
644  template <std::forward_iterator begin_it_type, typename end_it_type>
646  requires std::sentinel_for<end_it_type, begin_it_type> &&
649  constexpr iterator insert(const_iterator pos, begin_it_type begin_it, end_it_type end_it) noexcept(is_noexcept)
650  {
651  auto const pos_as_num = std::ranges::distance(cbegin(), pos);
652  auto const length = std::ranges::distance(begin_it, end_it);
653 
654  assert(pos_as_num + length <= capacity());
655 
656  if (length == 0)
657  return begin(); // nothing to insert
658 
659  for (size_type i = sz + length - 1; i > pos_as_num + length - 1; --i)
660  data_[i] = data_[i - length];
661 
662  std::ranges::copy(begin_it, end_it, &data_[pos_as_num]);
663  sz += length;
664  return begin() + pos_as_num;
665  }
666 
682  constexpr iterator insert(const_iterator pos, std::initializer_list<value_type> const & ilist) noexcept(is_noexcept)
683  {
684  return insert(pos, ilist.begin(), ilist.end());
685  }
686 
705  constexpr iterator erase(const_iterator begin_it, const_iterator end_it) noexcept
706  {
707  if (begin_it >= end_it) // [[unlikely]]
708  return begin() + std::ranges::distance(cbegin(), end_it);
709 
710  size_type const length = std::ranges::distance(begin_it, end_it);
711  auto out_it = begin() + std::ranges::distance(cbegin(), begin_it);
712 
713  while (end_it != cend())
714  *(out_it++) = *(end_it++);
715 
716  sz -= length;
717  return begin() + std::ranges::distance(cbegin(), begin_it);
718  }
719 
738  constexpr iterator erase(const_iterator pos) noexcept
739  {
740  return erase(pos, pos + 1);
741  }
742 
756  constexpr void push_back(value_type const value) noexcept
757  {
758  assert(sz < capacity_);
759  data_[sz] = value;
760  ++sz;
761  }
762 
777  constexpr void pop_back() noexcept
778  {
779  assert(sz > 0);
780  --sz;
781  }
782 
796  constexpr void resize(size_type const count) noexcept
797  {
798  assert(count <= capacity_);
799  sz = count;
800  }
801 
806  constexpr void resize(size_type const count, value_type const value) noexcept
807  {
808  assert(count <= capacity_);
809  for (size_t i = sz; i < count; ++i)
810  data_[i] = value;
811  sz = count;
812  }
813 
825  constexpr void swap(small_vector & rhs) noexcept(is_noexcept)
826  {
827  auto tmp = *this;
828 
829  data_ = rhs.data_;
830  sz = rhs.sz;
831 
832  rhs.data_ = tmp.data_;
833  rhs.sz = tmp.sz;
834  }
835 
837  constexpr void swap(small_vector && rhs) noexcept(is_noexcept)
838  {
839  data_ = rhs.data_;
840  sz = rhs.sz;
841  }
843 
856  friend constexpr void swap(small_vector & lhs, small_vector & rhs) noexcept(is_noexcept)
857  {
858  lhs.swap(rhs);
859  }
860 
862  friend constexpr void swap(small_vector && lhs, small_vector && rhs) noexcept(is_noexcept)
863  {
864  lhs.swap(rhs);
865  }
866 
869 
871  template <size_t cap2>
873  requires cap2 <= capacity_ /* resolves ambiguousness when comparing two small_vectors of unequal capacity */
875  friend constexpr bool operator==(small_vector const & lhs, small_vector<value_type, cap2> const & rhs) noexcept
876  {
877  return std::ranges::equal(lhs, rhs);
878  }
879 
881  template <size_t cap2>
883  requires cap2 <= capacity_
885  friend constexpr bool operator!=(small_vector const & lhs, small_vector<value_type, cap2> const & rhs) noexcept
886  {
887  return !(lhs == rhs);
888  }
889 
891  template <size_t cap2>
893  requires cap2 <= capacity_
895  friend constexpr bool operator<(small_vector const & lhs, small_vector<value_type, cap2> const & rhs) noexcept
896  {
897  for (size_t i = 0; i < std::min(lhs.size(), rhs.size()); ++i)
898  if (lhs[i] > rhs[i])
899  return false;
900  else if (lhs[i] < rhs[i])
901  return true;
902  return lhs.size() < rhs.size();
903  }
904 
906  template <size_t cap2>
908  requires cap2 <= capacity_
910  friend constexpr bool operator>(small_vector const & lhs, small_vector<value_type, cap2> const & rhs) noexcept
911  {
912  for (size_t i = 0; i < std::min(lhs.size(), rhs.size()); ++i)
913  if (lhs[i] < rhs[i])
914  return false;
915  else if (lhs[i] > rhs[i])
916  return true;
917  return lhs.size() > rhs.size();
918  }
919 
921  template <size_t cap2>
923  requires cap2 <= capacity_
925  friend constexpr bool operator<=(small_vector const & lhs, small_vector<value_type, cap2> const & rhs) noexcept
926  {
927  return !(lhs > rhs);
928  }
929 
931  template <size_t cap2>
933  requires cap2 <= capacity_
935  friend constexpr bool operator>=(small_vector const & lhs, small_vector<value_type, cap2> const & rhs) noexcept
936  {
937  return !(lhs < rhs);
938  }
940 
941 protected:
943 
947  size_type sz{0};
948 
949 public:
951 
957  template <cereal_archive archive_t>
958  void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
959  {
960  archive(data_);
961  archive(sz);
962  }
964 };
965 
970 template <size_t capacity2, typename value_type>
972 small_vector(const value_type (&array)[capacity2]) -> small_vector<value_type, capacity2>;
974 
975 } // namespace seqan3
seqan3::small_vector::erase
constexpr iterator erase(const_iterator begin_it, const_iterator end_it) noexcept
Removes specified elements from the container.
Definition: small_vector.hpp:705
seqan3::small_vector::size
constexpr size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition: small_vector.hpp:511
seqan3::small_vector
A constexpr vector implementation with dynamic size at compile time.
Definition: small_vector.hpp:44
seqan3::small_vector::operator[]
constexpr const_reference operator[](size_type const i) const noexcept
Return the i-th element.
Definition: small_vector.hpp:410
seqan3::small_vector::insert
constexpr iterator insert(const_iterator pos, value_type const value) noexcept(is_noexcept)
Inserts value before position in the container.
Definition: small_vector.hpp:597
seqan3::small_vector
small_vector(const value_type(&array)[capacity2]) -> small_vector< value_type, capacity2 >
Deducts the size and value type from an built-in array on construction.
seqan3::small_vector::begin
constexpr const_iterator begin() const noexcept
Returns the begin to the string.
Definition: small_vector.hpp:321
seqan3::small_vector::operator=
constexpr small_vector & operator=(std::initializer_list< value_type > ilist) noexcept(is_noexcept)
Assign from std::initializer_list.
Definition: small_vector.hpp:221
seqan3::small_vector::pop_back
constexpr void pop_back() noexcept
Removes the last element of the container.
Definition: small_vector.hpp:777
constructible_from
The std::constructible_from concept specifies that a variable of type T can be initialized with the g...
seqan3::small_vector::operator==
constexpr friend bool operator==(small_vector const &lhs, small_vector< value_type, cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_vector.hpp:875
seqan3::small_vector::end
constexpr const_iterator end() const noexcept
Returns iterator past the end of the vector.
Definition: small_vector.hpp:339
seqan3::reference_t
typename reference< t >::type reference_t
Shortcut for seqan3::reference (transformation_trait shortcut).
Definition: pre.hpp:77
seqan3::small_vector::cend
constexpr const_iterator cend() const noexcept
Returns iterator past the end of the vector.
Definition: small_vector.hpp:345
seqan3::small_vector::operator<
constexpr friend bool operator<(small_vector const &lhs, small_vector< value_type, cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_vector.hpp:895
seqan3::small_vector::at
const_reference at(size_type const i) const
Return the i-th element.
Definition: small_vector.hpp:379
template_inspection.hpp
Provides seqan3::type_list and auxiliary type traits.
seqan3::small_vector< char, capacity_+1 >::iterator
value_type * iterator
The iterator type.
Definition: small_vector.hpp:57
seqan3::small_vector::data
constexpr value_type * data() noexcept
Direct access to the underlying array.
Definition: small_vector.hpp:469
seqan3::small_vector::swap
constexpr void swap(small_vector &rhs) noexcept(is_noexcept)
Swap contents with another instance.
Definition: small_vector.hpp:825
seqan3::small_vector::resize
constexpr void resize(size_type const count) noexcept
Resizes the container to contain count elements.
Definition: small_vector.hpp:796
seqan3::small_vector::resize
constexpr void resize(size_type const count, value_type const value) noexcept
Resizes the container to contain count elements.
Definition: small_vector.hpp:806
seqan3::small_vector::insert
constexpr iterator insert(const_iterator pos, std::initializer_list< value_type > const &ilist) noexcept(is_noexcept)
Inserts elements from initializer list before position in the container.
Definition: small_vector.hpp:682
seqan3::small_vector::push_back
constexpr void push_back(value_type const value) noexcept
Appends the given element value to the end of the container.
Definition: small_vector.hpp:756
seqan3::small_vector::assign
constexpr void assign(other_range_t &&range) noexcept(is_noexcept)
Assign from a different range.
Definition: small_vector.hpp:279
seqan3::small_vector::end
constexpr iterator end() noexcept
Returns iterator past the end of the vector.
Definition: small_vector.hpp:333
seqan3::small_vector::small_vector
constexpr small_vector() noexcept=default
Defaulted.
seqan3::small_vector::capacity
constexpr size_type capacity() const noexcept
Returns the number of elements that the container is able to hold and resolves to capacity_.
Definition: small_vector.hpp:546
seqan3::small_vector::reserve
constexpr void reserve(size_type) const noexcept
Since the capacity is fixed on compile time, this is a no-op.
Definition: small_vector.hpp:552
same_as
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type.
seqan3::small_vector::operator!=
constexpr friend bool operator!=(small_vector const &lhs, small_vector< value_type, cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_vector.hpp:885
seqan3::small_vector::small_vector
constexpr small_vector(value_type const (&array)[capacity2]) noexcept(is_noexcept)
Construct from a (smaller or equally sized) built in array over the same value type.
Definition: small_vector.hpp:116
seqan3::small_vector::swap
constexpr void swap(small_vector &&rhs) noexcept(is_noexcept)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: small_vector.hpp:837
repeat_n.hpp
Provides seqan3::views::repeat_n.
seqan3::small_vector::begin
constexpr iterator begin() noexcept
Returns the begin to the string.
Definition: small_vector.hpp:315
seqan3::small_vector::insert
constexpr iterator insert(const_iterator pos, begin_it_type begin_it, end_it_type end_it) noexcept(is_noexcept)
Inserts elements from range [begin_it, end_it) before position in the container.
Definition: small_vector.hpp:649
array
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
seqan3::small_vector::small_vector
constexpr small_vector(begin_it_type begin_it, end_it_type end_it) noexcept(is_noexcept)
Construct from two iterators.
Definition: small_vector.hpp:164
seqan3::small_vector::swap
constexpr friend void swap(small_vector &lhs, small_vector &rhs) noexcept(is_noexcept)
Swap contents with another instance.
Definition: small_vector.hpp:856
seqan3::small_vector::operator[]
constexpr reference operator[](size_type const i) noexcept
Return the i-th element.
Definition: small_vector.hpp:403
seqan3::small_vector::small_vector
constexpr small_vector(size_type n, value_type value) noexcept(is_noexcept)
Construct with n times value.
Definition: small_vector.hpp:204
seqan3::small_vector< char, capacity_+1 >::difference_type
ptrdiff_t difference_type
The difference_type type.
Definition: small_vector.hpp:59
seqan3::small_vector::back
constexpr const_reference back() const noexcept
Return the last element.
Definition: small_vector.hpp:462
seqan3::small_vector::cbegin
constexpr const_iterator cbegin() const noexcept
Returns the begin to the string.
Definition: small_vector.hpp:327
seqan3::small_vector::assign
constexpr void assign(size_type const count, value_type const value) noexcept(is_noexcept)
Assign with count times value.
Definition: small_vector.hpp:255
seqan3::small_vector::shrink_to_fit
constexpr void shrink_to_fit() const noexcept
Since the capacity is fixed on compile time, this is a no-op.
Definition: small_vector.hpp:558
seqan3::small_vector::operator>
constexpr friend bool operator>(small_vector const &lhs, small_vector< value_type, cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_vector.hpp:910
std::min
T min(T... args)
seqan3::small_vector::at
reference at(size_type const i)
Return the i-th element.
Definition: small_vector.hpp:369
seqan3::small_vector< char, capacity_+1 >::const_reference
const value_type & const_reference
The const_reference type.
Definition: small_vector.hpp:56
seqan3::small_vector::swap
constexpr friend void swap(small_vector &&lhs, small_vector &&rhs) noexcept(is_noexcept)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: small_vector.hpp:862
seqan3::small_vector::erase
constexpr iterator erase(const_iterator pos) noexcept
Removes specified elements from the container.
Definition: small_vector.hpp:738
seqan3::small_vector::size_type
detail::min_viable_uint_t< capacity_ > size_type
The size_type type.
Definition: small_vector.hpp:60
int_types.hpp
Provides metaprogramming utilities for integer types.
seqan3::small_vector::empty
constexpr bool empty() const noexcept
Checks whether the container is empty.
Definition: small_vector.hpp:495
std::array::begin
T begin(T... args)
std
SeqAn specific customisations in the standard namespace.
seqan3::small_vector::assign
constexpr void assign(std::initializer_list< value_type > ilist) noexcept(is_noexcept)
Assign from std::initializer_list.
Definition: small_vector.hpp:238
seqan3::small_vector::front
constexpr const_reference front() const noexcept
Return the first element. Calling front on an empty container is undefined.
Definition: small_vector.hpp:436
std::out_of_range
seqan3::small_vector::max_size
constexpr size_type max_size() const noexcept
Returns the maximum number of elements the container is able to hold and resolves to capacity_.
Definition: small_vector.hpp:530
cereal.hpp
Adaptions of concepts from the Cereal library.
seqan3::small_vector< char, capacity_+1 >::reference
value_type & reference
The reference type.
Definition: small_vector.hpp:55
seqan3::views::repeat_n
constexpr auto repeat_n
A view factory that repeats a given value n times.
Definition: repeat_n.hpp:94
seqan3::small_vector< char, capacity_+1 >::value_type
char value_type
The value_type type.
Definition: small_vector.hpp:54
seqan3::small_vector::assign
constexpr void assign(begin_it_type begin_it, end_it_type end_it) noexcept(is_noexcept)
Assign from pair of iterators.
Definition: small_vector.hpp:304
std::conditional_t
seqan3::small_vector::insert
constexpr iterator insert(const_iterator pos, size_type const count, value_type const value) noexcept(is_noexcept)
Inserts count copies of value before position in the container.
Definition: small_vector.hpp:618
seqan3::small_vector::operator>=
constexpr friend bool operator>=(small_vector const &lhs, small_vector< value_type, cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_vector.hpp:935
seqan3::small_vector::data
constexpr const value_type * data() const noexcept
Direct access to the underlying array.
Definition: small_vector.hpp:475
std::array::data
T data(T... args)
seqan3::small_vector::back
constexpr reference back() noexcept
Return the last element.
Definition: small_vector.hpp:455
seqan3::small_vector::operator<=
constexpr friend bool operator<=(small_vector const &lhs, small_vector< value_type, cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_vector.hpp:925
seqan3::small_vector::small_vector
constexpr small_vector(other_range_t &&range) noexcept(is_noexcept)
Construct from a different range.
Definition: small_vector.hpp:188
seqan3::pack_traits::count
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition: traits.hpp:134
seqan3::small_vector::front
constexpr reference front() noexcept
Return the first element. Calling front on an empty container is undefined.
Definition: small_vector.hpp:429
seqan3::small_vector::clear
constexpr void clear() noexcept
Removes all elements from the container.
Definition: small_vector.hpp:577
std::initializer_list
seqan3::small_vector< char, capacity_+1 >::const_iterator
value_type const * const_iterator
The const_iterator type.
Definition: small_vector.hpp:58