We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a779ab commit 5947bd0Copy full SHA for 5947bd0
1 file changed
core/include/prometheus/labels.h
@@ -1,12 +1,22 @@
1
#pragma once
2
3
+#if defined(__cpp_lib_generic_associative_lookup)
4
+#include <functional>
5
+#endif
6
#include <map>
7
#include <string>
8
9
namespace prometheus {
10
11
/// \brief Multiple labels and their value.
12
+///
13
+/// Uses the transparent comparator std::less<> on C++14 and newer to allow
14
+/// heterogeneous lookup, falling back to the default comparator on C++11.
15
16
+using Labels = std::map<std::string, std::string, std::less<>>;
17
+#else
18
using Labels = std::map<std::string, std::string>;
19
20
21
/// \brief Single label and its value.
22
using Label = Labels::value_type;
0 commit comments