mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 02:49:00 +00:00
Add QPDFObjectHandle::operator bool
This commit is contained in:
parent
bcf56e5333
commit
5a33c75b98
@ -295,6 +295,11 @@ class QPDFObjectHandle
|
||||
QPDF_DLL
|
||||
QPDFObjectHandle& operator=(QPDFObjectHandle const&) = default;
|
||||
|
||||
// Return true if the QPDFObjectHandle is initialized. This allows object handles to be used in
|
||||
// if statements with initializer.
|
||||
QPDF_DLL
|
||||
explicit inline operator bool() const noexcept;
|
||||
|
||||
QPDF_DLL
|
||||
inline bool isInitialized() const;
|
||||
|
||||
@ -1634,5 +1639,10 @@ QPDFObjectHandle::isInitialized() const
|
||||
return obj != nullptr;
|
||||
}
|
||||
|
||||
inline QPDFObjectHandle::operator bool() const noexcept
|
||||
{
|
||||
return static_cast<bool>(obj);
|
||||
}
|
||||
|
||||
#endif // QPDF_FUTURE
|
||||
#endif // QPDFOBJECTHANDLE_HH
|
||||
|
@ -295,6 +295,11 @@ class QPDFObjectHandle
|
||||
QPDF_DLL
|
||||
QPDFObjectHandle& operator=(QPDFObjectHandle&&) = default;
|
||||
|
||||
// Return true if the QPDFObjectHandle is initialized. This allows object handles to be used in
|
||||
// if statements with initializer.
|
||||
QPDF_DLL
|
||||
explicit inline operator bool() const noexcept;
|
||||
|
||||
QPDF_DLL
|
||||
inline bool isInitialized() const noexcept;
|
||||
|
||||
@ -1634,4 +1639,9 @@ QPDFObjectHandle::isInitialized() const noexcept
|
||||
return obj != nullptr;
|
||||
}
|
||||
|
||||
inline QPDFObjectHandle::operator bool() const noexcept
|
||||
{
|
||||
return static_cast<bool>(obj);
|
||||
}
|
||||
|
||||
#endif // QPDFOBJECTHANDLE_FUTURE_HH
|
||||
|
Loading…
Reference in New Issue
Block a user