ekiga r7387 - trunk/lib/gmref
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r7387 - trunk/lib/gmref
- Date: Thu, 20 Nov 2008 13:12:07 +0000 (UTC)
Author: jpuydt
Date: Thu Nov 20 13:12:07 2008
New Revision: 7387
URL: http://svn.gnome.org/viewvc/ekiga?rev=7387&view=rev
Log:
Modified gmref_ptr slightly -- no real change
Modified:
trunk/lib/gmref/gmref.h
Modified: trunk/lib/gmref/gmref.h
==============================================================================
--- trunk/lib/gmref/gmref.h (original)
+++ trunk/lib/gmref/gmref.h Thu Nov 20 13:12:07 2008
@@ -88,6 +88,8 @@
T* get () const;
+ void swap (gmref_ptr& other);
+
void reset ();
operator bool () const;
@@ -148,12 +150,8 @@
gmref_ptr<T>&
gmref_ptr<T>::operator= (const gmref_ptr<T>& other)
{
- if (this != &other) {
-
- reset ();
- obj = other.obj;
- gmref_inc (obj);
- }
+ gmref_ptr<T> temp(other);
+ this->swap (temp);
return *this;
}
@@ -180,6 +178,15 @@
}
template<typename T>
+void
+gmref_ptr<T>::swap (gmref_ptr<T>& other)
+{
+ T* temp = obj;
+ obj = other.obj;
+ other.obj = temp;
+}
+
+template<typename T>
gmref_ptr<T>::operator bool () const
{
return obj != 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]