From eb183e4ae31513b6204fb6a606b391a42082c3af Mon Sep 17 00:00:00 2001 From: Nicholas Ormrod Date: Thu, 30 Oct 2014 14:15:02 -0700 Subject: [PATCH] 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 --- folly/Benchmark.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } /** -- 2.34.1