42 bitwise_lshift = 1 << 9,
43 bitwise_rshift = 1 << 10,
44 logical_and = 1 << 11,
46 logical_not = 1 << 13,
51 additive = add | subtract,
52 multiplicative = multiply | divide | modulo,
53 bitwise_logic = bitwise_and | bitwise_or | bitwise_xor | bitwise_not,
54 bitwise_shift = bitwise_lshift | bitwise_rshift,
55 logic = logical_and | logical_or | logical_not
66inline constexpr bool add_enum_bitwise_operators<seqan3::detail::strong_type_skill> =
true;
74template <
typename,
typename, strong_type_skill>
100template <
typename strong_type_t>
102 requires (strong_type_t && obj) {
111 requires std::derived_from<std::remove_cvref_t<strong_type_t>,
172template <
typename value_t,
typename derived_t, strong_type_skill skills_ = strong_type_skill::none>
201 constexpr value_t &
get() &
noexcept
207 constexpr value_t
const &
get() const & noexcept
213 constexpr value_t &&
get() &&
noexcept
215 return std::move(
value);
219 constexpr value_t
const &&
get() const && noexcept
221 return std::move(
value);
232 requires ((
skills & strong_type_skill::add) != strong_type_skill::none)
234 return derived_t{
get() + other.get()};
239 requires ((
skills & strong_type_skill::subtract) != strong_type_skill::none)
241 return derived_t{
get() - other.get()};
252 requires ((
skills & strong_type_skill::multiply) != strong_type_skill::none)
254 return derived_t{
get() * other.get()};
259 requires ((
skills & strong_type_skill::divide) != strong_type_skill::none)
261 return derived_t{
get() / other.get()};
266 requires ((
skills & strong_type_skill::modulo) != strong_type_skill::none)
268 return derived_t{
get() % other.get()};
280 requires ((
skills & strong_type_skill::bitwise_and) != strong_type_skill::none)
282 return derived_t{
get() & other.get()};
287 requires ((
skills & strong_type_skill::bitwise_or) != strong_type_skill::none)
289 return derived_t{
get() | other.get()};
294 requires ((
skills & strong_type_skill::bitwise_xor) != strong_type_skill::none)
296 return derived_t{
get() ^ other.get()};
301 requires ((
skills & strong_type_skill::bitwise_not) != strong_type_skill::none)
303 return derived_t{~get()};
315 requires ((
skills & strong_type_skill::bitwise_lshift) != strong_type_skill::none)
317 return derived_t{
get() << other.get()};
321 template <std::
integral
integral_t>
323 requires ((
skills & strong_type_skill::bitwise_lshift) != strong_type_skill::none)
325 return derived_t{
get() << shift};
330 requires ((
skills & strong_type_skill::bitwise_rshift) != strong_type_skill::none)
332 return derived_t{
get() >> other.get()};
336 template <std::
integral
integral_t>
338 requires ((
skills & strong_type_skill::bitwise_rshift) != strong_type_skill::none)
340 return derived_t{
get() >> shift};
352 requires ((
skills & strong_type_skill::logical_and) != strong_type_skill::none)
354 return get() && other.get();
359 requires ((
skills & strong_type_skill::logical_or) != strong_type_skill::none)
361 return get() || other.get();
366 requires ((
skills & strong_type_skill::logical_not) != strong_type_skill::none)
379 requires ((
skills & strong_type_skill::increment) != strong_type_skill::none)
382 return static_cast<derived_t &
>(*this);
387 requires ((
skills & strong_type_skill::increment) != strong_type_skill::none)
389 derived_t tmp{
get()};
396 requires ((
skills & strong_type_skill::decrement) != strong_type_skill::none)
399 return static_cast<derived_t &
>(*this);
404 requires ((
skills & strong_type_skill::decrement) != strong_type_skill::none)
406 derived_t tmp{
get()};
422 requires ((
skills & strong_type_skill::comparable) != strong_type_skill::none)
424 return get() == rhs.get();
429 requires ((
skills & strong_type_skill::comparable) != strong_type_skill::none)
431 return !(*
this == rhs);
441 explicit constexpr operator value_t() const
475template <
typename char_t, derived_from_strong_type strong_type_t>
478 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:75
CRTP base class to declare a strong typedef for a regular type to avoid ambiguous parameter settings ...
Definition strong_type.hpp:174
constexpr derived_t operator>>(strong_type const &other)
Adds bitwise right shift operator to the strong type.
Definition strong_type.hpp:329
constexpr bool operator||(strong_type const &other)
Adds logical or operator to the strong type.
Definition strong_type.hpp:358
constexpr value_t & get() &noexcept
Returns the underlying value.
Definition strong_type.hpp:201
constexpr derived_t operator<<(strong_type const &other)
Adds bitwise left shift operator to the strong type.
Definition strong_type.hpp:314
constexpr derived_t operator&(strong_type const &other)
Adds bitwise and operator to the strong type.
Definition strong_type.hpp:279
constexpr derived_t operator~()
Adds bitwise not operator to the strong type.
Definition strong_type.hpp:300
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:238
constexpr derived_t operator--(int)
Adds post-decrement operator to the strong type.
Definition strong_type.hpp:403
static constexpr strong_type_skill skills
The selected skills for this type.
Definition strong_type.hpp:177
constexpr bool operator!=(strong_type const &rhs) const
Return whether this instance is not equal to rhs.
Definition strong_type.hpp:428
constexpr derived_t operator++(int)
Adds post-increment operator to the strong type.
Definition strong_type.hpp:386
constexpr value_t const & get() const &noexcept
Returns the underlying value.
Definition strong_type.hpp:207
constexpr derived_t operator>>(integral_t const shift)
Adds bitwise right shift operator to the strong type.
Definition strong_type.hpp:337
constexpr bool operator!()
Adds logical not operator to the strong type.
Definition strong_type.hpp:365
value_t value_type
The underlying value type.
Definition strong_type.hpp:179
constexpr value_t && get() &&noexcept
Returns the underlying value as rvalue.
Definition strong_type.hpp:213
value_t value
The underlying value, which is wrapped as a strong type.
Definition strong_type.hpp:450
constexpr derived_t operator^(strong_type const &other)
Adds bitwise xor operator to the strong type.
Definition strong_type.hpp:293
constexpr derived_t & operator++()
Adds pre-increment operator to the strong type.
Definition strong_type.hpp:378
constexpr bool operator==(strong_type const &rhs) const
Return whether this instance is equal to rhs.
Definition strong_type.hpp:421
constexpr derived_t & operator--()
Adds pre-decrement operator to the strong type.
Definition strong_type.hpp:395
constexpr derived_t operator%(strong_type const &other)
Adds modulo operator to the strong type.
Definition strong_type.hpp:265
constexpr value_t const && get() const &&noexcept
Returns the underlying value as rvalue.
Definition strong_type.hpp:219
constexpr derived_t operator/(strong_type const &other)
Adds division operator to the strong type.
Definition strong_type.hpp:258
constexpr derived_t operator+(strong_type const &other)
Adds addition operator to the strong type.
Definition strong_type.hpp:231
constexpr derived_t operator<<(integral_t const shift)
Adds bitwise left shift operator to the strong type.
Definition strong_type.hpp:322
constexpr derived_t operator*(strong_type const &other)
Adds multiplication operator to the strong type.
Definition strong_type.hpp:251
constexpr bool operator&&(strong_type const &other)
Adds logical and operator to the strong type.
Definition strong_type.hpp:351
constexpr derived_t operator|(strong_type const &other)
Adds bitwise or operator to the strong type.
Definition strong_type.hpp:286
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:107
@ 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:31
Defines the requirements of a seqan3::detail::strong_type specialisation.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.