Replace obsolete safe bool idiom with explicit operator bool 00/269400/2
authorArtur Świgoń <a.swigon@samsung.com>
Thu, 13 Jan 2022 14:23:16 +0000 (15:23 +0100)
committerArtur Świgoń <a.swigon@samsung.com>
Mon, 17 Jan 2022 09:27:01 +0000 (10:27 +0100)
commit806176778b6f217e4c5a302e61e85546846d7291
tree19025a849c3552a738b44e57558b8da93233ad32
parent526704fa2ba73d9312b17b97949dda1fab5df6a4
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: I8c9d33812bc022570f5c286d925914dba508185c
13 files changed:
automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.cpp
automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp
automated-tests/src/dali/utc-Dali-BaseHandle.cpp
automated-tests/src/dali/utc-Dali-IntrusivePtr.cpp
dali/internal/common/owner-pointer.h
dali/internal/event/rendering/texture-impl.cpp
dali/internal/render/renderers/render-texture.cpp
dali/internal/render/renderers/render-texture.h
dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
dali/public-api/common/intrusive-ptr.h
dali/public-api/object/base-handle.cpp
dali/public-api/object/base-handle.h