SeqAn3  3.0.2
The Modern C++ library for sequence analysis.
bitcompressed_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 <type_traits>
16 
17 #include <sdsl/int_vector.hpp>
18 
27 #include <seqan3/std/concepts>
28 #include <seqan3/std/iterator>
29 #include <seqan3/std/ranges>
30 
31 namespace seqan3
32 {
33 
62 template <writable_semialphabet alphabet_type>
67 {
68 private:
70  static constexpr size_t bits_per_letter = std::ceil(std::log2(alphabet_size<alphabet_type>));
71 
72  static_assert(bits_per_letter <= 64, "alphabet must be representable in at most 64bit.");
73 
75  using data_type = sdsl::int_vector<bits_per_letter>;
76 
78  data_type data;
79 
82  class reference_proxy_type : public alphabet_proxy<reference_proxy_type, alphabet_type>
83  {
84  private:
88  friend base_t;
89 
91  reference_t<data_type> internal_proxy;
92 
94  constexpr void on_update() noexcept
95  {
96  internal_proxy = static_cast<base_t &>(*this).to_rank();
97  }
98 
99  public:
100  // Import from base:
101  using base_t::operator=;
102 
106  reference_proxy_type() = delete;
108  constexpr reference_proxy_type(reference_proxy_type const &) noexcept = default;
109  constexpr reference_proxy_type(reference_proxy_type &&) noexcept = default;
110  constexpr reference_proxy_type & operator=(reference_proxy_type const &) noexcept = default;
111  constexpr reference_proxy_type & operator=(reference_proxy_type &&) noexcept = default;
112  ~reference_proxy_type() noexcept = default;
113 
115  reference_proxy_type(reference_t<data_type> const & internal) noexcept :
116  internal_proxy{internal}
117  {
118  static_cast<base_t &>(*this).assign_rank(internal);
119  }
121  };
122 
125  //NOTE(h-2): it is entirely unclear to me why we need this
126  template <typename t>
127  requires std::is_same_v<value_type_t<remove_cvref_t<t>>, alphabet_type>
128  static constexpr bool has_same_value_type_v = true;
130 
131 public:
135  using value_type = alphabet_type;
138  using reference = reference_proxy_type;
140  using const_reference = alphabet_type;
142  using iterator = detail::random_access_iterator<bitcompressed_vector>;
144  using const_iterator = detail::random_access_iterator<bitcompressed_vector const>;
150 
152  // this signals to range-v3 that something is a container :|
153  using allocator_type = void;
155 
159  bitcompressed_vector() = default;
160  constexpr bitcompressed_vector(bitcompressed_vector const &) = default;
161  constexpr bitcompressed_vector(bitcompressed_vector &&) = default;
162  constexpr bitcompressed_vector & operator=(bitcompressed_vector const &) = default;
163  constexpr bitcompressed_vector & operator=(bitcompressed_vector &&) = default;
164  ~bitcompressed_vector() = default;
165 
179  template <std::ranges::input_range other_range_t>
181  requires has_same_value_type_v<other_range_t>
183  explicit bitcompressed_vector(other_range_t && range) :
184  bitcompressed_vector{seqan3::begin(range), seqan3::end(range)}
185  {}
186 
200  data(count, to_rank(value))
201  {}
202 
218  template <std::forward_iterator begin_iterator_type, typename end_iterator_type>
219  bitcompressed_vector(begin_iterator_type begin_it, end_iterator_type end_it)
221  requires std::sentinel_for<end_iterator_type, begin_iterator_type> &&
224  {
225  insert(cend(), begin_it, end_it);
226  }
227 
240  bitcompressed_vector(std::begin(ilist), std::end(ilist))
241  {}
242 
255  {
256  assign(std::begin(ilist), std::end(ilist));
257  return *this;
258  }
259 
273  template <std::ranges::input_range other_range_t>
274  void assign(other_range_t && range)
278  {
279  bitcompressed_vector rhs{std::forward<other_range_t>(range)};
280  swap(rhs);
281  }
282 
295  void assign(size_type const count, value_type const value)
296  {
297  bitcompressed_vector rhs{count, value};
298  swap(rhs);
299  }
300 
316  template <std::forward_iterator begin_iterator_type, typename end_iterator_type>
317  void assign(begin_iterator_type begin_it, end_iterator_type end_it)
319  requires std::sentinel_for<end_iterator_type, begin_iterator_type> &&
322  {
323  bitcompressed_vector rhs{begin_it, end_it};
324  swap(rhs);
325  }
326 
339  {
340  assign(std::begin(ilist), std::end(ilist));
341  }
342 
344 
361  iterator begin() noexcept
362  {
363  return iterator{*this};
364  }
365 
367  const_iterator begin() const noexcept
368  {
369  return const_iterator{*this};
370  }
371 
373  const_iterator cbegin() const noexcept
374  {
375  return const_iterator{*this};
376  }
377 
391  iterator end() noexcept
392  {
393  return iterator{*this, size()};
394  }
395 
397  const_iterator end() const noexcept
398  {
399  return const_iterator{*this, size()};
400  }
401 
403  const_iterator cend() const noexcept
404  {
405  return const_iterator{*this, size()};
406  }
408 
426  {
427  if (i >= size()) // [[unlikely]]
428  {
429  throw std::out_of_range{"Trying to access element behind the last in bitcompressed_vector."};
430  }
431  return (*this)[i];
432  }
433 
435  const_reference at(size_type const i) const
436  {
437  if (i >= size()) // [[unlikely]]
438  {
439  throw std::out_of_range{"Trying to access element behind the last in bitcompressed_vector."};
440  }
441  return (*this)[i];
442  }
443 
459  reference operator[](size_type const i) noexcept
460  {
461  assert(i < size());
462  return data[i];
463  }
464 
466  const_reference operator[](size_type const i) const noexcept
467  {
468  assert(i < size());
469  return assign_rank_to(data[i], const_reference{});
470  }
471 
485  reference front() noexcept
486  {
487  assert(size() > 0);
488  return (*this)[0];
489  }
490 
492  const_reference front() const noexcept
493  {
494  assert(size() > 0);
495  return (*this)[0];
496  }
497 
511  reference back() noexcept
512  {
513  assert(size() > 0);
514  return (*this)[size()-1];
515  }
516 
518  const_reference back() const noexcept
519  {
520  assert(size() > 0);
521  return (*this)[size()-1];
522  }
523 
533  constexpr data_type & raw_data() noexcept
534  {
535  return data;
536  }
537 
539  constexpr data_type const & raw_data() const noexcept
540  {
541  return data;
542  }
544 
559  bool empty() const noexcept
560  {
561  return size() == 0;
562  }
563 
575  size_type size() const noexcept
576  {
577  return data.size();
578  }
579 
594  size_type max_size() const noexcept
595  {
596  return data.max_size();
597  }
598 
614  size_type capacity() const noexcept
615  {
616  return data.capacity();
617  }
618 
637  void reserve(size_type const new_cap)
638  {
639  data.reserve(new_cap);
640  }
641 
658  {
659  data.shrink_to_fit();
660  }
662 
677  void clear() noexcept
678  {
679  data.clear();
680  }
681 
701  {
702  return insert(pos, 1, value);
703  }
704 
725  {
726  auto const pos_as_num = std::distance(cbegin(), pos); // we want to insert BEFORE this position
727 
728  data.insert(data.begin() + pos_as_num, count, to_rank(value));
729 
730  return begin() + pos_as_num;
731  }
732 
757  template <std::forward_iterator begin_iterator_type, typename end_iterator_type>
758  iterator insert(const_iterator pos, begin_iterator_type begin_it, end_iterator_type end_it)
760  requires std::sentinel_for<end_iterator_type, begin_iterator_type> &&
763  {
764  auto const pos_as_num = std::distance(cbegin(), pos);
765 
766  auto v = std::ranges::subrange<begin_iterator_type, end_iterator_type>{begin_it, end_it}
767  | views::convert<value_type>
768  | views::to_rank;
769  data.insert(data.begin() + pos_as_num, seqan3::begin(v), seqan3::end(v));
770 
771  return begin() + pos_as_num;
772  }
773 
793  {
794  return insert(pos, ilist.begin(), ilist.end());
795  }
796 
817  {
818  if (begin_it >= end_it) // [[unlikely]]
819  return begin() + std::distance(cbegin(), end_it);
820 
821  auto const begin_it_pos = std::distance(cbegin(), begin_it);
822  auto const end_it_pos = std::distance(cbegin(), end_it);
823 
824  data.erase(data.cbegin() + begin_it_pos,
825  data.cbegin() + end_it_pos);
826 
827  return begin() + begin_it_pos;
828  }
829 
850  {
851  return erase(pos, pos + 1);
852  }
853 
869  void push_back(value_type const value)
870  {
871  data.push_back(to_rank(value));
872  }
873 
890  void pop_back()
891  {
892  assert(size() > 0);
893  data.pop_back();
894  }
895 
922  void resize(size_type const count)
923  {
924  assert(count < max_size());
925  data.resize(count);
926  }
927 
932  void resize(size_type const count, value_type const value)
933  {
934  assert(count < max_size());
935  data.resize(count, to_rank(value));
936  }
937 
949  constexpr void swap(bitcompressed_vector & rhs) noexcept
950  {
951  std::swap(data, rhs.data);
952  }
953 
955  constexpr void swap(bitcompressed_vector && rhs) noexcept
956  {
957  std::swap(data, rhs.data);
958  }
959 
972  friend constexpr void swap(bitcompressed_vector & lhs, bitcompressed_vector & rhs) noexcept
973  {
974  std::swap(lhs, rhs);
975  }
976 
978  friend constexpr void swap(bitcompressed_vector && lhs, bitcompressed_vector && rhs) noexcept
979  {
980  std::swap(lhs, rhs);
981  }
983 
988  constexpr bool operator==(bitcompressed_vector const & rhs) const noexcept
990  {
991  return data == rhs.data;
992  }
993 
995  constexpr bool operator!=(bitcompressed_vector const & rhs) const noexcept
996  {
997  return data != rhs.data;
998  }
999 
1001  constexpr bool operator<(bitcompressed_vector const & rhs) const noexcept
1002  {
1003  return data < rhs.data;
1004  }
1005 
1007  constexpr bool operator>(bitcompressed_vector const & rhs) const noexcept
1008  {
1009  return data > rhs.data;
1010  }
1011 
1013  constexpr bool operator<=(bitcompressed_vector const & rhs) const noexcept
1014  {
1015  return data <= rhs.data;
1016  }
1017 
1019  constexpr bool operator>=(bitcompressed_vector const & rhs) const noexcept
1020  {
1021  return data >= rhs.data;
1022  }
1024 
1032  template <cereal_archive archive_t>
1033  void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
1034  {
1035  archive(data);
1036  }
1038 };
1039 
1040 } // namespace seqan3
seqan3::bitcompressed_vector::begin
const_iterator begin() const noexcept
Returns an iterator to the first element of the container.
Definition: bitcompressed_vector.hpp:367
seqan3::bitcompressed_vector::front
reference front() noexcept
Return the first element. Calling front on an empty container is undefined.
Definition: bitcompressed_vector.hpp:485
seqan3::difference_type_t
typename difference_type< t >::type difference_type_t
Shortcut for seqan3::difference_type (transformation_trait shortcut).
Definition: pre.hpp:166
seqan3::bitcompressed_vector::insert
iterator insert(const_iterator pos, size_type const count, value_type const value)
Inserts count copies of value before position in the container.
Definition: bitcompressed_vector.hpp:724
seqan3::bitcompressed_vector::operator[]
reference operator[](size_type const i) noexcept
Return the i-th element.
Definition: bitcompressed_vector.hpp:459
shortcuts.hpp
Provides various shortcuts for common std::ranges functions.
seqan3::bitcompressed_vector::cend
const_iterator cend() const noexcept
Returns an iterator to the element following the last element of the container.
Definition: bitcompressed_vector.hpp:403
seqan3::bitcompressed_vector::operator!=
constexpr bool operator!=(bitcompressed_vector const &rhs) const noexcept
Checks whether *this is not equal to rhs.
Definition: bitcompressed_vector.hpp:995
seqan3::assign_rank_to
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:238
seqan3::bitcompressed_vector::swap
constexpr friend void swap(bitcompressed_vector &lhs, bitcompressed_vector &rhs) noexcept
Swap contents with another instance.
Definition: bitcompressed_vector.hpp:972
seqan3::bitcompressed_vector::swap
constexpr void swap(bitcompressed_vector &&rhs) noexcept
Swap contents with another instance.
Definition: bitcompressed_vector.hpp:955
seqan3::bitcompressed_vector::operator[]
const_reference operator[](size_type const i) const noexcept
Return the i-th element.
Definition: bitcompressed_vector.hpp:466
seqan3::bitcompressed_vector::swap
constexpr void swap(bitcompressed_vector &rhs) noexcept
Swap contents with another instance.
Definition: bitcompressed_vector.hpp:949
all.hpp
Provides various type traits.
seqan3::bitcompressed_vector::assign
void assign(other_range_t &&range)
Assign from a different range.
Definition: bitcompressed_vector.hpp:274
seqan3::reference_t
typename reference< t >::type reference_t
Shortcut for seqan3::reference (transformation_trait shortcut).
Definition: pre.hpp:77
seqan3::bitcompressed_vector::operator>
constexpr bool operator>(bitcompressed_vector const &rhs) const noexcept
Checks whether *this is greater than rhs.
Definition: bitcompressed_vector.hpp:1007
seqan3::bitcompressed_vector::pop_back
void pop_back()
Removes the last element of the container.
Definition: bitcompressed_vector.hpp:890
seqan3::bitcompressed_vector::back
reference back() noexcept
Return the last element.
Definition: bitcompressed_vector.hpp:511
iterator
Provides C++20 additions to the <iterator> header.
convert.hpp
Provides seqan3::views::convert.
seqan3::bitcompressed_vector::begin
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: bitcompressed_vector.hpp:361
std::distance
T distance(T... args)
seqan3::size_type_t
typename size_type< t >::type size_type_t
Shortcut for seqan3::size_type (transformation_trait shortcut).
Definition: pre.hpp:195
seqan3::bitcompressed_vector::operator=
bitcompressed_vector & operator=(std::initializer_list< value_type > ilist)
Assign from std::initializer_list.
Definition: bitcompressed_vector.hpp:254
seqan3::to_rank
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:142
seqan3::views::to_rank
const auto to_rank
A view that calls seqan3::to_rank() on each element in the input range.
Definition: to_rank.hpp:67
seqan3::bitcompressed_vector::insert
iterator insert(const_iterator pos, value_type const value)
Inserts value before position in the container.
Definition: bitcompressed_vector.hpp:700
seqan3::bitcompressed_vector::bitcompressed_vector
bitcompressed_vector(std::initializer_list< value_type > ilist)
Construct from std::initializer_list.
Definition: bitcompressed_vector.hpp:239
seqan3::bitcompressed_vector::erase
iterator erase(const_iterator begin_it, const_iterator end_it)
Removes specified elements from the container.
Definition: bitcompressed_vector.hpp:816
seqan3::bitcompressed_vector::end
const_iterator end() const noexcept
Returns an iterator to the element following the last element of the container.
Definition: bitcompressed_vector.hpp:397
seqan3::bitcompressed_vector::operator<=
constexpr bool operator<=(bitcompressed_vector const &rhs) const noexcept
Checks whether *this is less than or equal to rhs.
Definition: bitcompressed_vector.hpp:1013
seqan3::bitcompressed_vector::raw_data
constexpr const data_type & raw_data() const noexcept
Provides direct, unsafe access to underlying data structures.
Definition: bitcompressed_vector.hpp:539
concepts
The Concepts library.
seqan3::bitcompressed_vector::const_reference
alphabet_type const_reference
Equals the alphabet_type / value_type.
Definition: bitcompressed_vector.hpp:140
seqan3::bitcompressed_vector::insert
iterator insert(const_iterator pos, std::initializer_list< value_type > const &ilist)
Inserts elements from initializer list before position in the container.
Definition: bitcompressed_vector.hpp:792
seqan3::bitcompressed_vector::push_back
void push_back(value_type const value)
Appends the given element value to the end of the container.
Definition: bitcompressed_vector.hpp:869
random_access_iterator.hpp
Provides the seqan3::detail::random_access_iterator class.
seqan3::bitcompressed_vector::end
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: bitcompressed_vector.hpp:391
seqan3::bitcompressed_vector::raw_data
constexpr data_type & raw_data() noexcept
Provides direct, unsafe access to underlying data structures.
Definition: bitcompressed_vector.hpp:533
seqan3::bitcompressed_vector::reference
reference_proxy_type reference
A proxy type that enables assignment, if the underlying data structure also provides a proxy.
Definition: bitcompressed_vector.hpp:138
seqan3::bitcompressed_vector::bitcompressed_vector
bitcompressed_vector()=default
Defaulted.
seqan3::bitcompressed_vector::difference_type
difference_type_t< data_type > difference_type
A signed integer type (usually std::ptrdiff_t)
Definition: bitcompressed_vector.hpp:146
alphabet_proxy.hpp
Provides seqan3::alphabet_proxy.
seqan3::bitcompressed_vector::swap
constexpr friend void swap(bitcompressed_vector &&lhs, bitcompressed_vector &&rhs) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: bitcompressed_vector.hpp:978
seqan3::bitcompressed_vector::assign
void assign(begin_iterator_type begin_it, end_iterator_type end_it)
Assign from pair of iterators.
Definition: bitcompressed_vector.hpp:317
common_reference_with
The concept std::common_reference_with<T, U> specifies that two types T and U share a common referenc...
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
seqan3::bitcompressed_vector::~bitcompressed_vector
~bitcompressed_vector()=default
Defaulted.
seqan3::bitcompressed_vector::assign
void assign(std::initializer_list< value_type > ilist)
Assign from std::initializer_list.
Definition: bitcompressed_vector.hpp:338
seqan3::bitcompressed_vector::shrink_to_fit
void shrink_to_fit()
Requests the removal of unused capacity.
Definition: bitcompressed_vector.hpp:657
seqan3::bitcompressed_vector::resize
void resize(size_type const count)
Resizes the container to contain count elements.
Definition: bitcompressed_vector.hpp:922
seqan3::bitcompressed_vector::bitcompressed_vector
bitcompressed_vector(other_range_t &&range)
Construct from a different range.
Definition: bitcompressed_vector.hpp:183
seqan3::bitcompressed_vector::operator=
constexpr bitcompressed_vector & operator=(bitcompressed_vector const &)=default
Defaulted.
seqan3::bitcompressed_vector::bitcompressed_vector
bitcompressed_vector(begin_iterator_type begin_it, end_iterator_type end_it)
Construct from pair of iterators.
Definition: bitcompressed_vector.hpp:219
std::ceil
T ceil(T... args)
seqan3::bitcompressed_vector::operator>=
constexpr bool operator>=(bitcompressed_vector const &rhs) const noexcept
Checks whether *this is greater than or equal to rhs.
Definition: bitcompressed_vector.hpp:1019
seqan3::bitcompressed_vector::bitcompressed_vector
bitcompressed_vector(size_type const count, value_type const value)
Construct with count times value.
Definition: bitcompressed_vector.hpp:199
seqan3::bitcompressed_vector::insert
iterator insert(const_iterator pos, begin_iterator_type begin_it, end_iterator_type end_it)
Inserts elements from range [begin_it, end_it) before position in the container.
Definition: bitcompressed_vector.hpp:758
seqan3::bitcompressed_vector::at
const_reference at(size_type const i) const
Return the i-th element.
Definition: bitcompressed_vector.hpp:435
std::swap
T swap(T... args)
regular
Subsumes std::semiregular and std::equality_comparable.
to_char.hpp
Provides seqan3::views::to_char.
ranges
Adaptations of concepts from the Ranges TS.
seqan3::bitcompressed_vector::operator<
constexpr bool operator<(bitcompressed_vector const &rhs) const noexcept
Checks whether *this is less than rhs.
Definition: bitcompressed_vector.hpp:1001
seqan3::bitcompressed_vector::capacity
size_type capacity() const noexcept
Returns the number of elements that the container has currently allocated space for.
Definition: bitcompressed_vector.hpp:614
seqan3::bitcompressed_vector::back
const_reference back() const noexcept
Return the last element.
Definition: bitcompressed_vector.hpp:518
seqan3::bitcompressed_vector::reserve
void reserve(size_type const new_cap)
Increase the capacity to a value that's greater or equal to new_cap.
Definition: bitcompressed_vector.hpp:637
seqan3::bitcompressed_vector::assign
void assign(size_type const count, value_type const value)
Assign with count times value.
Definition: bitcompressed_vector.hpp:295
std::begin
T begin(T... args)
seqan3::bitcompressed_vector::empty
bool empty() const noexcept
Checks whether the container is empty.
Definition: bitcompressed_vector.hpp:559
std
SeqAn specific customisations in the standard namespace.
seqan3::bitcompressed_vector::operator==
constexpr bool operator==(bitcompressed_vector const &rhs) const noexcept
Checks whether *this is equal to rhs.
Definition: bitcompressed_vector.hpp:989
seqan3::alphabet_proxy::to_rank
constexpr auto to_rank() const noexcept
Returns the rank.
Definition: alphabet_proxy.hpp:219
std::out_of_range
cereal.hpp
Adaptions of concepts from the Cereal library.
seqan3::bitcompressed_vector::iterator
detail::random_access_iterator< bitcompressed_vector > iterator
The iterator type of this container (a random access iterator).
Definition: bitcompressed_vector.hpp:142
std::end
T end(T... args)
seqan3::bitcompressed_vector::const_iterator
detail::random_access_iterator< bitcompressed_vector const > const_iterator
The const_iterator type of this container (a random access iterator).
Definition: bitcompressed_vector.hpp:144
seqan3::bitcompressed_vector
A space-optimised version of std::vector that compresses multiple letters into a single byte.
Definition: bitcompressed_vector.hpp:66
seqan3::bitcompressed_vector::size
size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition: bitcompressed_vector.hpp:575
seqan3::bitcompressed_vector::resize
void resize(size_type const count, value_type const value)
Resizes the container to contain count elements.
Definition: bitcompressed_vector.hpp:932
seqan3::bitcompressed_vector::max_size
size_type max_size() const noexcept
Returns the maximum number of elements the container is able to hold due to system or library impleme...
Definition: bitcompressed_vector.hpp:594
seqan3::bitcompressed_vector::clear
void clear() noexcept
Removes all elements from the container.
Definition: bitcompressed_vector.hpp:677
writable_alphabet
Refines seqan3::alphabet and adds assignability.
seqan3::bitcompressed_vector::at
reference at(size_type const i)
Return the i-th element.
Definition: bitcompressed_vector.hpp:425
seqan3::bitcompressed_vector::size_type
size_type_t< data_type > size_type
An unsigned integer type (usually std::size_t)
Definition: bitcompressed_vector.hpp:148
seqan3::pack_traits::count
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition: traits.hpp:134
seqan3::bitcompressed_vector::value_type
alphabet_type value_type
Equals the alphabet_type.
Definition: bitcompressed_vector.hpp:136
seqan3::alphabet_proxy
A CRTP-base that eases the definition of proxy types returned in place of regular alphabets.
Definition: alphabet_proxy.hpp:59
seqan3::bitcompressed_vector::cbegin
const_iterator cbegin() const noexcept
Returns an iterator to the first element of the container.
Definition: bitcompressed_vector.hpp:373
seqan3::bitcompressed_vector::erase
iterator erase(const_iterator pos)
Removes specified elements from the container.
Definition: bitcompressed_vector.hpp:849
std::initializer_list
seqan3::bitcompressed_vector::front
const_reference front() const noexcept
Return the first element. Calling front on an empty container is undefined.
Definition: bitcompressed_vector.hpp:492
to_rank.hpp
Provides seqan3::views::to_rank.