Provides core functionality used by multiple modules.
More...
|
| Algorithm |
| Provides core functionality used to configure algorithms.
|
|
| builtin_character operations |
| Provides various operations on character types.
|
|
| Concept |
| Additional concepts that are not specific to a SeqAn module.
|
|
| Parallel |
| This module contains types and utilities for concurrent execution of algorithms in SeqAn.
|
|
| Type List |
| Provides seqan3::type_list and metaprogramming utilities for working on type lists and type packs.
|
|
| Type Traits |
| Provides various type traits and their shortcuts.
|
|
|
using | seqan3::semiregular_box = ::ranges::semiregular_box |
| Utility wrapper that behaves like std::optional but makes the type conform with the std::semiregular concept. Imported from ranges::semiregular_box. More...
|
|
using | seqan3::semiregular_box_t = ::ranges::semiregular_box_t |
| Utility transformation trait to get a wrapper type that models std::semiregular. Imported from ranges::semiregular_box_t. More...
|
|
|
template<typename base_t , std::unsigned_integral exp_t> |
base_t | seqan3::pow (base_t base, exp_t exp) |
| Computes the value of base raised to the power exp . More...
|
|
|
Helper functions for tuple like objects.
|
template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts> |
constexpr auto | seqan3::tuple_split (tuple_t< ts... > const &t) |
| Splits a tuple like data structure at the given position. More...
|
|
template<typename pivot_t , tuple_like tuple_t> |
constexpr auto | seqan3::tuple_split (tuple_t &&t) |
| Splits a tuple like data structure at the first position of the given type. More...
|
|
template<tuple_like tuple_t> |
constexpr auto | seqan3::tuple_pop_front (tuple_t &&t) |
| Removes the first element of a tuple. More...
|
|
template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts> |
constexpr auto | seqan3::tuple_split (tuple_t< ts... > &&t) |
| Splits a tuple like data structure at the given position. More...
|
|
Provides core functionality used by multiple modules.
The core module contains concepts, functions and some classes that are used by multiple other modules, but that usually are not relevant to most users of the library.
◆ semiregular_box
◆ semiregular_box_t
◆ pow()
template<typename base_t , std::unsigned_integral exp_t>
base_t seqan3::pow |
( |
base_t |
base, |
|
|
exp_t |
exp |
|
) |
| |
Computes the value of base
raised to the power exp
.
- Parameters
-
[in] | base | The base to compute the power for. |
[in] | exp | The power to raise base to. |
- Returns
.
- Exceptions
-
- See also
- https://en.cppreference.com/w/cpp/numeric/math/pow
The difference to std::pow
is that the powers of an integer base
are computed exact (without precision loss due to promoting to double
) iff exp_t
models std::unsigned_integral
and
base_t
models std::unsigned_integral
(returns uint64_t
)
base_t
models std::integral
, but not std::unsigned_integral
(returns int64_t
)
In all other cases the return value and type is equivalent to that of std::pow
.
Example
int main()
{
seqan3::debug_stream << static_cast<uint64_t>(
std::pow(5u, 25u)) <<
'\n';
}
◆ tuple_pop_front()
template<tuple_like tuple_t>
constexpr auto seqan3::tuple_pop_front |
( |
tuple_t && |
t | ) |
|
|
constexpr |
Removes the first element of a tuple.
- Parameters
-
- Returns
- A new tuple without the first element of
t
.
Note, that the tuple must contain at least one element and must support empty tuple types, i.e. std::pair cannot be used.
Complexity
Linear in the number of elements.
Thread safety
Concurrent invocations of this functions are thread safe.
◆ tuple_split() [1/3]
template<typename pivot_t , tuple_like tuple_t>
constexpr auto seqan3::tuple_split |
( |
tuple_t && |
t | ) |
|
|
constexpr |
Splits a tuple like data structure at the first position of the given type.
- Template Parameters
-
pivot_t | A template type specifying the split position. |
- Parameters
-
[in] | t | The original tuple to split. |
- Returns
- A new tuple of tuples with the left side of the split and the right side of the split.
Splits a tuple into two tuples, while the element at the split position will be contained in the second tuple. Note, that the returned tuples can be empty. For this reason it is not possible to use tuple like objects, that cannot be empty, i.e. std::pair. Using such an object will emit an compiler error.
example
int main()
{
auto [
left,
right] = seqan3::tuple_split<2>(t);
auto [left1, right1] = seqan3::tuple_split<0>(t);
auto [left2, right2] = seqan3::tuple_split<4>(t);
}
Complexity
Linear in the number of elements.
Thread safety
Concurrent invocations of this functions are thread safe.
◆ tuple_split() [2/3]
template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts>
constexpr auto seqan3::tuple_split |
( |
tuple_t< ts... > && |
t | ) |
|
|
constexpr |
Splits a tuple like data structure at the given position.
- Template Parameters
-
pivot_c | A template value specifying the split position. |
tuple_t | A template alias for a tuple like object. |
...ts | Types tuple_t is specified with. |
- Parameters
-
[in] | t | The original tuple to split. |
- Returns
- A new tuple of tuples with the left side of the split and the right side of the split.
Splits a tuple into two tuples, while the element at the split position will be contained in the second tuple. Note, that the returned tuples can be empty. For this reason it is not possible to use tuple like objects, that cannot be empty, i.e. std::pair. Using such an object will emit an compiler error.
example
int main()
{
auto [
left,
right] = seqan3::tuple_split<2>(t);
auto [left1, right1] = seqan3::tuple_split<0>(t);
auto [left2, right2] = seqan3::tuple_split<4>(t);
}
Complexity
Linear in the number of elements.
Thread safety
Concurrent invocations of this functions are thread safe.
◆ tuple_split() [3/3]
template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts>
constexpr auto seqan3::tuple_split |
( |
tuple_t< ts... > const & |
t | ) |
|
|
constexpr |
Splits a tuple like data structure at the given position.
- Template Parameters
-
pivot_c | A template value specifying the split position. |
tuple_t | A template alias for a tuple like object. |
...ts | Types tuple_t is specified with. |
- Parameters
-
[in] | t | The original tuple to split. |
- Returns
- A new tuple of tuples with the left side of the split and the right side of the split.
Splits a tuple into two tuples, while the element at the split position will be contained in the second tuple. Note, that the returned tuples can be empty. For this reason it is not possible to use tuple like objects, that cannot be empty, i.e. std::pair. Using such an object will emit an compiler error.
example
int main()
{
auto [
left,
right] = seqan3::tuple_split<2>(t);
auto [left1, right1] = seqan3::tuple_split<0>(t);
auto [left2, right2] = seqan3::tuple_split<4>(t);
}
Complexity
Linear in the number of elements.
Thread safety
Concurrent invocations of this functions are thread safe.
◆ add_enum_bitwise_operators
template<typename t >
constexpr bool seqan3::add_enum_bitwise_operators = false |
|
constexpr |
Set to true for a scoped enum to have binary operators overloaded.
If this type trait is specialised for an enum, the binary operators &
, |
, ^
, ~
, &=
, |=
, ^=
will be added and behave just like for ints or unscoped enums.
Example
enum class my_enum
{
VAL1 = 1,
VAL2 = 2,
COMB = 3
};
template <>
constexpr bool seqan3::add_enum_bitwise_operators<my_enum> = true;
int main()
{
using seqan3::operator|;
my_enum e = my_enum::VAL1;
my_enum e2 = e | my_enum::VAL2;
}