Skip to content

Commit 35a6eec

Browse files
Call member functions directly
1 parent 77eef5c commit 35a6eec

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

args.ipp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,31 @@ constexpr auto operator|(spec lhs, spec rhs)
3131
namespace
3232
{
3333

34-
using std::begin, std::end, std::size;
35-
3634
//! @brief check if `s` is a valid short option
3735
constexpr bool is_short_option(std::string_view s)
3836
{
39-
return size(s) == 2 && s[0] == '-' && std::isalnum(s[1]);
37+
return s.size() == 2 && s[0] == '-' && std::isalnum(s[1]);
4038
}
4139

4240
//! @brief check if `s` is a valid long option
4341
constexpr bool is_long_option(std::string_view s)
4442
{
45-
return size(s) > 2 && s[0] == '-' && s[1] == '-' && s[2] != '-'
46-
&& std::all_of(begin(s) + 2, end(s), [](char c){ return c == '-' || std::isalnum(c); });
43+
return s.size() > 2 && s[0] == '-' && s[1] == '-' && s[2] != '-'
44+
&& std::all_of(s.begin() + 2, s.end(), [](char c){ return c == '-' || std::isalnum(c); });
4745
}
4846

4947
//! @brief check if `s` is a valid option value
5048
constexpr bool is_valname(std::string_view s)
5149
{
52-
return size(s) > 0 && s[0] != '-'
53-
&& std::all_of(begin(s), end(s), [](char c){ return std::isgraph(c); });
50+
return s.size() > 0 && s[0] != '-'
51+
&& std::all_of(s.begin(), s.end(), [](char c){ return std::isgraph(c); });
5452
}
5553

5654
//! @brief check if `s` is a valid positional param name
5755
constexpr bool is_param_name(std::string_view s)
5856
{
59-
return size(s) > 0 && s[0] != '-'
60-
&& std::all_of(begin(s), end(s), [](char c){ return std::isgraph(c); });
57+
return s.size() > 0 && s[0] != '-'
58+
&& std::all_of(s.begin(), s.end(), [](char c){ return std::isgraph(c); });
6159
}
6260

6361
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)