[commit] r2058 - trunk/GME/PartBrowser

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Sep 19 17:49:08 CDT 2012


Author: ksmyth
Date: Wed Sep 19 17:49:07 2012
New Revision: 2058

Log:
Use std::move

Modified:
   trunk/GME/PartBrowser/PartBrowserPane.cpp
   trunk/GME/PartBrowser/PartBrowserPane.h

Modified: trunk/GME/PartBrowser/PartBrowserPane.cpp
==============================================================================
--- trunk/GME/PartBrowser/PartBrowserPane.cpp	Tue Sep 18 09:52:06 2012	(r2057)
+++ trunk/GME/PartBrowser/PartBrowserPane.cpp	Wed Sep 19 17:49:07 2012	(r2058)
@@ -177,7 +177,7 @@
 		return;
 	}
 	std::sort(pdt.begin(), pdt.end(), [](const PartWithDecorator& a, const PartWithDecorator& b){ return a.name < b.name; });
-	pdts.push_back(pdt);
+	pdts.push_back(std::move(pdt));
 }
 
 void CPartBrowserPane::DestroyDecorators(void)

Modified: trunk/GME/PartBrowser/PartBrowserPane.h
==============================================================================
--- trunk/GME/PartBrowser/PartBrowserPane.h	Tue Sep 18 09:52:06 2012	(r2057)
+++ trunk/GME/PartBrowser/PartBrowserPane.h	Wed Sep 19 17:49:07 2012	(r2058)
@@ -22,6 +22,26 @@
 	CString										name;	// Calculated, cached for speedup
 	CComPtr<IMgaDecorator>						decorator;
 	CComPtr<IMgaElementDecorator>				newDecorator;
+
+	PartWithDecorator operator=(PartWithDecorator&& that)
+	{
+		if (this != &that)
+		{
+			this->part = std::move(that.part);
+			this->name = std::move(that.name);
+			this->decorator = std::move(that.decorator);
+			this->newDecorator = std::move(that.newDecorator);
+		}
+		return *this;
+	}
+	PartWithDecorator(PartWithDecorator&& that)
+		: part(std::move(that.part)),
+		name(std::move(that.name)),
+		decorator(std::move(that.decorator)),
+		newDecorator(std::move(that.newDecorator))
+	{
+	}
+	PartWithDecorator() {}
 };
 
 


More information about the gme-commit mailing list