SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::alphabet_tuple_base< derived_type, component_types > Class Template Reference

The CRTP base for a combined alphabet that contains multiple values of different alphabets at the same time.. More...

#include <seqan3/alphabet/composite/alphabet_tuple_base.hpp>

+ Inheritance diagram for seqan3::alphabet_tuple_base< derived_type, component_types >:

Classes

class  component_proxy
 Specialisation of seqan3::alphabet_proxy that updates the rank of the alphabet_tuple_base. More...
 

Private Types

using base_t = alphabet_base< derived_type,(1 *... *alphabet_size< component_types >), void >
 The base type of this class.
 
using component_list = seqan3::type_list< component_types... >
 A seqan3::type_list The types of each component in the composite.
 
using seqan3_recursive_required_types = list_traits::concat< component_list, detail::transformation_trait_or_t< detail::recursive_required_types< component_types >, seqan3::type_list<> >... >
 Export this type's components and possibly the components' components in a visible manner.
 
using seqan3_required_types = component_list
 Export this type's components in a visible manner.
 

Private Member Functions

template<size_t index>
constexpr void assign_component_rank (ptrdiff_t const r) noexcept
 Assign via the rank of i-th component (does not update other components' state).
 
template<size_t index>
constexpr rank_type to_component_rank () const noexcept
 Return the rank of the i-th component.
 

Static Private Member Functions

template<std::size_t... idx>
static constexpr rank_type rank_sum_helper (component_types... components, std::index_sequence< idx... > const &) noexcept
 For the given components, compute the combined rank.
 

Private Attributes

friend derived_type
 Befriend the derived type so that it can instantiate.
 

Static Private Attributes

static constexpr std::array< rank_type, component_list::size()> cummulative_alph_sizes
 The cumulative alphabet size products are cached.
 
template<typename type >
static constexpr bool is_component = seqan3::list_traits::contains<type, component_list>
 Is set to true if the type is contained in the type list.
 
template<typename type >
static constexpr bool is_unique_component = (seqan3::list_traits::count<type, component_list> == 1)
 Is set to true if the type is uniquely contained in the type list.
 
static constexpr bool seqan3_alphabet_tuple_like = true
 Make specialisations of this template identifiable in metapgrogramming contexts.
 

Friends

Comparison operators (against indirect component_list)

These overloads enable comparison for all types that a component type is comparable with.

template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator== (derived_type_t const lhs, indirect_component_type const rhs) noexcept -> std::enable_if_t< detail::tuple_eq_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator== (indirect_component_type const lhs, derived_type_t const rhs) noexcept -> std::enable_if_t< detail::tuple_eq_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator!= (derived_type_t const lhs, indirect_component_type const rhs) noexcept -> std::enable_if_t< detail::tuple_eq_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator!= (indirect_component_type const lhs, derived_type_t const rhs) noexcept -> std::enable_if_t< detail::tuple_eq_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator< (derived_type_t const lhs, indirect_component_type const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator< (indirect_component_type const lhs, derived_type_t const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator<= (derived_type_t const lhs, indirect_component_type const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator<= (indirect_component_type const lhs, derived_type_t const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator> (derived_type_t const lhs, indirect_component_type const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator> (indirect_component_type const lhs, derived_type_t const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator>= (derived_type_t const lhs, indirect_component_type const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator>= (indirect_component_type const lhs, derived_type_t const rhs) noexcept -> std::enable_if_t< detail::tuple_order_guard< derived_type_t, derived_type, indirect_component_type, component_types... >, bool >
 Comparison against types comparable with components.
 
Comparison operators

Constructors, destructor and assignment

Attention
Please do not directly use the CRTP base class. The functions are only public for the usage in their derived classes (e.g. seqan3::qualified, seqan3::masked, seqan3::structure_rna and seqan3::structure_aa).
constexpr alphabet_tuple_base () noexcept
 Defaulted.
 
constexpr alphabet_tuple_base (alphabet_tuple_base const &)=default
 Defaulted.
 
constexpr alphabet_tuple_base (alphabet_tuple_base &&)=default
 Defaulted.
 
constexpr alphabet_tuple_baseoperator= (alphabet_tuple_base const &)=default
 Defaulted.
 
constexpr alphabet_tuple_baseoperator= (alphabet_tuple_base &&)=default
 Defaulted.
 
 ~alphabet_tuple_base ()=default
 Defaulted.
 
constexpr alphabet_tuple_base (component_types... components) noexcept
 Construction from initialiser-list.
 
template<typename component_type >
requires (!std::is_base_of_v<alphabet_tuple_base, component_type>) && is_unique_component<component_type>
constexpr alphabet_tuple_base (component_type const alph) noexcept
 Construction via a value of one of the components.
 
template<typename indirect_component_type >
requires ((detail::instantiate_if_v< detail::lazy<std::is_convertible, indirect_component_type, component_types>, detail::tuple_general_guard<derived_type, indirect_component_type, component_types...>> || ...))
constexpr alphabet_tuple_base (indirect_component_type const alph) noexcept
 Construction via a value of a subtype that is assignable to one of the components.
 
template<typename component_type >
requires (!std::derived_from<component_type, alphabet_tuple_base>) && is_unique_component<component_type>
constexpr derived_typeoperator= (component_type const alph) noexcept
 Assignment via a value of one of the components.
 
template<typename indirect_component_type >
requires ((!std::derived_from<indirect_component_type, alphabet_tuple_base>) && (!is_unique_component<indirect_component_type>) && (std::assignable_from<component_types, indirect_component_type> || ...))
constexpr derived_typeoperator= (indirect_component_type const alph) noexcept
 Assignment via a value of a subtype that is assignable to one of the components.
 

Read functions

All read operations are constant complexity.

template<typename type >
requires is_unique_component<type>
constexpr operator type () const noexcept
 Implicit cast to a single letter. Works only if the type is unique in the type list.
 
template<size_t index>
constexpr auto get (alphabet_tuple_base &l) noexcept
 Tuple-like access to the contained components.
 
template<typename type >
requires is_unique_component<type>
constexpr auto get (alphabet_tuple_base &l) noexcept
 Tuple-like access to the contained components.
 
template<size_t index>
constexpr auto get (alphabet_tuple_base const &l) noexcept
 Tuple-like access to the contained components.
 
template<typename type >
requires is_unique_component<type>
constexpr type get (alphabet_tuple_base const &l) noexcept
 Tuple-like access to the contained components.
 

Additional Inherited Members

- Public Member Functions inherited from seqan3::alphabet_base< derived_type,(1 *... *alphabet_size< component_types >), void >
constexpr alphabet_base () noexcept=default
 Defaulted.
 
constexpr alphabet_base (alphabet_base const &) noexcept=default
 Defaulted.
 
constexpr alphabet_base (alphabet_base &&) noexcept=default
 Defaulted.
 
constexpr alphabet_baseoperator= (alphabet_base const &) noexcept=default
 Defaulted.
 
constexpr alphabet_baseoperator= (alphabet_base &&) noexcept=default
 Defaulted.
 
 ~alphabet_base () noexcept=default
 Defaulted.
 
constexpr char_type to_char () const noexcept
 Return the letter as a character of char_type.
 
constexpr rank_type to_rank () const noexcept
 Return the letter's numeric value (rank in the alphabet).
 
constexpr derived_type & assign_char (char_type const chr) noexcept
 Assign from a character, implicitly converts invalid characters.
 
constexpr derived_type & assign_rank (rank_type const c) noexcept
 Assign from a numeric value.
 
- Static Public Attributes inherited from seqan3::alphabet_base< derived_type,(1 *... *alphabet_size< component_types >), void >
static constexpr detail::min_viable_uint_t< size > alphabet_size
 The size of the alphabet, i.e. the number of different values it can take.
 
- Protected Types inherited from seqan3::alphabet_base< derived_type,(1 *... *alphabet_size< component_types >), void >
using char_type = std::conditional_t< std::same_as< void, void >, char, void >
 The char representation; conditional needed to make semi alphabet definitions legal.
 
using rank_type = detail::min_viable_uint_t< size - 1 >
 The type of the alphabet when represented as a number (e.g. via to_rank()).
 

Detailed Description

template<typename derived_type, typename... component_types>
requires (detail::writable_constexpr_semialphabet<component_types> && ...) && (std::regular<component_types> && ...)
class seqan3::alphabet_tuple_base< derived_type, component_types >

The CRTP base for a combined alphabet that contains multiple values of different alphabets at the same time.

.

Template Parameters
component_typesTypes of letters; must model seqan3::detail::writable_constexpr_semialphabet.

This data structure is a CRTP base class for combined alphabets, where the different alphabet letters exist independently as a components, similar to a tuple.

Short description:

  • combines multiple alphabets as independent components, similar to a tuple;
  • models seqan3::tuple_like, i.e. provides a get interface to its component_list;
  • is itself a seqan3::writable_semialphabet, but most derived types implement the full seqan3::writable_alphabet;
  • its alphabet size is the product of the individual sizes;
  • constructible, assignable and comparable with each component type and also all types that these are constructible/assignable/comparable with;
  • explicitly convertible to each of its component types
Attention
This is a "pure base class", you cannot instantiate it, you can only inherit from it. Most likely you are interested in using one of it's descendants like seqan3::qualified or seqan3::masked.

To make a derived class "complete", you should add at least the following:

See also
qualified
masked

This entity is stable. Since version 3.1.

Constructor & Destructor Documentation

◆ alphabet_tuple_base() [1/2]

template<typename derived_type , typename... component_types>
template<typename component_type >
requires (!std::is_base_of_v<alphabet_tuple_base, component_type>) && is_unique_component<component_type>
constexpr seqan3::alphabet_tuple_base< derived_type, component_types >::alphabet_tuple_base ( component_type const  alph)
inlineexplicitconstexprnoexcept

Construction via a value of one of the components.

Template Parameters
component_typeMust be one uniquely contained in the type list of the composite.
Parameters
alphThe value of a component that should be assigned.

Note: Since the alphabet_tuple_base is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
int main()
{
using namespace seqan3::literals;
seqan3::qualified<seqan3::dna4, seqan3::phred42> letter1{'C'_dna4}; // creates {'C'_dna4, '!'_phred42}
seqan3::qualified<seqan3::dna4, seqan3::phred42> letter2{'"'_phred42}; // creates {'A'_dna4, '"'_phred42}
if (letter1 == letter2)
seqan3::debug_stream << "yeah\n"; // yeah
}
Joins an arbitrary alphabet with a quality alphabet.
Definition qualified.hpp:59
Provides seqan3::debug_stream and related types.
Provides seqan3::dna4, container aliases and string literals.
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:37
The SeqAn namespace for literals.
Provides seqan3::phred42 quality scores.
Provides quality alphabet composites.

This entity is stable. Since version 3.1.

◆ alphabet_tuple_base() [2/2]

template<typename derived_type , typename... component_types>
template<typename indirect_component_type >
requires ((detail::instantiate_if_v< detail::lazy<std::is_convertible, indirect_component_type, component_types>, detail::tuple_general_guard<derived_type, indirect_component_type, component_types...>> || ...))
constexpr seqan3::alphabet_tuple_base< derived_type, component_types >::alphabet_tuple_base ( indirect_component_type const  alph)
inlineexplicitconstexprnoexcept

Construction via a value of a subtype that is assignable to one of the components.

Template Parameters
indirect_component_typeType that models seqan3::weakly_assignable_from for one of the component types.
Parameters
alphThe value that should be assigned.

Note that the value will be assigned to the FIRST type T that fulfils assignable_from<T, indirect_component_type>, regardless if other types are also fit for assignment.

Note: Since the alphabet_tuple_base is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
int main()
{
using namespace seqan3::literals;
// The following creates {'C'_dna4, '!'_phred42}
// The following also creates {'C'_dna4, '!'_phred42}, since rna4 assignable to dna4
if (letter1 == letter2)
seqan3::debug_stream << "yeah\n"; // yeah
}
Meta-header for the Alphabet / Nucleotide submodule .

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

Member Function Documentation

◆ operator type()

template<typename derived_type , typename... component_types>
template<typename type >
requires is_unique_component<type>
constexpr seqan3::alphabet_tuple_base< derived_type, component_types >::operator type ( ) const
inlineconstexprnoexcept

Implicit cast to a single letter. Works only if the type is unique in the type list.

This entity is stable. Since version 3.1.

◆ operator=() [1/2]

template<typename derived_type , typename... component_types>
template<typename component_type >
requires (!std::derived_from<component_type, alphabet_tuple_base>) && is_unique_component<component_type>
constexpr derived_type & seqan3::alphabet_tuple_base< derived_type, component_types >::operator= ( component_type const  alph)
inlineconstexprnoexcept

Assignment via a value of one of the components.

Template Parameters
component_typeOne of the component types. Must be uniquely contained in the type list of the composite.
Parameters
alphThe value of a component that should be assigned.

Note: Since the alphabet_tuple_base is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
int main()
{
using namespace seqan3::literals;
seqan3::qualified<seqan3::dna4, seqan3::phred42> letter1{'T'_dna4, '"'_phred42};
letter1 = 'C'_dna4; // yields {'C'_dna4, '"'_phred42}
letter1 = '#'_phred42; // yields {'C'_dna4, '#'_phred42}
}

This entity is stable. Since version 3.1.

◆ operator=() [2/2]

template<typename derived_type , typename... component_types>
template<typename indirect_component_type >
requires ((!std::derived_from<indirect_component_type, alphabet_tuple_base>) && (!is_unique_component<indirect_component_type>) && (std::assignable_from<component_types, indirect_component_type> || ...))
constexpr derived_type & seqan3::alphabet_tuple_base< derived_type, component_types >::operator= ( indirect_component_type const  alph)
inlineconstexprnoexcept

Assignment via a value of a subtype that is assignable to one of the components.

Template Parameters
indirect_component_typeType that models seqan3::weakly_assignable_from for one of the component types.
Parameters
alphThe value of a component that should be assigned.

Note: Since the alphabet_tuple_base is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
int main()
{
using namespace seqan3::literals;
seqan3::qualified<seqan3::dna4, seqan3::phred42> letter1{'T'_dna4, '"'_phred42};
letter1 = 'C'_rna4; // yields {'C'_dna4, '"'_phred42}
}

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

Friends And Related Symbol Documentation

◆ get [1/4]

template<typename derived_type , typename... component_types>
template<size_t index>
constexpr auto get ( alphabet_tuple_base< derived_type, component_types > &  l)
friend

Tuple-like access to the contained components.

Template Parameters
indexReturn the i-th element.
Returns
A proxy to the contained element that models the same alphabets concepts and supports assignment.

This entity is stable. Since version 3.1.

◆ get [2/4]

template<typename derived_type , typename... component_types>
template<typename type >
requires is_unique_component<type>
constexpr auto get ( alphabet_tuple_base< derived_type, component_types > &  l)
friend

Tuple-like access to the contained components.

Template Parameters
typeReturn the element of specified type; only available if the type is unique in the set of components.
Returns
A proxy to the contained element that models the same alphabets concepts and supports assignment.

This entity is stable. Since version 3.1.

◆ get [3/4]

template<typename derived_type , typename... component_types>
template<size_t index>
constexpr auto get ( alphabet_tuple_base< derived_type, component_types > const &  l)
friend

Tuple-like access to the contained components.

Template Parameters
indexReturn the i-th element.
Returns
A copy of the contained element.

This entity is stable. Since version 3.1.

◆ get [4/4]

template<typename derived_type , typename... component_types>
template<typename type >
requires is_unique_component<type>
constexpr type get ( alphabet_tuple_base< derived_type, component_types > const &  l)
friend

Tuple-like access to the contained components.

Template Parameters
typeReturn the element of specified type; only available if the type is unique in the set of components.
Returns
A copy of the contained element.

This entity is stable. Since version 3.1.

◆ operator!= [1/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator!= ( derived_type_t const  lhs,
indirect_component_type const  rhs 
) -> std::enable_if_t< detail::tuple_eq_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator!= [2/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator!= ( indirect_component_type const  lhs,
derived_type_t const  rhs 
) -> std::enable_if_t< detail::tuple_eq_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator< [1/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator< ( derived_type_t const  lhs,
indirect_component_type const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator< [2/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator< ( indirect_component_type const  lhs,
derived_type_t const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator<= [1/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator<= ( derived_type_t const  lhs,
indirect_component_type const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator<= [2/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator<= ( indirect_component_type const  lhs,
derived_type_t const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator== [1/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator== ( derived_type_t const  lhs,
indirect_component_type const  rhs 
) -> std::enable_if_t< detail::tuple_eq_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator== [2/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator== ( indirect_component_type const  lhs,
derived_type_t const  rhs 
) -> std::enable_if_t< detail::tuple_eq_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator> [1/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator> ( derived_type_t const  lhs,
indirect_component_type const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator> [2/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator> ( indirect_component_type const  lhs,
derived_type_t const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator>= [1/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator>= ( derived_type_t const  lhs,
indirect_component_type const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

◆ operator>= [2/2]

template<typename derived_type , typename... component_types>
template<typename derived_type_t , typename indirect_component_type >
constexpr auto operator>= ( indirect_component_type const  lhs,
derived_type_t const  rhs 
) -> std::enable_if_t< detail::tuple_order_guard<derived_type_t, derived_type, indirect_component_type, component_types...>, bool>
friend

Comparison against types comparable with components.

Template Parameters
indirect_component_typeMust be comparable with a component's type.
Parameters
lhsLeft-hand-side of comparison.
rhsRight-hand-side of comparison.
Returns
true or false.

To determine (in-)equality/order, it is first deduced which component the argument is comparable with. The tuple is then cast to that type and the resulting value compared with the argument.

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

Member Data Documentation

◆ cummulative_alph_sizes

template<typename derived_type , typename... component_types>
constexpr std::array<rank_type, component_list::size()> seqan3::alphabet_tuple_base< derived_type, component_types >::cummulative_alph_sizes
staticconstexprprivate
Initial value:
{
[]() constexpr {
ret[0] = 1;
size_t count = 1;
using reverse_list_t = decltype(seqan3::list_traits::detail::reverse(component_list{}));
seqan3::detail::for_each<reverse_list_t>(
[&](auto alphabet_type_identity) constexpr {
using alphabet_t = typename decltype(alphabet_type_identity)::type;
ret[count] = static_cast<rank_type>(seqan3::alphabet_size<alphabet_t> * ret[count - 1]);
++count;
}
);
for (size_t i = 0; i < component_list::size(); ++i)
ret2[i] = ret[component_list::size() - i - 1];
return ret2;
}()
}
detail::min_viable_uint_t< size - 1 > rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition alphabet_base.hpp:77
Type that contains multiple types.
Definition type_list.hpp:26
static constexpr size_t size() noexcept
The number of types contained in the type list.
Definition type_list.hpp:31

The cumulative alphabet size products are cached.

◆ derived_type

template<typename derived_type , typename... component_types>
friend seqan3::alphabet_tuple_base< derived_type, component_types >::derived_type
private

Befriend the derived type so that it can instantiate.

See also
https://isocpp.org/blog/2017/04/quick-q-prevent-user-from-derive-from-incorrect-crtp-base

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