Commit e6441cdc authored by TousakaRin's avatar TousakaRin

Add non-trivial destructor for AdaptiveMaxConcurrency

parent 1b144bc1
......@@ -35,6 +35,13 @@ public:
: _name("constant")
, _max_concurrency(max_concurrency) {}
// Non-trivial destructor to prevent AdaptiveMaxConcurrency from being
// passed to variadic arguments without explicit type conversion.
// eg:
// printf("%d", options.max_concurrency) // compile error
// printf("%d", static_cast<int>(options.max_concurrency) // ok
~AdaptiveMaxConcurrency() {}
AdaptiveMaxConcurrency(const butil::StringPiece& name);
void operator=(int max_concurrency) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment