Use 'nullptr' instead of '0'
This commit is contained in:
parent
ee133e9e1e
commit
0f98ee03b5
6 changed files with 6 additions and 6 deletions
|
@ -73,7 +73,7 @@ private:
|
|||
public:
|
||||
expr():m_ptr(0) {}
|
||||
expr(expr const & s):m_ptr(s.m_ptr) { if (m_ptr) m_ptr->inc_ref(); }
|
||||
expr(expr && s):m_ptr(s.m_ptr) { s.m_ptr = 0; }
|
||||
expr(expr && s):m_ptr(s.m_ptr) { s.m_ptr = nullptr; }
|
||||
~expr() { if (m_ptr) m_ptr->dec_ref(); }
|
||||
|
||||
friend void swap(expr & a, expr & b) { std::swap(a.m_ptr, b.m_ptr); }
|
||||
|
|
|
@ -52,7 +52,7 @@ level::level(level const & s):
|
|||
}
|
||||
level::level(level && s):
|
||||
m_ptr(s.m_ptr) {
|
||||
s.m_ptr = 0;
|
||||
s.m_ptr = nullptr;
|
||||
}
|
||||
level::~level() {
|
||||
if (m_ptr)
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
list():m_ptr(nullptr) {}
|
||||
list(T const & h, list const & t):m_ptr(new cell(h, t)) {}
|
||||
list(list const & s):m_ptr(s.m_ptr) { if (m_ptr) m_ptr->inc_ref(); }
|
||||
list(list&& s):m_ptr(s.m_ptr) { s.m_ptr = 0; }
|
||||
list(list&& s):m_ptr(s.m_ptr) { s.m_ptr = nullptr; }
|
||||
~list() { if (m_ptr) m_ptr->dec_ref(); }
|
||||
|
||||
list & operator=(list const & s) { LEAN_COPY_REF(list, s); }
|
||||
|
|
|
@ -119,7 +119,7 @@ name::name(name const & other):m_ptr(other.m_ptr) {
|
|||
}
|
||||
|
||||
name::name(name && other):m_ptr(other.m_ptr) {
|
||||
other.m_ptr = 0;
|
||||
other.m_ptr = nullptr;
|
||||
}
|
||||
|
||||
name::~name() {
|
||||
|
|
|
@ -43,5 +43,5 @@ void dec_ref() { if (dec_ref_core()) dealloc(); }
|
|||
if (m_ptr) \
|
||||
m_ptr->dec_ref(); \
|
||||
m_ptr = Arg.m_ptr; \
|
||||
Arg.m_ptr = 0; \
|
||||
Arg.m_ptr = nullptr; \
|
||||
return *this;
|
||||
|
|
|
@ -110,7 +110,7 @@ sexpr::sexpr(sexpr const & s):m_ptr(s.m_ptr) {
|
|||
m_ptr->inc_ref();
|
||||
}
|
||||
sexpr::sexpr(sexpr && s):m_ptr(s.m_ptr) {
|
||||
s.m_ptr = 0;
|
||||
s.m_ptr = nullptr;
|
||||
}
|
||||
sexpr::~sexpr() {
|
||||
if (m_ptr)
|
||||
|
|
Loading…
Reference in a new issue