BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type > Class Template Reference

Container that stores sequences concatenated internally. More...

#include <bio/ranges/container/concatenated_sequences.hpp>

+ Inheritance diagram for bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >:

Public Types

Member types
using value_type = decltype(std::declval< std::decay_t< underlying_container_type > & >()|views::slice(0, 1))
 A views::slice that represents "one element", typically a std::span.
 
using reference = value_type
 A proxy of type views::slice that represents the range on the concatenated vector.
 
using const_reference = decltype(std::as_const(data_values)|views::slice(0, 1))
 An immutable proxy of type views::slice that represents the range on the concatenated vector.
 
using iterator = detail::random_access_iterator< concatenated_sequences >
 The iterator type of this container (a random access iterator).
 
using const_iterator = detail::random_access_iterator< concatenated_sequences const >
 The const iterator type of this container (a random access iterator).
 
using difference_type = std::ranges::range_difference_t< data_delimiters_type >
 A signed integer type (usually std::ptrdiff_t)
 
using size_type = std::ranges::range_size_t< data_delimiters_type >
 An unsigned integer type (usually std::size_t)
 

Public Member Functions

Constructors, destructor and assignment
 concatenated_sequences ()=default
 Default constructors.
 
constexpr concatenated_sequences (concatenated_sequences const &)=default
 Default constructors.
 
constexpr concatenated_sequences (concatenated_sequences &&) noexcept=default
 Default constructors.
 
constexpr concatenated_sequencesoperator= (concatenated_sequences const &)=default
 Default constructors.
 
constexpr concatenated_sequencesoperator= (concatenated_sequences &&) noexcept=default
 Default constructors.
 
 ~concatenated_sequences ()=default
 Default constructors.
 
template<meta::different_from< concatenated_sequences > rng_of_rng_type>
requires (std::ranges::input_range<rng_of_rng_type> && range_value_t_is_compatible_with_value_type<rng_of_rng_type>)
 concatenated_sequences (rng_of_rng_type &&rng_of_rng)
 Construct/assign from a different range.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
 concatenated_sequences (size_type const count, rng_type &&value)
 Construct/assign with count times value.
 
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
requires (std::sized_sentinel_for<end_iterator_type, begin_iterator_type> && iter_value_t_is_compatible_with_value_type<begin_iterator_type>)
 concatenated_sequences (begin_iterator_type begin_it, end_iterator_type end_it)
 Construct/assign from pair of iterators.
 
template<std::ranges::forward_range value_type_t = value_type>
requires is_compatible_with_value_type<value_type_t>
 concatenated_sequences (std::initializer_list< value_type_t > ilist)
 Construct/assign from std::initializer_list.
 
template<std::ranges::forward_range value_type_t>
requires is_compatible_with_value_type<value_type_t>
concatenated_sequencesoperator= (std::initializer_list< value_type_t > ilist)
 Construct/assign from std::initializer_list.
 
template<std::ranges::input_range rng_of_rng_type>
requires range_value_t_is_compatible_with_value_type<rng_of_rng_type>
void assign (rng_of_rng_type &&rng_of_rng)
 Construct/assign from a different range.
 
template<std::ranges::forward_range rng_type>
requires (is_compatible_with_value_type<rng_type>)
void assign (size_type const count, rng_type &&value)
 Construct/assign with count times value.
 
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
requires (iter_value_t_is_compatible_with_value_type<begin_iterator_type> && std::sized_sentinel_for<end_iterator_type, begin_iterator_type>)
void assign (begin_iterator_type begin_it, end_iterator_type end_it)
 Construct/assign from pair of iterators.
 
template<std::ranges::forward_range rng_type = value_type>
requires is_compatible_with_value_type<rng_type>
void assign (std::initializer_list< rng_type > ilist)
 Construct/assign from std::initializer_list.
 
Iterators
iterator begin () noexcept
 Returns an iterator to the first element of the container.
 
const_iterator begin () const noexcept
 Returns an iterator to the first element of the container.
 
const_iterator cbegin () const noexcept
 Returns an iterator to the first element of the container.
 
iterator end () noexcept
 Returns an iterator to the element following the last element of the container.
 
const_iterator end () const noexcept
 Returns an iterator to the element following the last element of the container.
 
const_iterator cend () const noexcept
 Returns an iterator to the element following the last element of the container.
 
Element access
reference at (size_type const i)
 Return the i-th element as a view.
 
const_reference at (size_type const i) const
 Return the i-th element as a view.
 
reference operator[] (size_type const i)
 Return the i-th element as a view.
 
const_reference operator[] (size_type const i) const
 Return the i-th element as a view.
 
reference front ()
 Return the first element as a view. Calling front on an empty container is undefined.
 
const_reference front () const
 Return the first element as a view. Calling front on an empty container is undefined.
 
reference back ()
 Return the last element as a view.
 
const_reference back () const
 Return the last element as a view.
 
reference concat ()
 Return the concatenation of all members.
 
const_reference concat () const
 Return the concatenation of all members.
 
std::pair< decltype(data_values) &, decltype(data_delimiters) & > raw_data ()
 Provides direct, unsafe access to underlying data structures.
 
std::pair< decltype(data_values) const &, decltype(data_delimiters) const & > raw_data () const
 Provides direct, unsafe access to underlying data structures.
 
Capacity
bool empty () const noexcept
 Checks whether the container is empty.
 
size_type size () const noexcept
 Returns the number of elements in the container, i.e. std::distance(begin(), end()).
 
size_type max_size () const noexcept
 Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container.
 
size_type capacity () const noexcept
 Returns the number of elements that the container has currently allocated space for.
 
void reserve (size_type const new_cap)
 Increase the capacity to a value that's greater or equal to new_cap.
 
void shrink_to_fit ()
 Requests the removal of unused capacity.
 
Capacity (concat)
size_type concat_size () const noexcept
 Returns the cumulative size of all elements in the container.
 
size_type concat_capacity () const noexcept
 Returns the concatenated size the container has currently allocated space for.
 
void concat_reserve (size_type const new_cap)
 Increase the concat_capacity() to a value that's greater or equal to new_cap.
 
Modifiers
void clear () noexcept
 Removes all elements from the container.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
iterator insert (const_iterator pos, rng_type &&value)
 Inserts value before position in the container.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
iterator insert (const_iterator pos, size_type const count, rng_type &&value)
 Inserts count copies of value before position in the container.
 
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
requires (iter_value_t_is_compatible_with_value_type<begin_iterator_type> && std::sized_sentinel_for<end_iterator_type, begin_iterator_type>)
iterator insert (const_iterator pos, begin_iterator_type first, end_iterator_type last)
 Inserts elements from range [first, last) before position in the container.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
iterator insert (const_iterator pos, std::initializer_list< rng_type > const &ilist)
 Inserts elements from initializer list before position in the container.
 
iterator erase (const_iterator first, const_iterator last)
 Removes specified elements from the container.
 
iterator erase (const_iterator pos)
 Removes specified elements from the container.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
void push_back (rng_type &&value)
 Appends the given element value to the end of the container.
 
void push_back ()
 Appends an empty element to the end of the container.
 
void push_back_inner (std::ranges::range_value_t< underlying_container_type > const value)
 Appends the given element-of-element value to the end of the underlying container.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
void append_inner (rng_type &&value)
 Appends the given elements to the end of the underlying container (increases size of last element by n).
 
void pop_back ()
 Removes the last element of the container.
 
void resize (size_type const count)
 Resizes the container to contain count elements.
 
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
void resize (size_type const count, rng_type &&value)
 Resizes the container to contain count elements.
 
constexpr void swap (concatenated_sequences &rhs) noexcept
 Swap contents with another instance.
 
constexpr void swap (concatenated_sequences &&rhs) noexcept
 Swap contents with another instance.
 
Comparison operators
constexpr bool operator== (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is equal to rhs.
 
constexpr bool operator< (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is less than rhs.
 
constexpr bool operator> (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is greater than rhs.
 
constexpr bool operator<= (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is less than or equal to rhs.
 
constexpr bool operator>= (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is greater than or equal to rhs.
 

Static Protected Attributes

Compatibility

Static constexpr variables that emulate/encapsulate bio::ranges::range_compatible (which doesn't work for types during their definition).

template<std::ranges::range t>
static constexpr bool is_compatible_with_value_type
 Whether a type satisfies bio::ranges::range_compatible with this class's value_type or reference type.
 
template<typename t >
static constexpr bool iter_value_t_is_compatible_with_value_type
 Whether a type satisfies bio::ranges::range_compatible with this class.
 
template<std::ranges::range t>
static constexpr bool range_value_t_is_compatible_with_value_type
 Whether a type satisfies bio::ranges::range_compatible with this class.
 

Detailed Description

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
requires (detail::reservible_container<std::remove_reference_t<underlying_container_type>> && detail::reservible_container<std::remove_reference_t<data_delimiters_type>> && std::is_same_v<std::ranges::range_size_t<underlying_container_type>, std::ranges::range_value_t<data_delimiters_type>>)
class bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >

Container that stores sequences concatenated internally.

Template Parameters
underlying_container_typeType of the underlying container. Must satisfy bio::reservible_container.
data_delimiters_typeA container that stores the begin/end positions in the underlying_container_type. Must satifsy bio::reservible_container and have underlying_container_type's size_type as value_type.

This class may be used whenever you would usually use std::vector<std::vector<some_alphabet>> or std::vector<std::string>, i.e. whenever you have a collection of sequences. It is the spiritual successor of the StringSet<TString, Owner<ConcatDirect>> from SeqAn2.

It saves all of the member sequences inside one concatenated sequence internally. If you access an element, you instead get a view on the internal sequence. This has the following advantages:

  • Better cache locality when parsing the sequences linearly (and often also on random access).
  • Constant time access to the concatenation of the sequences via concat().
  • This access is also writable so that certain transformations can be done globally, instead of element-wise.
  • Also direct access to the delimiters via raw_data() [this is used by some algorithms].

Note that the "value type" of bio::concatenated_sequences<T> is not T. It is a view –– typically a std::span or a std::string_view. This view becomes invalid when the container is destroyed or any operation is performed on the container that invalidates its iterators, e.g. push_back().

The disadvantages are:

  • Slower inserts and erases because the entire concatenation might have to be copied.
  • No emplace operations.
  • Modifying elements is limited to operations on elements of that element, i.e. you can change a character, but you can't assign a new member sequence to an existing position.

Example

#include <vector>
int main()
{
using namespace bio::alphabet::literals;
fmt::print("{}\n", concat1[0]); // "ACGT"
std::vector<std::vector<bio::alphabet::dna4>> concat2{"ACTA"_dna4, "AGGA"_dna4};
concat1 = concat2; // you can assign from other ranges
concat2[0] = "ATTA"_dna4; // this works for vector of vector
concat1[0][1] = 'T'_dna4; // and this works for concatenated_sequences
fmt::print("{}\n", concat1[0]); // "ATTA"
// if you know that you will be adding ten vectors of length ten:
std::vector<bio::alphabet::dna4> vector_of_length10{"ACGTACGTAC"_dna4};
concat1.reserve(10);
concat1.concat_reserve(10 * vector_of_length10.size());
while (concat1.size() < 10)
{
// ...
concat1.push_back(vector_of_length10);
}
}
Container that stores sequences concatenated internally.
Definition: concatenated_sequences.hpp:85
Provides bio::ranges::concatenated_sequences.
Provides bio::alphabet::dna4, container aliases and string literals.
Core alphabet concept and free function/type trait wrappers.
An inline namespace for alphabet literals. It exists to safely allow using namespace.
Definition: aa10li.hpp:183
T reserve(T... args)

Exceptions

Whenever a strong exception guarantee is given for this class, it presumes that std::is_nothrow_move_constructible<typename underlying_container_type::value_type> otherwise only basic exception safety can be assumed.

Thread safety

This container provides no thread-safety beyond the promise given also by the STL that all calls to const member function are safe from multiple threads (as long as no thread calls a non-const member function at the same time).

Constructor & Destructor Documentation

◆ concatenated_sequences() [1/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<meta::different_from< concatenated_sequences > rng_of_rng_type>
requires (std::ranges::input_range<rng_of_rng_type> && range_value_t_is_compatible_with_value_type<rng_of_rng_type>)
bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concatenated_sequences ( rng_of_rng_type &&  rng_of_rng)
inline

Construct/assign from a different range.

Template Parameters
rng_of_rng_typeThe type of range to be inserted; must satisfy range_value_t_is_compatible_with_value_type.
Parameters
rng_of_rngThe sequences to construct/assign from.

Complexity

Linear in the cumulative size of rng_of_rng.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ concatenated_sequences() [2/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concatenated_sequences ( size_type const  count,
rng_type &&  value 
)
inline

Construct/assign with count times value.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
countNumber of elements.
valueThe initial value to be assigned.

Complexity

In $O(count*value)$.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ concatenated_sequences() [3/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
requires (std::sized_sentinel_for<end_iterator_type, begin_iterator_type> && iter_value_t_is_compatible_with_value_type<begin_iterator_type>)
bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concatenated_sequences ( begin_iterator_type  begin_it,
end_iterator_type  end_it 
)
inline

Construct/assign from pair of iterators.

Template Parameters
begin_iterator_typeMust satisfy std::forward_iterator and must satisfy iter_value_t_is_compatible_with_value_type.
end_iterator_typeMust satisfy std::sized_sentinel_for.
Parameters
begin_itbegin of range to construct/assign from.
end_itend of range to construct/assign from.

Complexity

Linear in the cumulative size of the ranges between begin_it and end_it.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ concatenated_sequences() [4/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range value_type_t = value_type>
requires is_compatible_with_value_type<value_type_t>
bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concatenated_sequences ( std::initializer_list< value_type_t >  ilist)
inline

Construct/assign from std::initializer_list.

Template Parameters
value_type_tThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
ilistan std::initializer_list of value_type_t.

Complexity

Linear in the cumulative size of the ranges in ilist.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

Member Function Documentation

◆ append_inner()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::append_inner ( rng_type &&  value)
inline

Appends the given elements to the end of the underlying container (increases size of last element by n).

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
valueThe value to append.

This conceptionally performs an insert() on the back() of this container, i.e. the last inner container grows by value.size().

If the new concat_size() is greater than concat_capacity(), all iterators and references (including the past-the-end iterator) are invalidated. Otherwise, only the past-the-end iterator is invalidated.

Complexity

Amortised linear in the size of value. Wort-case linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak. However, the container may contain invalid data after an exception is thrown.

◆ assign() [1/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
requires (iter_value_t_is_compatible_with_value_type<begin_iterator_type> && std::sized_sentinel_for<end_iterator_type, begin_iterator_type>)
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::assign ( begin_iterator_type  begin_it,
end_iterator_type  end_it 
)
inline

Construct/assign from pair of iterators.

Template Parameters
begin_iterator_typeMust satisfy std::forward_iterator and satisfy iter_value_t_is_compatible_with_value_type.
end_iterator_typeMust satisfy std::sized_sentinel_for.
Parameters
begin_itbegin of range to construct/assign from.
end_itend of range to construct/assign from.

Complexity

Linear in the cumulative size of the ranges between begin_it and end_it.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ assign() [2/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::input_range rng_of_rng_type>
requires range_value_t_is_compatible_with_value_type<rng_of_rng_type>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::assign ( rng_of_rng_type &&  rng_of_rng)
inline

Construct/assign from a different range.

Template Parameters
rng_of_rng_typeThe type of range to be inserted; must satisfy range_value_t_is_compatible_with_value_type.
Parameters
rng_of_rngThe sequences to construct/assign from.

Complexity

Linear in the cumulative size of rng_of_rng.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ assign() [3/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires (is_compatible_with_value_type<rng_type>)
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::assign ( size_type const  count,
rng_type &&  value 
)
inline

Construct/assign with count times value.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
countNumber of elements.
valueThe initial value to be assigned.

Complexity

In $O(count*value)$.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ assign() [4/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type = value_type>
requires is_compatible_with_value_type<rng_type>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::assign ( std::initializer_list< rng_type >  ilist)
inline

Construct/assign from std::initializer_list.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
ilistan std::initializer_list of rng_type.

Complexity

Linear in the cumulative size of the elements in ilist.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ at() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::at ( size_type const  i)
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Exceptions
std::out_of_rangeIf you access an element behind the last.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data)..

◆ at() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::at ( size_type const  i) const
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Exceptions
std::out_of_rangeIf you access an element behind the last.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data)..

◆ back() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::back ( )
inline

Return the last element as a view.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling back on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data)..

◆ back() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::back ( ) const
inline

Return the last element as a view.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling back on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data)..

◆ begin() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ begin() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ capacity()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
size_type bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::capacity ( ) const
inlinenoexcept

Returns the number of elements that the container has currently allocated space for.

Returns
The capacity of the currently allocated storage.
Attention

This does not operate on underlying concat container, see concat_capacity().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ cbegin()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::cbegin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ cend()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::cend ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ clear()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::clear ( )
inlinenoexcept

Removes all elements from the container.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ concat() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat ( )
inline

Return the concatenation of all members.

Returns
A std::ranges::view proxy on the concatenation of underlying sequences.

This is a safe way of accessing the internal concatenated representation, i.e. you cannot do operations that would invalidate this container (like insert or resize), but you can write to the individual positions.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

◆ concat() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat ( ) const
inline

Return the concatenation of all members.

Returns
A std::ranges::view proxy on the concatenation of underlying sequences.

This is a safe way of accessing the internal concatenated representation, i.e. you cannot do operations that would invalidate this container (like insert or resize), but you can write to the individual positions.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

◆ concat_capacity()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
size_type bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat_capacity ( ) const
inlinenoexcept

Returns the concatenated size the container has currently allocated space for.

Returns
The capacity of the currently allocated storage.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ concat_reserve()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat_reserve ( size_type const  new_cap)
inline

Increase the concat_capacity() to a value that's greater or equal to new_cap.

Parameters
new_capThe new capacity.
Exceptions
std::length_errorIf new_cap > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the capacity of the underlying concatenated sequence to a value that's greater or equal to new_cap. If new_cap is greater than the current concat_capacity(), new storage is allocated, otherwise the method does nothing. If new_cap is greater than concat_capacity(), all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.

Complexity

At most linear in the concat_size() of the container.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ concat_size()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
size_type bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat_size ( ) const
inlinenoexcept

Returns the cumulative size of all elements in the container.

Returns
The cumulative size of elements in the container.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ empty()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
bool bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::empty ( ) const
inlinenoexcept

Checks whether the container is empty.

Returns
true if the container is empty, false otherwise.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::end ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ erase() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Removes specified elements from the container.

Parameters
firstBegin of range to erase.
lastBehind the end of range to erase.
Returns
Iterator pointing to the first element inserted, or pos if first==last.

Invalidates iterators and references at or after the point of the erase, including the end() iterator.

The iterator first does not need to be dereferenceable if first==last: erasing an empty range is a no-op.

Complexity

Linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

◆ erase() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::erase ( const_iterator  pos)
inline

Removes specified elements from the container.

Parameters
posRemove the element at pos.
Returns
Iterator pointing to the first element inserted, or pos if first==last.

Invalidates iterators and references at or after the point of the erase, including the end() iterator.

The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferencable) cannot be used as a value for pos.

Complexity

Linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

◆ front() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::front ( )
inline

Return the first element as a view. Calling front on an empty container is undefined.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling front on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

◆ front() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::front ( ) const
inline

Return the first element as a view. Calling front on an empty container is undefined.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling front on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

◆ insert() [1/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
requires (iter_value_t_is_compatible_with_value_type<begin_iterator_type> && std::sized_sentinel_for<end_iterator_type, begin_iterator_type>)
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::insert ( const_iterator  pos,
begin_iterator_type  first,
end_iterator_type  last 
)
inline

Inserts elements from range [first, last) before position in the container.

Template Parameters
begin_iterator_typeMust satisfy std::forward_iterator and iter_value_t_is_compatible_with_value_type.
end_iterator_typeMust satisfy std::sized_sentinel_for.
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
firstBegin of range to insert.
lastBehind the end of range to insert.
Returns
Iterator pointing to the first element inserted, or pos if first==last.

The behaviour is undefined if first and last are iterators into *this.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

◆ insert() [2/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::insert ( const_iterator  pos,
rng_type &&  value 
)
inline

Inserts value before position in the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy std::ranges::forward_range and have the same value_type as value_type (i.e. value_type's value_type!).
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
valueElement value to insert.
Returns
Iterator pointing to the inserted value.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

Example

int main()
{
using namespace bio::alphabet::literals;
foobar.insert(foobar.end(), "ACGT"_dna4);
fmt::print("{}\n", foobar[0]); // "ACGT"
}
iterator insert(const_iterator pos, rng_type &&value)
Inserts value before position in the container.
Definition: concatenated_sequences.hpp:789
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: concatenated_sequences.hpp:425

◆ insert() [3/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::insert ( const_iterator  pos,
size_type const  count,
rng_type &&  value 
)
inline

Inserts count copies of value before position in the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
countNumber of copies.
valueElement value to insert.
Returns
Iterator pointing to the first element inserted, or pos if count==0.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

Example

int main()
{
using namespace bio::alphabet::literals;
foobar.insert(foobar.end(), 2, "ACGT"_dna4);
fmt::print("{}\n", foobar[0]); // "ACGT"
fmt::print("{}\n", foobar[1]); // "ACGT"
}

◆ insert() [4/4]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
iterator bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::insert ( const_iterator  pos,
std::initializer_list< rng_type > const &  ilist 
)
inline

Inserts elements from initializer list before position in the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
ilistInitializer list with values to insert.
Returns
Iterator pointing to the first element inserted, or pos if ilist is empty.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

◆ max_size()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
size_type bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::max_size ( ) const
inlinenoexcept

Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container.

Returns
The number of elements in the container.

This value typically reflects the theoretical limit on the size of the container. At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ operator=()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range value_type_t>
requires is_compatible_with_value_type<value_type_t>
concatenated_sequences & bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator= ( std::initializer_list< value_type_t >  ilist)
inline

Construct/assign from std::initializer_list.

Template Parameters
value_type_tThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
ilistan std::initializer_list of value_type_t.

Complexity

Linear in the cumulative size of the elements in ilist.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ operator[]() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator[] ( size_type const  i)
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data)..

◆ operator[]() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
const_reference bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator[] ( size_type const  i) const
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data)..

◆ pop_back()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::pop_back ( )
inline

Removes the last element of the container.

Calling pop_back on an empty container is undefined. In debug mode an assertion will be thrown.

No iterators or references except for back() and end() are invalidated.

Complexity

Constant.

Exceptions

No exception is thrown in release mode.

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ push_back() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::push_back ( )
inline

Appends an empty element to the end of the container.

This conceptionally adds an empty element to the container, i.e. the "outer container" grows by 1 and the new back() will be empty.

No iterators are invalidated.

Complexity

Amortised constant. Wort-case linear in size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak. However, the container may contain invalid data after an exception is thrown.

◆ push_back() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::push_back ( rng_type &&  value)
inline

Appends the given element value to the end of the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
valueThe value to append.

This conceptionally adds another element to the container with the specified content, i.e. the "outer container" grows by 1.

If the new concat_size() is greater than concat_capacity(), all iterators and references (including the past-the-end iterator) are invalidated. Otherwise, only the past-the-end iterator is invalidated.

Complexity

Amortised linear in the size of value. Wort-case linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

◆ push_back_inner()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::push_back_inner ( std::ranges::range_value_t< underlying_container_type > const  value)
inline

Appends the given element-of-element value to the end of the underlying container.

Parameters
valueThe value to append.

This conceptionally performs a push_back() on the back() of this container, i.e. that last inner container grows by 1.

If the new concat_size() is greater than concat_capacity(), all iterators and references (including the past-the-end iterator) are invalidated. Otherwise, only the past-the-end iterator is invalidated.

Complexity

Amortised constant. Wort-case linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak. However, the container may contain invalid data after an exception is thrown.

◆ raw_data() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
std::pair< decltype(data_values) &, decltype(data_delimiters) & > bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::raw_data ( )
inline

Provides direct, unsafe access to underlying data structures.

Returns
An std::pair of the concatenated sequences and the delimiter string.

The exact representation of the data is implementation defined. Do not rely on it for API stability.

◆ raw_data() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
std::pair< decltype(data_values) const &, decltype(data_delimiters) const & > bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::raw_data ( ) const
inline

Provides direct, unsafe access to underlying data structures.

Returns
An std::pair of the concatenated sequences and the delimiter string.

The exact representation of the data is implementation defined. Do not rely on it for API stability.

◆ reserve()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::reserve ( size_type const  new_cap)
inline

Increase the capacity to a value that's greater or equal to new_cap.

Parameters
new_capThe new capacity.
Exceptions
std::length_errorIf new_cap > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the capacity of the vector to a value that's greater or equal to new_cap. If new_cap is greater than the current capacity(), new storage is allocated, otherwise the method does nothing. If new_cap is greater than capacity(), all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.

Attention

This does not operate on underlying concat container, see concat_reserve().

Complexity

At most linear in the size() of the container.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ resize() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::resize ( size_type const  count)
inline

Resizes the container to contain count elements.

Parameters
countThe new size.
Exceptions
std::length_errorIf count > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the size() of the vector to count.

If the current capacity() is smaller than count, new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise only the past-the-end iterator is invalidated.

If the current size is greater than count, the container is reduced to its first count elements. Capacity is never reduced when resizing to smaller size because that would invalidate all iterators, rather than only the ones that would be invalidated by the equivalent sequence of pop_back() calls.

Complexity

At most linear in the size() of the container.

Exceptions

Only new size: Strong exception guarantee (no data is modified in case an exception is thrown). [only new size]

New default value: Basic exception guarantee, i.e. guaranteed not to leak, but container my contain bogus data after exceptions is thrown.

◆ resize() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::forward_range rng_type>
requires is_compatible_with_value_type<rng_type>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::resize ( size_type const  count,
rng_type &&  value 
)
inline

Resizes the container to contain count elements.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
valueInstead of appending empty containers, append copies of value.
countThe new size.
Exceptions
std::length_errorIf count > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the size() of the vector to count.

If the current capacity() is smaller than count, new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise only the past-the-end iterator is invalidated.

If the current size is greater than count, the container is reduced to its first count elements. Capacity is never reduced when resizing to smaller size because that would invalidate all iterators, rather than only the ones that would be invalidated by the equivalent sequence of pop_back() calls.

Complexity

At most linear in the size() of the container.

Exceptions

Only new size: Strong exception guarantee (no data is modified in case an exception is thrown). [only new size]

New default value: Basic exception guarantee, i.e. guaranteed not to leak, but container my contain bogus data after exceptions is thrown.

◆ shrink_to_fit()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::shrink_to_fit ( )
inline

Requests the removal of unused capacity.

It is a non-binding request to reduce capacity() to size() and concat_capacity() to concat_size(). It depends on the implementation if the request is fulfilled. If reallocation occurs, all iterators, including the past the end iterator, and all references to the elements are invalidated. If no reallocation takes place, no iterators or references are invalidated.

Attention

This effects both underlying data structures.

Complexity

At most linear in the size() of the container.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

◆ size()

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
size_type bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::size ( ) const
inlinenoexcept

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

Returns
The number of elements in the container.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ swap() [1/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
constexpr void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::swap ( concatenated_sequences< underlying_container_type, data_delimiters_type > &&  rhs)
inlineconstexprnoexcept

Swap contents with another instance.

Parameters
rhsThe other instance to swap with.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ swap() [2/2]

template<typename underlying_container_type , typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
constexpr void bio::ranges::concatenated_sequences< underlying_container_type, data_delimiters_type >::swap ( concatenated_sequences< underlying_container_type, data_delimiters_type > &  rhs)
inlineconstexprnoexcept

Swap contents with another instance.

Parameters
rhsThe other instance to swap with.

Complexity

Constant.

Exceptions

No-throw guarantee.


The documentation for this class was generated from the following file: