mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-02 01:47:57 +00:00
Use CATCH_NULL instead of NULL
- expands to nullptr if CATCH_CONFIG_CPP11_NULLPTR is defined (see #444)
This commit is contained in:
parent
3b18d9e962
commit
805de43a3d
25 changed files with 112 additions and 101 deletions
|
@ -23,7 +23,7 @@ namespace Catch {
|
|||
template<typename T>
|
||||
class Ptr {
|
||||
public:
|
||||
Ptr() : m_p( NULL ){}
|
||||
Ptr() : m_p( CATCH_NULL ){}
|
||||
Ptr( T* p ) : m_p( p ){
|
||||
if( m_p )
|
||||
m_p->addRef();
|
||||
|
@ -39,7 +39,7 @@ namespace Catch {
|
|||
void reset() {
|
||||
if( m_p )
|
||||
m_p->release();
|
||||
m_p = NULL;
|
||||
m_p = CATCH_NULL;
|
||||
}
|
||||
Ptr& operator = ( T* p ){
|
||||
Ptr temp( p );
|
||||
|
@ -56,8 +56,8 @@ namespace Catch {
|
|||
const T* get() const{ return m_p; }
|
||||
T& operator*() const { return *m_p; }
|
||||
T* operator->() const { return m_p; }
|
||||
bool operator !() const { return m_p == NULL; }
|
||||
operator SafeBool::type() const { return SafeBool::makeSafe( m_p != NULL ); }
|
||||
bool operator !() const { return m_p == CATCH_NULL; }
|
||||
operator SafeBool::type() const { return SafeBool::makeSafe( m_p != CATCH_NULL ); }
|
||||
|
||||
private:
|
||||
T* m_p;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue