diff --git a/include/ircd/stats.h b/include/ircd/stats.h index b14515457..c4ce9622e 100644 --- a/include/ircd/stats.h +++ b/include/ircd/stats.h @@ -117,6 +117,12 @@ struct ircd::stats::item item(uint64_t *const &, const json::members &); item() = default; + + item &operator=(const uint64_t &val) & + { + static_cast(*this) = val; + return *this; + } }; template<> @@ -145,6 +151,12 @@ struct ircd::stats::item item(uint32_t *const &, const json::members &); item() = default; + + item &operator=(const uint32_t &val) & + { + static_cast(*this) = val; + return *this; + } }; template<> @@ -173,10 +185,15 @@ struct ircd::stats::item item(uint16_t *const &, const json::members &); item() = default; + + item &operator=(const uint16_t &val) & + { + static_cast(*this) = val; + return *this; + } }; -template<> -struct ircd::stats::item +template<> struct ircd::stats::item :item { uint64_t val {0}; @@ -194,6 +211,12 @@ struct ircd::stats::item item(const json::members &); item() = default; + + item &operator=(const uint64_t &val) & + { + static_cast(*this) = val; + return *this; + } }; template<> @@ -215,6 +238,12 @@ struct ircd::stats::item item(const json::members &); item() = default; + + item &operator=(const uint32_t &val) & + { + static_cast(*this) = val; + return *this; + } }; template<> @@ -236,4 +265,10 @@ struct ircd::stats::item item(const json::members &); item() = default; + + item &operator=(const uint16_t &val) & + { + static_cast(*this) = val; + return *this; + } };