Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ namespace argparse
return get_dest_name();
}

auto get_consumable(tokens & args)
auto get_consumable(tokens & args) const
{
return args
| std::views::drop_while([](auto const & token)
Expand Down Expand Up @@ -1099,7 +1099,7 @@ namespace argparse
return get_joined_names();
}

auto check_errors(std::string const & value, std::ranges::view auto args) -> void
auto check_errors(std::string const & value, std::ranges::view auto args) const -> void
{
switch (m_options.action)
{
Expand Down Expand Up @@ -1151,14 +1151,14 @@ namespace argparse
}
}

auto get_consumable(tokens & args)
auto get_consumable(tokens & args) const
{
return args
| std::views::drop_while([](auto const & token) { return token.m_consumed; })
| std::views::take_while([](auto const & token) { return token.m_token != "--"; });
}

auto get_consumable_args(auto it, std::ranges::view auto consumable)
auto get_consumable_args(auto it, std::ranges::view auto consumable) const
{
return std::ranges::subrange(std::next(it), consumable.end())
| std::views::take_while([](auto const & token) { return !token.m_token.starts_with("-"); });
Expand Down Expand Up @@ -1530,7 +1530,7 @@ namespace argparse
class ArgumentBuilder
{
public:
ArgumentBuilder(argument_uptrs & arguments, optstring & version, std::vector<std::string> names, MutuallyExclusiveGroup * group = nullptr)
ArgumentBuilder(argument_uptrs & arguments, optstring & version, std::vector<std::string> names, MutuallyExclusiveGroup const * group = nullptr)
: m_arguments(arguments)
, m_version(version)
, m_options()
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/cstring_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
template<std::size_t N, class... Ts>
struct cstr_arr
{
cstr_arr(Ts... args)
explicit cstr_arr(Ts... args)
: array{args...}
{
}
Expand Down