Loading...
Searching...
No Matches
seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type > Class Template Reference
Alphabet » Container

Container that stores sequences concatenated internally. More...

`#include <seqan3/alphabet/container/concatenated_sequences.hpp>`

Inheritance diagram for seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >:
[legend]

## Public Types

Member types
using | value_type
| A views::slice that represents "one element", typically a std::span.
using | reference
| A views::slice that represents "one element", typically a std::span.
using | const_reference
| An immutable views::slice that represents "one element", typically a std::span or std::string_view.
using | iterator
| The iterator type of this container (a random access iterator).
using | const_iterator
| The const iterator type of this container (a random access iterator).
using | difference_type
| A signed integer type (usually std::ptrdiff_t).
using | size_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 &&)=default
| Default constructors.
constexpr concatenated_sequences & | operator= (concatenated_sequences const &)=default
| Default constructors.
constexpr concatenated_sequences & | operator= (concatenated_sequences &&)=default
| Default constructors.
| ~concatenated_sequences ()=default
| Default constructors.
template<std::ranges::input_range rng_of_rng_type> requires 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_sequences & | operator= (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 | last_push_back (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 | last_append (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 not 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 whether the ranges are 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 is 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 is compatible with this class.
template<std::ranges::range t>
static constexpr bool | range_value_t_is_compatible_with_value_type
| Whether a type is compatible with this class.

## Detailed Description

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
requires reservible_container<std::remove_reference_t<underlying_container_type>> && 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 seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >

Container that stores sequences concatenated internally.

Template Parameters

  underlying_container_type | Type of the underlying container. Must satisfy seqan3::reservible_container.
  data_delimiters_type | A container that stores the begin/end positions in the underlying_container_type. Must satifsy seqan3::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 string. 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].

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.

Note that the "value type" of seqan3::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().

### Example

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <vector>
#include <seqan3/alphabet/container/concatenated_sequences.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
int main()
{
using namespace seqan3::literals;
seqan3::concatenated_sequences<seqan3::dna4_vector> concat1{"ACGT"_dna4, "GAGGA"_dna4};
seqan3::debug_stream << concat1[0] << '\n'; // "ACGT"
std::vector<seqan3::dna4_vector> 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
seqan3::debug_stream << concat1[0] << '\n'; // "ATTA"
// if you know that you will be adding ten vectors of length ten:
std::vector<seqan3::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);
}
}
seqan3::concatenated_sequences
Container that stores sequences concatenated internally.
Definition concatenated_sequences.hpp:86
seqan3::concatenated_sequences::reserve
void reserve(size_type const new_cap)
Increase the capacity to a value that's greater or equal to new_cap.
Definition concatenated_sequences.hpp:776
seqan3::concatenated_sequences::size
size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition concatenated_sequences.hpp:706
seqan3::concatenated_sequences::push_back
void push_back(rng_type &&value)
Appends the given element value to the end of the container.
Definition concatenated_sequences.hpp:1216
seqan3::concatenated_sequences::concat_reserve
void concat_reserve(size_type const new_cap)
Increase the concat_capacity() to a value that's greater or equal to new_cap.
Definition concatenated_sequences.hpp:866
concatenated_sequences.hpp
Provides seqan3::concatenated_sequences.
debug_stream.hpp
Provides seqan3::debug_stream and related types.
dna4.hpp
Provides seqan3::dna4, container aliases and string literals.
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:38
seqan3::literals
The SeqAn namespace for literals.
std::vector::size
T size(T... args)
vector

### 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## Member Typedef Documentation

## const_iterator

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::const_iterator

The const iterator type of this container (a random access iterator).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## const_reference

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::const_reference

An immutable views::slice that represents "one element", typically a std::span or std::string_view.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## difference_type

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::difference_type

A signed integer type (usually std::ptrdiff_t).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## iterator

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::iterator

The iterator type of this container (a random access iterator).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## reference

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::reference

A views::slice that represents "one element", typically a std::span.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## size_type

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::size_type

An unsigned integer type (usually std::size_t).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## value_type

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

using seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::value_type

A views::slice that represents "one element", typically a std::span.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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<std::ranges::input_range rng_of_rng_type>
requires range_value_t_is_compatible_with_value_type<rng_of_rng_type>

seqan3::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_type | The type of range to be inserted; must satisfy range_value_t_is_compatible_with_value_type.

Parameters

  rng_of_rng | The 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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>

seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  count | Number of elements.
  value | The initial value to be assigned.

### Complexity

In .

### Exceptions

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

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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>

seqan3::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_type | Must satisfy std::forward_iterator and must satisfy iter_value_t_is_compatible_with_value_type.
  end_iterator_type | Must satisfy std::sized_sentinel_for.

Parameters

  begin_it | begin of range to construct/assign from.
  end_it | end 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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>

seqan3::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_t | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  ilist | a 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## Member Function Documentation

## 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 seqan3::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_type | Must satisfy std::forward_iterator and satisfy iter_value_t_is_compatible_with_value_type.
  end_iterator_type | Must satisfy std::sized_sentinel_for.

Parameters

  begin_it | begin of range to construct/assign from.
  end_it | end 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy range_value_t_is_compatible_with_value_type.

Parameters

  rng_of_rng | The 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  count | Number of elements.
  value | The initial value to be assigned.

### Complexity

In .

### Exceptions

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

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  ilist | a 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## at() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

reference seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::at | ( | size_type const | i | ) |

inline

Return the i-th element as a view.

Parameters

  i | The element to retrieve.

Exceptions

  std::out_of_range | If 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## at() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_reference seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::at | ( | size_type const | i | ) | const

inline

Return the i-th element as a view.

Parameters

  i | The element to retrieve.

Exceptions

  std::out_of_range | If 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## back() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

reference seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## back() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_reference seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## begin() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::begin | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## begin() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::begin | ( |  | ) |

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## capacity()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

size_type seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::capacity | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## cbegin()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::cbegin | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## cend()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::cend | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## clear()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::clear | ( |  | ) |

inline noexcept

Removes all elements from the container.

### Complexity

Constant.

### Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## concat() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

reference seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## concat() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_reference seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## concat_capacity()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

size_type seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat_capacity | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## concat_reserve()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::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_cap | The new capacity.

Exceptions

  std::length_error | If new_cap > max_size().
  std::exception | Any 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## concat_size()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

size_type seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::concat_size | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## empty()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::empty | ( |  | ) | const

inline noexcept

Checks whether the container is empty.

Returns
  true if the container is empty, false otherwise.

### Complexity

Constant.

### Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## end() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::end | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## end() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::end | ( |  | ) |

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## erase() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::erase | ( | const_iterator | first,
|  | const_iterator | last )

inline

Removes specified elements from the container.

Parameters

  first | Begin of range to erase.
  last | Behind 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## erase() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

iterator seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::erase | ( | const_iterator | pos | ) |

inline

Removes specified elements from the container.

Parameters

  pos | Remove 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## front() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

reference seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## front() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_reference seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | Must satisfy std::forward_iterator and iter_value_t_is_compatible_with_value_type.
  end_iterator_type | Must satisfy std::sized_sentinel_for.

Parameters

  pos | Iterator before which the content will be inserted. pos may be the end() iterator.
  first | Begin of range to insert.
  last | Behind 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The 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

  pos | Iterator before which the content will be inserted. pos may be the end() iterator.
  value | Element 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

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/alphabet/container/concatenated_sequences.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
int main()
{
using namespace seqan3::literals;
seqan3::concatenated_sequences<seqan3::dna4_vector> foobar;
foobar.insert(foobar.end(), "ACGT"_dna4);
seqan3::debug_stream << foobar[0] << '\n'; // "ACGT"
}
seqan3::concatenated_sequences::end
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition concatenated_sequences.hpp:487
seqan3::concatenated_sequences::insert
iterator insert(const_iterator pos, rng_type &&value)
Inserts value before position in the container.
Definition concatenated_sequences.hpp:921

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  pos | Iterator before which the content will be inserted. pos may be the end() iterator.
  count | Number of copies.
  value | Element 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

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/alphabet/container/concatenated_sequences.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
int main()
{
using namespace seqan3::literals;
seqan3::concatenated_sequences<seqan3::dna4_vector> foobar;
foobar.insert(foobar.end(), 2, "ACGT"_dna4);
seqan3::debug_stream << foobar[0] << '\n'; // "ACGT"
seqan3::debug_stream << foobar[1] << '\n'; // "ACGT"
}

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  pos | Iterator before which the content will be inserted. pos may be the end() iterator.
  ilist | Initializer 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## last_append()

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 seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::last_append | ( | 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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  value | The 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## last_push_back()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::last_push_back | ( | 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

  value | The 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## max_size()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

size_type seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::max_size | ( |  | ) | const

inline 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.

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator!=()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator!= | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > const & | rhs | ) | const

inline constexpr noexcept

Checks whether *this is not equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator<()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator< | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > const & | rhs | ) | const

inline constexpr noexcept

Checks whether *this is less than rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator<=()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator<= | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > const & | rhs | ) | const

inline constexpr noexcept

Checks whether *this is less than or equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 & seqan3::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_t | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  ilist | a 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator==()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator== | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > const & | rhs | ) | const

inline constexpr noexcept

Checks whether *this is equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator>()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator> | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > const & | rhs | ) | const

inline constexpr noexcept

Checks whether *this is greater than rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator>=()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator>= | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > const & | rhs | ) | const

inline constexpr noexcept

Checks whether *this is greater than or equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator[]() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

reference seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator[] | ( | size_type const | i | ) |

inline

Return the i-th element as a view.

Parameters

  i | The 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator[]() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

const_reference seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::operator[] | ( | size_type const | i | ) | const

inline

Return the i-th element as a view.

Parameters

  i | The 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## pop_back()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## push_back() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  value | The 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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) & > seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::raw_data | ( |  | ) |

inline

Provides direct, unsafe access to underlying data structures.

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

This entity is not part of the SeqAn API. Do not rely on it in your applications. The exact representation of the data is implementation defined.

## 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 & > seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::raw_data | ( |  | ) | const

inline

Provides direct, unsafe access to underlying data structures.

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

This entity is not part of the SeqAn API. Do not rely on it in your applications. The exact representation of the data is implementation defined.

## reserve()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::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_cap | The new capacity.

Exceptions

  std::length_error | If new_cap > max_size().
  std::exception | Any 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## resize() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::resize | ( | size_type const | count | ) |

inline

Resizes the container to contain count elements.

Parameters

  count | The new size.

Exceptions

  std::length_error | If count > max_size().
  std::exception | Any 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## 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 seqan3::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_type | The type of range to be inserted; must satisfy is_compatible_with_value_type.

Parameters

  value | Instead of appending empty containers, append copies of value.
  count | The new size.

Exceptions

  std::length_error | If count > max_size().
  std::exception | Any 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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## shrink_to_fit()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::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 affects 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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## size()

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

size_type seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::size | ( |  | ) | const

inline noexcept

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.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## swap() [1/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::swap | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > && | rhs | ) |

inline constexpr noexcept

Swap contents with another instance.

Parameters

  rhs | The other instance to swap with.

### Complexity

Constant.

### Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## swap() [2/2]

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>

void seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::swap | ( | concatenated_sequences< underlying_container_type, data_delimiters_type > & | rhs | ) |

inline constexpr noexcept

Swap contents with another instance.

Parameters

  rhs | The other instance to swap with.

### Complexity

Constant.

### Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## Member Data Documentation

## is_compatible_with_value_type

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::range t>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::is_compatible_with_value_type

static constexpr protected

Whether a type is compatible with this class's value_type or reference type.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Exposition only.

## iter_value_t_is_compatible_with_value_type

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<typename t>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::iter_value_t_is_compatible_with_value_type

static constexpr protected

Whether a type is compatible with this class.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Exposition only.

## range_value_t_is_compatible_with_value_type

template<typename underlying_container_type, typename data_delimiters_type = std::vector<typename underlying_container_type::size_type>>
template<std::ranges::range t>

bool seqan3::concatenated_sequences< underlying_container_type, data_delimiters_type >::range_value_t_is_compatible_with_value_type

static constexpr protected

Whether a type is compatible with this class.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Exposition only.

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

- concatenated_sequences.hpp

Hide me