@@ -1584,9 +1584,13 @@ template <> inline std::string toString(std::string t) { return t; }
15841584
15851585template <> inline std::string toString (bool t) { return t ? " true" : " false" ; }
15861586
1587- template <typename T> struct StringToStringView { typedef T type; };
1587+ template <typename T> struct StringToStringView {
1588+ typedef T type;
1589+ };
15881590
1589- template <> struct StringToStringView <std::string> { typedef std::string_view type; };
1591+ template <> struct StringToStringView <std::string> {
1592+ typedef std::string_view type;
1593+ };
15901594
15911595inline uint32_t MetricBase::resolveFullName (const std::string &n) {
15921596 auto it = metric_ids.find (n);
@@ -1712,9 +1716,9 @@ struct SimpleHistogram {
17121716template <typename ... Tags> struct Counter : public MetricBase {
17131717 static Counter<Tags...> *New (std::string_view name, MetricTagDescriptor<Tags>... fieldnames);
17141718
1715- Counter<Tags...>(std::string_view name, MetricTagDescriptor<Tags> ... descriptors)
1716- : Counter<Tags...> (std::string( name), std::vector<MetricTag>({ toMetricTag (descriptors) ...})) {
1717- }
1719+ template < typename ... T>
1720+ Counter (std::string_view name, MetricTagDescriptor<T> ... descriptors)
1721+ : Counter<T...>(std::string(name), std::vector<MetricTag>({ toMetricTag (descriptors)...})) { }
17181722
17191723 SimpleCounter resolve (Tags... f) {
17201724 std::vector<std::string> fields{toString (f)...};
@@ -1763,8 +1767,9 @@ inline Counter<Tags...> *Counter<Tags...>::New(std::string_view name,
17631767template <typename ... Tags> struct Gauge : public MetricBase {
17641768 static Gauge<Tags...> *New (std::string_view name, MetricTagDescriptor<Tags>... fieldnames);
17651769
1766- Gauge<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
1767- : Gauge<Tags...>(std::string(name), std::vector<MetricTag>({toMetricTag (descriptors)...})) {}
1770+ template <typename ... T>
1771+ Gauge (std::string_view name, MetricTagDescriptor<T>... descriptors)
1772+ : Gauge<T...>(std::string(name), std::vector<MetricTag>({toMetricTag (descriptors)...})) {}
17681773
17691774 SimpleGauge resolve (Tags... f) {
17701775 std::vector<std::string> fields{toString (f)...};
@@ -1809,9 +1814,9 @@ inline Gauge<Tags...> *Gauge<Tags...>::New(std::string_view name,
18091814template <typename ... Tags> struct Histogram : public MetricBase {
18101815 static Histogram<Tags...> *New (std::string_view name, MetricTagDescriptor<Tags>... fieldnames);
18111816
1812- Histogram<Tags...>(std::string_view name, MetricTagDescriptor<Tags> ... descriptors)
1813- : Histogram<Tags...> (std::string( name),
1814- std::vector<MetricTag>({toMetricTag (descriptors)...})) {}
1817+ template < typename ... T>
1818+ Histogram (std::string_view name, MetricTagDescriptor<T>... descriptors)
1819+ : Histogram<T...>(std::string(name), std::vector<MetricTag>({toMetricTag (descriptors)...})) {}
18151820
18161821 SimpleHistogram resolve (Tags... f) {
18171822 std::vector<std::string> fields{toString (f)...};
0 commit comments