From: Nicholas Ormrod Date: Thu, 30 Oct 2014 21:15:02 +0000 (-0700) Subject: operator::* needs implicit X-Git-Tag: v0.22.0~219 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb183e4ae31513b6204fb6a606b391a42082c3af;p=folly.git operator::* needs implicit Summary: operator::* needs to be explicit, or explicitly labeled implicit. The build breaks with explicit, so label. Test Plan: run unit tests Reviewed By: andrei.alexandrescu@fb.com Subscribers: sdwilsh, njormrod, folly-diffs@ FB internal diff: D1644176 Tasks: 5486739 Signature: t1:1644176:1414693471:e3a08e27ba27a5ae0e4b9a5e009acf0a16728c45 --- diff --git a/folly/Benchmark.h b/folly/Benchmark.h index 41d13384..04411f63 100644 --- a/folly/Benchmark.h +++ b/folly/Benchmark.h @@ -149,12 +149,11 @@ struct BenchmarkSuspender { } /** - * This helps the macro definition. To get around the dangers of - * operator bool, returns a pointer to member (which allows no - * arithmetic). + * This is for use inside of if-conditions, used in BENCHMARK macros. + * If-conditions bypass the explicit on operator bool. */ - operator int BenchmarkSuspender::*() const { - return nullptr; + explicit operator bool() const { + return false; } /**