Skip to content

Commit

Permalink
Include/xrRender/FactoryPtr.h: use operator bool instead of unspecifi…
Browse files Browse the repository at this point in the history
…ed bool type
  • Loading branch information
Xottab-DUTY committed Jun 1, 2024
1 parent e72b01b commit eecab73
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Include/xrRender/FactoryPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ class FactoryPtr

T& operator*() const { return *m_pObject; }
T* operator->() const { return m_pObject; }
// unspecified bool type
typedef T const* (FactoryPtr::*unspecified_bool_type)() const;
operator unspecified_bool_type() const { return (!m_pObject ? 0 : &FactoryPtr::get); }
operator bool() const { return m_pObject; }
bool operator!() const { return m_pObject == nullptr; }
private:
void CreateObject();
Expand Down

0 comments on commit eecab73

Please sign in to comment.