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
return ostream;
}
+std::ostream& operator<<(std::ostream& ostream, BaseHandle handle)
+{
+ return ostream << static_cast<void*>(handle.GetObjectPtr());
+}
+
void DALI_TEST_EQUALS(const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location)
{
DALI_TEST_EQUALS<const BaseHandle&>(baseHandle1, baseHandle2, location);
std::ostream& operator<<(std::ostream& ostream, TimePeriod value);
std::ostream& operator<<(std::ostream& ostream, Radian angle);
std::ostream& operator<<(std::ostream& ostream, Degree angle);
+std::ostream& operator<<(std::ostream& ostream, BaseHandle handle);
/**
* Test whether two values are equal.
<< " usageFlags:" << std::hex << createInfo.usageFlags
<< " data:" << std::hex << createInfo.data
<< " dataSize:" << std::dec << createInfo.dataSize
- << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr;
+ << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr.Get();
return o;
}
bool Capture::IsFrameBufferCreated()
{
- return mFrameBuffer;
+ return static_cast<bool>(mFrameBuffer);
}
void Capture::SetupRenderTask(const Dali::Vector2& position, const Dali::Vector2& size, Dali::Actor source, const Dali::Vector4& clearColor)