Used initialization instead of assignment within constructor.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1076 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2010-09-16 17:26:29 +00:00
parent ac54d187bc
commit 9c85634334

View file

@ -3,14 +3,14 @@
// Copyright (c) 2001 by Andrei Alexandrescu
// Copyright (c) 2006 Richard Sposato
// This code accompanies the book:
// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
// Patterns Applied". Copyright (c) 2001. Addison-Wesley.
// Permission to use, copy, modify, distribute and sell this software for any
// purpose is hereby granted without fee, provided that the above copyright
// notice appear in all copies and that both that copyright notice and this
// Permission to use, copy, modify, distribute and sell this software for any
// purpose is hereby granted without fee, provided that the above copyright
// notice appear in all copies and that both that copyright notice and this
// permission notice appear in supporting documentation.
// The author or Addison-Wesley Longman make no representations about the
// suitability of this software for any purpose. It is provided "as is"
// The author or Addison-Wesley Longman make no representations about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
////////////////////////////////////////////////////////////////////////////////
@ -37,10 +37,10 @@ namespace Private
// ----------------------------------------------------------------------------
RefLinkedBase::RefLinkedBase(const RefLinkedBase& rhs)
RefLinkedBase::RefLinkedBase( const RefLinkedBase & rhs ) :
prev_( &rhs ),
next_( rhs.next_ )
{
prev_ = &rhs;
next_ = rhs.next_;
prev_->next_ = this;
next_->prev_ = this;
@ -70,7 +70,7 @@ bool RefLinkedBase::Release()
return false;
}
else if (next_ == this)
{
{
assert(prev_ == this);
// Set these to NULL to prevent re-entrancy.
prev_ = NULL;