|
From: <ric...@us...> - 2010-09-16 17:26:35
|
Revision: 1076
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1076&view=rev
Author: rich_sposato
Date: 2010-09-16 17:26:29 +0000 (Thu, 16 Sep 2010)
Log Message:
-----------
Used initialization instead of assignment within constructor.
Modified Paths:
--------------
trunk/src/SmartPtr.cpp
Modified: trunk/src/SmartPtr.cpp
===================================================================
--- trunk/src/SmartPtr.cpp 2010-09-16 17:23:59 UTC (rev 1075)
+++ trunk/src/SmartPtr.cpp 2010-09-16 17:26:29 UTC (rev 1076)
@@ -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 @@
// ----------------------------------------------------------------------------
-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 @@
return false;
}
else if (next_ == this)
- {
+ {
assert(prev_ == this);
// Set these to NULL to prevent re-entrancy.
prev_ = NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|