Commit 9a88e5b5 authored by Nicholas Ormrod's avatar Nicholas Ormrod Committed by dcsommer

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
parent 538cd253
......@@ -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_);
}
......
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