chenBright commented on code in PR #3557:
URL: https://github.com/apache/brpc/pull/3557#discussion_r4060447686


##########
src/bvar/multi_dimension.h:
##########
@@ -84,14 +98,32 @@ class MultiDimension : public MVariable<KeyType> {
     typedef butil::DoublyBufferedData<MetricMap> MetricMapDBD;
     typedef typename MetricMapDBD::ScopedPtr MetricMapScopedPtr;
     
-    explicit MultiDimension(const key_type& labels);
-    
+    // `args` are copied and supplied as const references to each value's
+    // constructor. Only overloads that can construct T this way participate.
+    // With no args, T must be default-constructible. A Histogram is the
+    // typical one, its buckets are fixed at construction:
+    //   bvar::MultiDimension<bvar::Histogram> h(
+    //       "rpc_latency", {"method"},
+    //       bvar::Histogram::BucketSchema({10, 50, 100, 500, 1000}));
+    // They are copied once into the MultiDimension, nothing needs to outlive
+    // the call.
+    template <typename... Args,
+              std::enable_if_t<std::is_constructible<
+                  T, const typename std::decay<Args>::type&...>::value, int> = 
0>

Review Comment:
   bRPC no longer supports C++11.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to