From 29367681ef9ac93e3ded0f27cd2f224838f9e2ee Mon Sep 17 00:00:00 2001 From: Svenja Mehringer Date: Wed, 12 Jan 2022 12:17:58 +0100 Subject: [PATCH] [MISC] Remove dependency of seqan3::arithmetic by using std::is_arithmetic_v. --- include/sharg/detail/format_parse.hpp | 8 ++++---- include/sharg/validators.hpp | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/sharg/detail/format_parse.hpp b/include/sharg/detail/format_parse.hpp index 95de23bf..a422fd68 100644 --- a/include/sharg/detail/format_parse.hpp +++ b/include/sharg/detail/format_parse.hpp @@ -385,7 +385,7 @@ class format_parse : public format_base } /*!\brief Tries to parse an input string into an arithmetic value. - * \tparam option_t The option value type; must model seqan3::arithmetic. + * \tparam option_t The option value type; must model std::is_arithmetic_v. * \param[out] value Stores the parsed value. * \param[in] in The input argument to be parsed. * \returns sharg::option_parse_result::error if `in` could not be parsed to an arithmetic type @@ -396,9 +396,9 @@ class format_parse : public format_base * * This function delegates to std::from_chars. */ - template + template //!\cond - requires seqan3::input_stream_over + requires std::is_arithmetic_v && seqan3::input_stream_over //!\endcond option_parse_result parse_option_value(option_t & value, std::string const & in) { @@ -458,7 +458,7 @@ class format_parse : public format_base get_type_name_as_string(option_type{}) + "."}; } - if constexpr (seqan3::arithmetic) + if constexpr (std::is_arithmetic_v) { if (res == option_parse_result::overflow_error) { diff --git a/include/sharg/validators.hpp b/include/sharg/validators.hpp index 1809252a..66003d5f 100644 --- a/include/sharg/validators.hpp +++ b/include/sharg/validators.hpp @@ -57,7 +57,7 @@ concept validator = std::copyable> && /*!\brief A validator that checks whether a number is inside a given range. * \ingroup argument_parser * \implements sharg::validator - * \tparam option_value_t The value type of the range; must model seqan3::arithmetic . + * \tparam option_value_t The value type of the range; must model std::is_arithmetic_v. * * \details * @@ -69,7 +69,10 @@ concept validator = std::copyable> && * * \remark For a complete overview, take a look at \ref argument_parser */ -template +template +//!\cond + requires std::is_arithmetic_v +//!\endcond class arithmetic_range_validator { public: @@ -96,13 +99,13 @@ class arithmetic_range_validator /*!\brief Tests whether every element in \p range lies inside [`min`, `max`]. * \tparam range_type The type of range to check; must model std::ranges::forward_range. The value type must model - * seqan3::arithmetic. + * std::is_arithmetic_v. * \param range The input range to iterate over and check every element. * \throws sharg::validation_error */ template //!\cond - requires seqan3::arithmetic> + requires std::is_arithmetic_v> //!\endcond void operator()(range_type const & range) const {