Use 'nullptr' instead of '0'

This commit is contained in:
Soonho Kong 2013-08-01 13:57:43 -07:00
parent ee133e9e1e
commit 0f98ee03b5
6 changed files with 6 additions and 6 deletions

View file

@ -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); }

View file

@ -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)

View file

@ -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); }

View file

@ -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() {

View file

@ -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;

View file

@ -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)