Skip to content

Commit

Permalink
[ci skip] Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Enrico Seiler <eseiler@users.noreply.github.com>
  • Loading branch information
smehringer and eseiler authored Sep 10, 2019
1 parent 6201278 commit dbbed0b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions include/seqan3/argument_parser/argument_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ class argument_parser
*/
template <typename option_type, validator validator_type = detail::default_validator<option_type>>
//!\cond
requires (argument_parser_compatible_option<option_type> ||
argument_parser_compatible_option<typename option_type::value_type>) &&
requires (argument_parser_compatible_option<option_type> ||
argument_parser_compatible_option<typename option_type::value_type>) &&
std::invocable<validator_type, option_type>
//!\endcond
void add_option(option_type & value,
Expand Down Expand Up @@ -292,9 +292,9 @@ class argument_parser
*/
template <typename option_type, validator validator_type = detail::default_validator<option_type>>
//!\cond
requires (argument_parser_compatible_option<option_type> ||
argument_parser_compatible_option<typename option_type::value_type>) &&
std::invocable<validator_type, option_type>
requires (argument_parser_compatible_option<option_type> ||
argument_parser_compatible_option<typename option_type::value_type>) &&
std::invocable<validator_type, option_type>
//!\endcond
void add_positional_option(option_type & value,
std::string const & desc,
Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/argument_parser/auxiliary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace seqan3::custom
* Please note that by default the `t const`, `t &` and `t const &` specialisations of this class inherit the
* specialisation for `t` so you usually only need to provide a specialisation for `t`.
*
* \note Only use this, if you cannot provide respective functions in your namespace.
* \note Only use this if you cannot provide respective functions in your namespace.
*/
template <typename t>
struct string_convertiblity
Expand Down Expand Up @@ -100,7 +100,7 @@ namespace seqan3

/*!\brief Return the rank representation of a (semi-)alphabet object.
* \tparam your_type Type of the argument.
* \param alph The (semi-)alphabet object.
* \param alph The (semi-)alphabet object.
* \returns The rank representation; an integral type.
* \ingroup alphabet
* \details
Expand Down
2 changes: 1 addition & 1 deletion include/seqan3/argument_parser/detail/format_parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class format_parse : public format_base
auto it = seqan3::string_conversion_map(value).find(tmp);

if (it == seqan3::string_conversion_map(value).end())
throw type_conversion_failed("Argument " + in + " could not be casted to enum type " +
throw type_conversion_failed("Argument " + in + " could not be cast to enum type " +
get_display_name_v<option_t>.str() + ".");
else
value = it->second;
Expand Down
2 changes: 1 addition & 1 deletion test/snippet/argument_parser/string_conversion_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main(int argc, char const * argv[])

// Because of the string_conversion_map function
// you can now add an option that takes a value of type Foo:
parser.add_option(value, 'f', "foo", "Give me a value foo value.");
parser.add_option(value, 'f', "foo", "Give me a foo value.");

try
{
Expand Down
8 changes: 4 additions & 4 deletions test/snippet/argument_parser/string_convertible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

namespace seqan3::custom
{
// specialise the seqan3::custom::string_convertiblity data structure to enable parsing of std::errc.
// Specialise the seqan3::custom::string_convertiblity data structure to enable parsing of std::errc.
template <>
struct string_convertiblity<std::errc>
{
// specialise a mapping from your values of type Foo to the respective string
// Specialise a mapping from your values of type Foo to the respective string.
static auto string_conversion_map(std::errc)
{
return std::unordered_map<std::string, std::errc>
Expand All @@ -29,8 +29,8 @@ int main(int argc, char const * argv[])

// Because of the string_convertiblity struct and
// the static member function string_conversion_map
// you can now add an option that takes a value of type Foo:
parser.add_option(value, 'e', "errc", "Give me a value std::errc value.");
// you can now add an option that takes a value of type std::errc:
parser.add_option(value, 'e', "errc", "Give me a std::errc value.");

try
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/argument_parser/format_parse_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ auto string_conversion_map(Foo)
{
return std::unordered_map<std::string, Foo>{{{"one", Foo::one}, {"two", Foo::two}, {"three", Foo::three}}};
}
} // namespace bar
} // namespace Bar

namespace Other
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core/debug_stream_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ TEST(debug_stream_test, string_convertible)
o.flush();
EXPECT_EQ(o.str(), "one");

fo = Foo::three; // unknown to the converion map
fo = Foo::three; // unknown to the conversion map

my_stream << fo;
o.flush();
Expand Down

0 comments on commit dbbed0b

Please sign in to comment.