aboutsummaryrefslogtreecommitdiffstats
path: root/include/modules/stats.h
diff options
context:
space:
mode:
authorGravatar Sadie Powell2019-01-25 15:17:37 +0000
committerGravatar Sadie Powell2019-01-25 15:17:37 +0000
commit0fab643858dfd2183cb545243d230d3ff84446b2 (patch)
treec50161f9e2539255132b90301b6f6ad01ef2224c /include/modules/stats.h
parentRemove support for the deprecated rfc1459 casemapping, (diff)
downloadinspircd++-0fab643858dfd2183cb545243d230d3ff84446b2.tar.gz
inspircd++-0fab643858dfd2183cb545243d230d3ff84446b2.tar.bz2
inspircd++-0fab643858dfd2183cb545243d230d3ff84446b2.zip
Convert repetitive functions to use C++11 variadic templates.
Diffstat (limited to 'include/modules/stats.h')
-rw-r--r--include/modules/stats.h90
1 files changed, 3 insertions, 87 deletions
diff --git a/include/modules/stats.h b/include/modules/stats.h
index e69070c9f..0d82f9f9a 100644
--- a/include/modules/stats.h
+++ b/include/modules/stats.h
@@ -97,95 +97,11 @@ class Stats::Context
*/
void AddRow(const Row& row) { rows.push_back(row); }
- template <typename T1>
- void AddRow(unsigned int numeric, T1 p1)
+ template <typename... Param>
+ void AddRow(unsigned int numeric, Param... p)
{
Row n(numeric);
- n.push(p1);
- AddRow(n);
- }
-
- template <typename T1, typename T2>
- void AddRow(unsigned int numeric, T1 p1, T2 p2)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- AddRow(n);
- }
-
- template <typename T1, typename T2, typename T3>
- void AddRow(unsigned int numeric, T1 p1, T2 p2, T3 p3)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- n.push(p3);
- AddRow(n);
- }
-
- template <typename T1, typename T2, typename T3, typename T4>
- void AddRow(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- n.push(p3);
- n.push(p4);
- AddRow(n);
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- void AddRow(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- n.push(p3);
- n.push(p4);
- n.push(p5);
- AddRow(n);
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
- void AddRow(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- n.push(p3);
- n.push(p4);
- n.push(p5);
- n.push(p6);
- AddRow(n);
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
- void AddRow(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- n.push(p3);
- n.push(p4);
- n.push(p5);
- n.push(p6);
- n.push(p7);
- AddRow(n);
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
- void AddRow(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8)
- {
- Row n(numeric);
- n.push(p1);
- n.push(p2);
- n.push(p3);
- n.push(p4);
- n.push(p5);
- n.push(p6);
- n.push(p7);
- n.push(p8);
+ n.push(std::forward<Param>(p)...);
AddRow(n);
}
};