Skip to content

Commit

Permalink
[no ci] Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: rrahn <rene.rahn@fu-berlin.de>
  • Loading branch information
smehringer and rrahn authored Oct 24, 2019
1 parent e0df972 commit dcb703a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If possible, provide tooling that performs the changes, e.g. a shell-script.
#### Argument parser
* Simplified reading file extensions from formatted files in the input/output file validators.
* API break: The seqan3::value_list_validator is now constructible from a range or a parameter pack but not from an
initialiser list any more (e.g. `seqan3::value_list_validator{{1,2,3}}` does **not** work, use
std::initialiser_list any more (e.g. `seqan3::value_list_validator{{1,2,3}}` does **not** work, use
`seqan3::value_list_validator{1,2,3}` instead).
* Enable subcommand argument parsing ([How-to](https://docs.seqan.de/seqan/3-master-user/subcommand_arg_parse.html)).

Expand Down
16 changes: 8 additions & 8 deletions include/seqan3/argument_parser/validators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class arithmetic_range_validator
* exception whenever a given value is not in the given list.
*
* \note In order to simplify the chaining of validators, all ranges of arithmetic types resolve to the validator
* value_type `double` and all types convertible to std::string resolve to value_type std:;string.
* value type `double` and if conversion is possible to the value type std::string. Otherwise, ...
*
* \include test/snippet/argument_parser/validators_2.cpp
*/
Expand All @@ -194,12 +194,12 @@ class value_list_validator

/*!\brief Constructing from a range.
* \tparam range_type The type of range; must model std::ranges::forward_range and value_list_validator::value_type
* must be constructible from the reference type of the given range.
* must be constructible from the rvalue reference type of the given range.
* \param[in] rng The range of valid values to test.
*/
template <std::ranges::forward_range range_type>
//!\cond
requires std::constructible_from<option_value_type, std::ranges::range_reference_t<range_type>>
requires std::constructible_from<option_value_type, std::ranges::range_rvalue_reference_t<range_type>>
//!\endcond
value_list_validator(range_type rng)
{
Expand Down Expand Up @@ -242,7 +242,7 @@ class value_list_validator
{
static_assert(std::convertible_to<value_type_t<range_type>, option_value_type>,
"The value type of the given range must be convertible to the validator::value_type.");
std::for_each(range.begin(), range.end(), [&] (auto cmp) { (*this)(cmp); });
std::for_each(std::ranges::begin(range), std::ranges::end(range), [&] (auto cmp) { (*this)(cmp); });
}

//!\brief Returns a message that can be appended to the (positional) options help page info.
Expand All @@ -268,11 +268,11 @@ value_list_validator(option_types...) -> value_list_validator<double>;
//!\brief Deduction guide for ranges over an arithmetic type.
template <std::ranges::forward_range range_type>
//!\cond
requires arithmetic<value_type_t<range_type>>
requires arithmetic<std::ranges::range_value_t<range_type>>
//!\endcond
value_list_validator(range_type && rng) -> value_list_validator<double>;

//!\brief Deduction guide for a parameter pack over a const char pointer delegates to value type std::string.
//!\brief Given a parameter pack of types that are convertible to std::string, delegate to value type std::string.
template <typename ...option_types>
//!\cond
requires (std::constructible_from<std::string, option_types> && ...)
Expand All @@ -282,7 +282,7 @@ value_list_validator(option_types...) -> value_list_validator<std::string>;
//!\brief Deduction guide for ranges over a value type convertible to std::string.
template <std::ranges::forward_range range_type>
//!\cond
requires std::constructible_from<std::string, value_type_t<range_type>>
requires std::constructible_from<std::string, std::ranges::range_value_t<range_type>>
//!\endcond
value_list_validator(range_type && rng) -> value_list_validator<std::string>;

Expand All @@ -292,7 +292,7 @@ value_list_validator(option_types...) -> value_list_validator<seqan3::pack_trait

//!\brief Deduction guide for ranges.
template <std::ranges::forward_range range_type>
value_list_validator(range_type && rng) -> value_list_validator<value_type_t<range_type>>;
value_list_validator(range_type && rng) -> value_list_validator<std::ranges::range_value_t<range_type>>;
//!\}

/*!\brief An abstract base class for the file and directory validators.
Expand Down

0 comments on commit dcb703a

Please sign in to comment.