From a16bac5e05cfde6dac1665612b84117fa2909d6a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 11 Nov 2020 22:19:54 +0000 Subject: Convert IRCv3::Replies::Reply#Send[IfCap] to variadic functions. --- include/clientprotocol.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/clientprotocol.h') diff --git a/include/clientprotocol.h b/include/clientprotocol.h index a162472f5..91bc0d0b4 100644 --- a/include/clientprotocol.h +++ b/include/clientprotocol.h @@ -355,6 +355,26 @@ class ClientProtocol::Message : public ClientProtocol::MessageSource */ void PushParam(const std::string& str) { params.push_back(Param(0, str)); } + /** Add a non-string parameter to the parameter list. + * @param arg1 Non-string to add, will be copied. + */ + template + void PushParam(T&& param) + { + PushParam(ConvToStr(param)); + } + + /** Adds a variable number of parameters to the parameter list. + * @param arg1 The first argument to push. + * @param args A variable number of arguments to push. + */ + template + void PushParam(FirstArg&& arg1, FwdArgs&&... args) + { + PushParam(arg1); + PushParam(std::forward(args)...); + } + /** Add a parameter to the parameter list. * @param str String to add. * The string will NOT be copied, it must remain alive until ClearParams() is called or until the object is destroyed. -- cgit v1.3.1-10-gc9f91