45 bitwise_lshift = 1 << 9,
46 bitwise_rshift = 1 << 10,
47 logical_and = 1 << 11,
49 logical_not = 1 << 13,
54 additive = add | subtract,
55 multiplicative = multiply | divide | modulo,
56 bitwise_logic = bitwise_and | bitwise_or | bitwise_xor | bitwise_not,
57 bitwise_shift = bitwise_lshift | bitwise_rshift,
58 logic = logical_and | logical_or | logical_not
69constexpr bool add_enum_bitwise_operators<seqan3::detail::strong_type_skill> =
true;
77template <
typename,
typename, strong_type_skill>
103template <
typename strong_type_t>
105 requires (strong_type_t && obj) {
114 requires std::derived_from<std::remove_cvref_t<strong_type_t>,
175template <
typename value_t,
typename derived_t, strong_type_skill skills_ = strong_type_skill::none>
204 constexpr value_t &
get() &
noexcept
210 constexpr value_t
const &
get() const & noexcept
216 constexpr value_t &&
get() &&
noexcept
218 return std::move(
value);
222 constexpr value_t
const &&
get() const && noexcept
224 return std::move(
value);
235 requires ((
skills & strong_type_skill::add) != strong_type_skill::none)
237 return derived_t{
get() + other.get()};
242 requires ((
skills & strong_type_skill::subtract) != strong_type_skill::none)
244 return derived_t{
get() - other.get()};
255 requires ((
skills & strong_type_skill::multiply) != strong_type_skill::none)
257 return derived_t{
get() * other.get()};
262 requires ((
skills & strong_type_skill::divide) != strong_type_skill::none)
264 return derived_t{
get() / other.get()};
269 requires ((
skills & strong_type_skill::modulo) != strong_type_skill::none)
271 return derived_t{
get() % other.get()};
283 requires ((
skills & strong_type_skill::bitwise_and) != strong_type_skill::none)
285 return derived_t{
get() & other.get()};
290 requires ((
skills & strong_type_skill::bitwise_or) != strong_type_skill::none)
292 return derived_t{
get() | other.get()};
297 requires ((
skills & strong_type_skill::bitwise_xor) != strong_type_skill::none)
299 return derived_t{
get() ^ other.get()};
304 requires ((
skills & strong_type_skill::bitwise_not) != strong_type_skill::none)
306 return derived_t{~get()};
318 requires ((
skills & strong_type_skill::bitwise_lshift) != strong_type_skill::none)
320 return derived_t{
get() << other.get()};
324 template <std::
integral
integral_t>
326 requires ((
skills & strong_type_skill::bitwise_lshift) != strong_type_skill::none)
328 return derived_t{
get() << shift};
333 requires ((
skills & strong_type_skill::bitwise_rshift) != strong_type_skill::none)
335 return derived_t{
get() >> other.get()};
339 template <std::
integral
integral_t>
341 requires ((
skills & strong_type_skill::bitwise_rshift) != strong_type_skill::none)
343 return derived_t{
get() >> shift};
355 requires ((
skills & strong_type_skill::logical_and) != strong_type_skill::none)
357 return get() && other.get();
362 requires ((
skills & strong_type_skill::logical_or) != strong_type_skill::none)
364 return get() || other.get();
369 requires ((
skills & strong_type_skill::logical_not) != strong_type_skill::none)
382 requires ((
skills & strong_type_skill::increment) != strong_type_skill::none)
385 return static_cast<derived_t &
>(*this);
390 requires ((
skills & strong_type_skill::increment) != strong_type_skill::none)
392 derived_t tmp{
get()};
399 requires ((
skills & strong_type_skill::decrement) != strong_type_skill::none)
402 return static_cast<derived_t &
>(*this);
407 requires ((
skills & strong_type_skill::decrement) != strong_type_skill::none)
409 derived_t tmp{
get()};
425 requires ((
skills & strong_type_skill::comparable) != strong_type_skill::none)
427 return get() == rhs.get();
432 requires ((
skills & strong_type_skill::comparable) != strong_type_skill::none)
434 return !(*
this == rhs);
444 explicit constexpr operator value_t() const
478template <
typename char_t, derived_from_strong_type strong_type_t>
481 stream << value.get();
Provides seqan3::add_enum_bitwise_operators.
Provides various type traits on generic types.
A "pretty printer" for most SeqAn data structures and related types.
Definition: debug_stream_type.hpp:78
CRTP base class to declare a strong typedef for a regular type to avoid ambiguous parameter settings ...
Definition: strong_type.hpp:177
constexpr derived_t operator>>(strong_type const &other)
Adds bitwise right shift operator to the strong type.
Definition: strong_type.hpp:332
constexpr bool operator||(strong_type const &other)
Adds logical or operator to the strong type.
Definition: strong_type.hpp:361
constexpr value_t & get() &noexcept
Returns the underlying value.
Definition: strong_type.hpp:204
constexpr derived_t operator<<(strong_type const &other)
Adds bitwise left shift operator to the strong type.
Definition: strong_type.hpp:317
constexpr derived_t operator&(strong_type const &other)
Adds bitwise and operator to the strong type.
Definition: strong_type.hpp:282
constexpr derived_t operator~()
Adds bitwise not operator to the strong type.
Definition: strong_type.hpp:303
constexpr strong_type() noexcept=default
Defaulted.
constexpr derived_t operator-(strong_type const &other)
Adds subtraction operator to the strong type.
Definition: strong_type.hpp:241
constexpr derived_t operator--(int)
Adds post-decrement operator to the strong type.
Definition: strong_type.hpp:406
static constexpr strong_type_skill skills
The selected skills for this type.
Definition: strong_type.hpp:180
constexpr bool operator!=(strong_type const &rhs) const
Return whether this instance is not equal to rhs.
Definition: strong_type.hpp:431
constexpr derived_t operator++(int)
Adds post-increment operator to the strong type.
Definition: strong_type.hpp:389
constexpr value_t const & get() const &noexcept
Returns the underlying value.
Definition: strong_type.hpp:210
constexpr derived_t operator>>(integral_t const shift)
Adds bitwise right shift operator to the strong type.
Definition: strong_type.hpp:340
constexpr bool operator!()
Adds logical not operator to the strong type.
Definition: strong_type.hpp:368
value_t value_type
The underlying value type.
Definition: strong_type.hpp:182
constexpr value_t && get() &&noexcept
Returns the underlying value as rvalue.
Definition: strong_type.hpp:216
value_t value
The underlying value, which is wrapped as a strong type.
Definition: strong_type.hpp:453
constexpr derived_t operator^(strong_type const &other)
Adds bitwise xor operator to the strong type.
Definition: strong_type.hpp:296
constexpr derived_t & operator++()
Adds pre-increment operator to the strong type.
Definition: strong_type.hpp:381
constexpr bool operator==(strong_type const &rhs) const
Return whether this instance is equal to rhs.
Definition: strong_type.hpp:424
constexpr derived_t & operator--()
Adds pre-decrement operator to the strong type.
Definition: strong_type.hpp:398
constexpr derived_t operator%(strong_type const &other)
Adds modulo operator to the strong type.
Definition: strong_type.hpp:268
constexpr value_t const && get() const &&noexcept
Returns the underlying value as rvalue.
Definition: strong_type.hpp:222
constexpr derived_t operator/(strong_type const &other)
Adds division operator to the strong type.
Definition: strong_type.hpp:261
constexpr derived_t operator+(strong_type const &other)
Adds addition operator to the strong type.
Definition: strong_type.hpp:234
constexpr derived_t operator<<(integral_t const shift)
Adds bitwise left shift operator to the strong type.
Definition: strong_type.hpp:325
constexpr derived_t operator*(strong_type const &other)
Adds multiplication operator to the strong type.
Definition: strong_type.hpp:254
constexpr bool operator&&(strong_type const &other)
Adds logical and operator to the strong type.
Definition: strong_type.hpp:354
constexpr derived_t operator|(strong_type const &other)
Adds bitwise or operator to the strong type.
Definition: strong_type.hpp:289
Provides seqan3::debug_stream and related types.
debug_stream_type< char_t > & operator<<(debug_stream_type< char_t > &stream, alignment_t &&alignment)
Stream operator for alignments, which are represented as tuples of aligned sequences.
Definition: debug_stream_alignment.hpp:110
@ none
The corresponding alignment coordinate will not be incrementable/decrementable.
strong_type_skill
Enum class for all supported operations that can be added to a seqan3::detail::strong_type.
Definition: strong_type.hpp:34
Defines the requirements of a seqan::detail::strong_type specialisation.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.