Replace obsolete safe bool idiom with explicit operator bool 01/269401/2
authorArtur Świgoń <a.swigon@samsung.com>
Thu, 13 Jan 2022 14:28:08 +0000 (15:28 +0100)
committerArtur Świgoń <a.swigon@samsung.com>
Mon, 17 Jan 2022 09:27:10 +0000 (10:27 +0100)
commitfc758c71ace6ba1b2d093bcf8b58769a37826abb
tree9c5880cf4c34cae83775a0150fe716dc79114795
parent49d653473e0c6b59262b2d3be82529dbb2114ab0
Replace obsolete safe bool idiom with explicit operator bool

C++11 introduces 'explicit operator bool' to prevent unintended implicit
conversions to 'bool', thus making the trick with converting to a
pointer-to-member (a.k.a. "safe bool idiom") obsolete.

The explicit operator is more restrictive than 'safe bool', and it
helped uncover a bug in the test suite where object handles were
implicitly converted to bool before being sent to an std::ostream.

Change-Id: I1128903e8f429d8903b5282d7c1bd4aa0be00979
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-controller.cpp
dali/internal/system/common/capture-impl.cpp