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>
108 requires std::derived_from<std::remove_cvref_t<strong_type_t>,
109 strong_type<typename std::remove_reference_t<strong_type_t>::value_type,
169template <
typename value_t,
typename derived_t, strong_type_skill skills_ = strong_type_skill::none>
198 constexpr value_t &
get() &
noexcept
198 constexpr value_t &
get() &
noexcept {
…}
204 constexpr value_t
const &
get() const & noexcept
204 constexpr value_t
const &
get() const & noexcept {
…}
210 constexpr value_t &&
get() &&
noexcept
212 return std::move(
value);
210 constexpr value_t &&
get() &&
noexcept {
…}
216 constexpr value_t
const &&
get() const && noexcept
218 return std::move(
value);
216 constexpr value_t
const &&
get() const && noexcept {
…}
229 requires ((
skills & strong_type_skill::add) != strong_type_skill::none)
231 return derived_t{
get() + other.get()};
236 requires ((
skills & strong_type_skill::subtract) != strong_type_skill::none)
238 return derived_t{
get() - other.get()};
249 requires ((
skills & strong_type_skill::multiply) != strong_type_skill::none)
251 return derived_t{
get() * other.get()};
256 requires ((
skills & strong_type_skill::divide) != strong_type_skill::none)
258 return derived_t{
get() / other.get()};
263 requires ((
skills & strong_type_skill::modulo) != strong_type_skill::none)
265 return derived_t{
get() % other.get()};
277 requires ((
skills & strong_type_skill::bitwise_and) != strong_type_skill::none)
279 return derived_t{
get() & other.get()};
284 requires ((
skills & strong_type_skill::bitwise_or) != strong_type_skill::none)
286 return derived_t{
get() | other.get()};
291 requires ((
skills & strong_type_skill::bitwise_xor) != strong_type_skill::none)
293 return derived_t{
get() ^ other.get()};
298 requires ((
skills & strong_type_skill::bitwise_not) != strong_type_skill::none)
300 return derived_t{~get()};
312 requires ((
skills & strong_type_skill::bitwise_lshift) != strong_type_skill::none)
314 return derived_t{
get() << other.get()};
318 template <std::
integral
integral_t>
320 requires ((
skills & strong_type_skill::bitwise_lshift) != strong_type_skill::none)
322 return derived_t{
get() << shift};
327 requires ((
skills & strong_type_skill::bitwise_rshift) != strong_type_skill::none)
329 return derived_t{
get() >> other.get()};
333 template <std::
integral
integral_t>
335 requires ((
skills & strong_type_skill::bitwise_rshift) != strong_type_skill::none)
337 return derived_t{
get() >> shift};
349 requires ((
skills & strong_type_skill::logical_and) != strong_type_skill::none)
351 return get() && other.get();
356 requires ((
skills & strong_type_skill::logical_or) != strong_type_skill::none)
358 return get() || other.get();
363 requires ((
skills & strong_type_skill::logical_not) != strong_type_skill::none)
376 requires ((
skills & strong_type_skill::increment) != strong_type_skill::none)
379 return static_cast<derived_t &
>(*this);
384 requires ((
skills & strong_type_skill::increment) != strong_type_skill::none)
386 derived_t tmp{
get()};
393 requires ((
skills & strong_type_skill::decrement) != strong_type_skill::none)
396 return static_cast<derived_t &
>(*this);
401 requires ((
skills & strong_type_skill::decrement) != strong_type_skill::none)
403 derived_t tmp{
get()};
419 requires ((
skills & strong_type_skill::comparable) != strong_type_skill::none)
421 return get() == rhs.get();
426 requires ((
skills & strong_type_skill::comparable) != strong_type_skill::none)
428 return !(*
this == rhs);
438 explicit constexpr operator value_t() const
438 explicit constexpr operator value_t() const {
…}
458template <detail::derived_from_strong_type strong_type_t>
467 template <
typename stream_t,
typename arg_t>
468 constexpr void operator()(stream_t & stream, arg_t && arg)
const
468 constexpr void operator()(stream_t & stream, arg_t && arg)
const {
…}
Provides seqan3::add_enum_bitwise_operators.
Provides various type traits on generic types.
CRTP base class to declare a strong typedef for a regular type to avoid ambiguous parameter settings ...
Definition strong_type.hpp:171
constexpr derived_t operator>>(strong_type const &other)
Adds bitwise right shift operator to the strong type.
Definition strong_type.hpp:326
constexpr bool operator||(strong_type const &other)
Adds logical or operator to the strong type.
Definition strong_type.hpp:355
constexpr value_t & get() &noexcept
Returns the underlying value.
Definition strong_type.hpp:198
constexpr derived_t operator<<(strong_type const &other)
Adds bitwise left shift operator to the strong type.
Definition strong_type.hpp:311
constexpr derived_t operator&(strong_type const &other)
Adds bitwise and operator to the strong type.
Definition strong_type.hpp:276
constexpr derived_t operator~()
Adds bitwise not operator to the strong type.
Definition strong_type.hpp:297
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:235
constexpr derived_t operator--(int)
Adds post-decrement operator to the strong type.
Definition strong_type.hpp:400
static constexpr strong_type_skill skills
The selected skills for this type.
Definition strong_type.hpp:174
constexpr bool operator!=(strong_type const &rhs) const
Return whether this instance is not equal to rhs.
Definition strong_type.hpp:425
constexpr derived_t operator++(int)
Adds post-increment operator to the strong type.
Definition strong_type.hpp:383
constexpr value_t const & get() const &noexcept
Returns the underlying value.
Definition strong_type.hpp:204
constexpr derived_t operator>>(integral_t const shift)
Adds bitwise right shift operator to the strong type.
Definition strong_type.hpp:334
constexpr bool operator!()
Adds logical not operator to the strong type.
Definition strong_type.hpp:362
value_t value_type
The underlying value type.
Definition strong_type.hpp:176
constexpr value_t && get() &&noexcept
Returns the underlying value as rvalue.
Definition strong_type.hpp:210
value_t value
The underlying value, which is wrapped as a strong type.
Definition strong_type.hpp:447
constexpr derived_t operator^(strong_type const &other)
Adds bitwise xor operator to the strong type.
Definition strong_type.hpp:290
constexpr derived_t & operator++()
Adds pre-increment operator to the strong type.
Definition strong_type.hpp:375
constexpr bool operator==(strong_type const &rhs) const
Return whether this instance is equal to rhs.
Definition strong_type.hpp:418
constexpr derived_t & operator--()
Adds pre-decrement operator to the strong type.
Definition strong_type.hpp:392
constexpr derived_t operator%(strong_type const &other)
Adds modulo operator to the strong type.
Definition strong_type.hpp:262
constexpr value_t const && get() const &&noexcept
Returns the underlying value as rvalue.
Definition strong_type.hpp:216
constexpr derived_t operator/(strong_type const &other)
Adds division operator to the strong type.
Definition strong_type.hpp:255
constexpr derived_t operator+(strong_type const &other)
Adds addition operator to the strong type.
Definition strong_type.hpp:228
constexpr derived_t operator<<(integral_t const shift)
Adds bitwise left shift operator to the strong type.
Definition strong_type.hpp:319
constexpr derived_t operator*(strong_type const &other)
Adds multiplication operator to the strong type.
Definition strong_type.hpp:248
constexpr bool operator&&(strong_type const &other)
Adds logical and operator to the strong type.
Definition strong_type.hpp:348
constexpr derived_t operator|(strong_type const &other)
Adds bitwise or operator to the strong type.
Definition strong_type.hpp:283
Provides seqan3::debug_stream and related types.
@ 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.
constexpr void operator()(stream_t &stream, arg_t &&arg) const
Prints the stored value of the given strong type.
Definition strong_type.hpp:468
Definition default_printer.hpp:48