Skip to content

Commit

Permalink
Reuse is_char_adaptation_v concept from char adaption header.
Browse files Browse the repository at this point in the history
The char adaption header was included anyway, so we can also use the concept defined there.
  • Loading branch information
rrahn committed Jul 26, 2024
1 parent 3b22693 commit b9ace90
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions include/seqan3/core/debug_stream/range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,33 +161,19 @@ struct sequence_printer<sequence_t>
}
};

/*!
* \brief Checks if a type is a character type.
*
* Checks whether `type` is a character type. Evaluates to `true`, if `type` is the type `char`, `char8_t`, `char16_t`,
* `char32_t`, or `wchar_t`, including cv-qualified variants. Otherwise, evaluates to `false`.
*
* \tparam type The type to check.
* \ingroup core_debug_stream
*/
template <typename type>
static constexpr bool is_char_type_v =
std::same_as<type, char> || std::same_as<type, char8_t> || std::same_as<type, char16_t>
|| std::same_as<type, char32_t> || std::same_as<type, wchar_t>;

/*!
* \brief A printer for character sequences.
* \ingroup core_debug_stream
*
* This struct provides a printer for character sequences. It is used to print character sequences to a stream.
* The character sequence must be an input range and the range reference type must be a character type, i.e.
* seqan3::is_char_type_v evaluates to `true`.
* seqan3::detail::is_char_adaptation_v evaluates to `true`.
*
* \tparam char_sequence_t The type of the character sequence.
*/
template <typename char_sequence_t>
requires std::ranges::input_range<char_sequence_t>
&& (is_char_type_v<std::remove_cvref_t<std::ranges::range_reference_t<char_sequence_t>>>)
&& (detail::is_char_adaptation_v<std::remove_cvref_t<std::ranges::range_reference_t<char_sequence_t>>>)
struct char_sequence_printer<char_sequence_t>
{
/*!
Expand Down

0 comments on commit b9ace90

Please sign in to comment.