command/Request: pass std::span to constructor
This commit is contained in:
parent
feb334756e
commit
a8452957fc
@ -421,7 +421,7 @@ command_process(Client &client, unsigned num, char *line) noexcept
|
|||||||
argv[n_args++] = a;
|
argv[n_args++] = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
Request args{argv, n_args};
|
Request args{{argv, n_args}};
|
||||||
|
|
||||||
/* look up and invoke the command handler */
|
/* look up and invoke the command handler */
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ class Request {
|
|||||||
std::span<const char *const> args;
|
std::span<const char *const> args;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit constexpr Request(const char *const*argv, std::size_t n)
|
explicit constexpr Request(std::span<const char *const> _args) noexcept
|
||||||
:args(argv, n) {}
|
:args(_args) {}
|
||||||
|
|
||||||
constexpr bool empty() const noexcept {
|
constexpr bool empty() const noexcept {
|
||||||
return args.empty();
|
return args.empty();
|
||||||
|
Loading…
Reference in New Issue
Block a user