[cig-commits] r13054 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Oct 15 02:07:56 PDT 2008


Author: luis
Date: 2008-10-15 02:07:55 -0700 (Wed, 15 Oct 2008)
New Revision: 13054

Modified:
   cs/cigma/trunk/src/Point.cpp
Log:
Implementation of assignment operator

Modified: cs/cigma/trunk/src/Point.cpp
===================================================================
--- cs/cigma/trunk/src/Point.cpp	2008-10-15 09:07:53 UTC (rev 13053)
+++ cs/cigma/trunk/src/Point.cpp	2008-10-15 09:07:55 UTC (rev 13054)
@@ -11,6 +11,11 @@
 }
 
 template <int dim>
+Point<dim>::~Point()
+{
+}
+
+template <int dim>
 Point<dim>::Point(double *x, int len)
 {
     zero_out();
@@ -34,11 +39,20 @@
 }
 
 template <int dim>
-Point<dim>::~Point()
+Point<dim>& Point<dim>::operator=(const Point<dim>& pt)
 {
+    if (this != &pt)
+    {
+        for (int i = 0; i < dim; i++)
+        {
+            coord[i] = pt.coord[i];
+        }
+    }
+    return *this;
 }
 
 
+
 // ----------------------------------------------------------------------------
 
 template <int dim>



More information about the cig-commits mailing list