From 9a88e5b5681dfc13a5f392ebce9ff2576e476f99 Mon Sep 17 00:00:00 2001 From: Nicholas Ormrod Date: Wed, 29 Oct 2014 13:03:02 -0700 Subject: [PATCH] operator bool() Summary: Among all of the implicit conversions, conversion to bool is particularly tricky. For this reason, it has a special call-out in flint among the casts, and canno be overriden. However, there are legitimate use cases for operator bool. In this case, we have a iterator that logically represents a bool but in practice represents a packed integral. This class needs to be implicitly convertible to bool, and warrants an override. Push blocking tests have had over a day to complete, but haven't. Further, the folly change is comment-only. Test Plan: Build flint, run it on BitIteratorDetail.h, see no more lint errors Reviewed By: andrei.alexandrescu@fb.com Subscribers: sdwilsh, louisk, njormrod, folly-diffs@ FB internal diff: D1644141 Tasks: 5486739 Signature: t1:1644141:1414607351:29740da758b75187f4f7b6b5a5ad28a523e7080d --- folly/detail/BitIteratorDetail.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/detail/BitIteratorDetail.h b/folly/detail/BitIteratorDetail.h index eb8edcd6..34ccb4bc 100644 --- a/folly/detail/BitIteratorDetail.h +++ b/folly/detail/BitIteratorDetail.h @@ -36,7 +36,7 @@ class BitReference { public: BitReference(Ref r, size_t bit) : ref_(r), bit_(bit) { } - operator bool() const { + /* implicit */ operator bool() const { return ref_ & (one_ << bit_); } -- 2.34.1