← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2954: turn some std::forward calls into std::move

 

------------------------------------------------------------
revno: 2954
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2012-06-18 17:56:01 +0200
message:
  turn some std::forward calls into std::move
modified:
  dcpp/ConnectivityManager.cpp
  dcpp/GeoIP.cpp
  dcpp/GetSet.h
  dcpp/Mapper.cpp
  dcpp/Mapper_MiniUPnPc.cpp
  dcpp/Mapper_NATPMP.cpp
  dcpp/Mapper_WinUPnP.cpp
  dcpp/MappingManager.h
  dcpp/User.cpp
  dcpp/UserMatch.cpp
  dcpp/UserMatchManager.cpp
  dcpp/stdinc.h
  win32/FavHubGroupsDlg.cpp
  win32/HtmlToRtf.cpp
  win32/HubFrame.cpp
  win32/MainWindow.cpp
  win32/StylesPage.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/ConnectivityManager.cpp'
--- dcpp/ConnectivityManager.cpp	2012-03-22 19:48:02 +0000
+++ dcpp/ConnectivityManager.cpp	2012-06-18 15:56:01 +0000
@@ -231,7 +231,7 @@
 
 void ConnectivityManager::log(string&& message) {
 	if(BOOLSETTING(AUTO_DETECT_CONNECTION)) {
-		status = forward<string>(message);
+		status = move(message);
 		LogManager::getInstance()->message(_("Connectivity: ") + status);
 		fire(ConnectivityManagerListener::Message(), status);
 	} else {

=== modified file 'dcpp/GeoIP.cpp'
--- dcpp/GeoIP.cpp	2012-05-15 23:26:22 +0000
+++ dcpp/GeoIP.cpp	2012-06-18 15:56:01 +0000
@@ -29,7 +29,7 @@
 
 namespace dcpp {
 
-GeoIP::GeoIP(string&& path) : geo(0), path(forward<string>(path)) {
+GeoIP::GeoIP(string&& path) : geo(0), path(move(path)) {
 	if(File::getSize(path) > 0 || decompress()) {
 		open();
 	}

=== modified file 'dcpp/GetSet.h'
--- dcpp/GetSet.h	2012-01-13 20:55:20 +0000
+++ dcpp/GetSet.h	2012-06-18 15:56:01 +0000
@@ -44,7 +44,7 @@
 	set##name2(GetSetT name) { this->name = name; } /* small type: simple setter that just copies */ \
 	\
 	template<typename GetSetT> typename std::enable_if<std::is_class<GetSetT>::value, void>::type \
-	set##name2(GetSetT&& name) { this->name = std::forward<GetSetT>(name); } /* large type: move the rvalue ref */ \
+	set##name2(GetSetT&& name) { this->name = std::move(name); } /* large type: move the rvalue ref */ \
 	\
 	template<typename GetSetT> typename std::enable_if<std::is_class<GetSetT>::value, void>::type \
 	set##name2(const GetSetT& name) { this->name = name; } /* large type: copy the parameter */

=== modified file 'dcpp/Mapper.cpp'
--- dcpp/Mapper.cpp	2012-03-03 19:33:45 +0000
+++ dcpp/Mapper.cpp	2012-06-18 15:56:01 +0000
@@ -29,7 +29,7 @@
 };
 
 Mapper::Mapper(string&& localIp) :
-localIp(std::forward<string>(localIp))
+localIp(move(localIp))
 {
 }
 

=== modified file 'dcpp/Mapper_MiniUPnPc.cpp'
--- dcpp/Mapper_MiniUPnPc.cpp	2012-01-13 20:55:20 +0000
+++ dcpp/Mapper_MiniUPnPc.cpp	2012-06-18 15:56:01 +0000
@@ -34,7 +34,7 @@
 const string Mapper_MiniUPnPc::name = "MiniUPnP";
 
 Mapper_MiniUPnPc::Mapper_MiniUPnPc(string&& localIp) :
-Mapper(std::forward<string>(localIp))
+Mapper(move(localIp))
 {
 }
 

=== modified file 'dcpp/Mapper_NATPMP.cpp'
--- dcpp/Mapper_NATPMP.cpp	2012-01-13 20:55:20 +0000
+++ dcpp/Mapper_NATPMP.cpp	2012-06-18 15:56:01 +0000
@@ -38,7 +38,7 @@
 static natpmp_t nat;
 
 Mapper_NATPMP::Mapper_NATPMP(string&& localIp) :
-Mapper(std::forward<string>(localIp)),
+Mapper(move(localIp)),
 lifetime(0)
 {
 }

=== modified file 'dcpp/Mapper_WinUPnP.cpp'
--- dcpp/Mapper_WinUPnP.cpp	2012-01-13 20:55:20 +0000
+++ dcpp/Mapper_WinUPnP.cpp	2012-06-18 15:56:01 +0000
@@ -36,7 +36,7 @@
 const string Mapper_WinUPnP::name = "Windows UPnP";
 
 Mapper_WinUPnP::Mapper_WinUPnP(string&& localIp) :
-Mapper(std::forward<string>(localIp)),
+Mapper(move(localIp)),
 pUN(0),
 lastPort(0)
 {

=== modified file 'dcpp/MappingManager.h'
--- dcpp/MappingManager.h	2012-03-03 15:04:23 +0000
+++ dcpp/MappingManager.h	2012-06-18 15:56:01 +0000
@@ -46,7 +46,7 @@
 	the first added mapper will be tried first, unless the "MAPPER" setting is not empty. */
 	template<typename T> void addMapper() {
 		mappers.emplace_back(T::name, [](string&& localIp) {
-			return new T(std::forward<string>(localIp));
+			return new T(move(localIp));
 		});
 	}
 	StringList getMappers() const;

=== modified file 'dcpp/User.cpp'
--- dcpp/User.cpp	2012-03-03 19:33:45 +0000
+++ dcpp/User.cpp	2012-06-18 15:56:01 +0000
@@ -207,7 +207,7 @@
 
 void Identity::setStyle(Style&& style) {
 	FastLock l(cs);
-	this->style = std::forward<Style>(style);
+	this->style = move(style);
 }
 
 void FavoriteUser::update(const OnlineUser& info) {

=== modified file 'dcpp/UserMatch.cpp'
--- dcpp/UserMatch.cpp	2012-03-03 19:33:45 +0000
+++ dcpp/UserMatch.cpp	2012-06-18 15:56:01 +0000
@@ -31,7 +31,7 @@
 
 void UserMatch::addRule(Rule&& rule) {
 	if(rule.prepare()) {
-		rules.push_back(std::forward<Rule>(rule));
+		rules.push_back(move(rule));
 	}
 }
 

=== modified file 'dcpp/UserMatchManager.cpp'
--- dcpp/UserMatchManager.cpp	2012-03-03 19:33:45 +0000
+++ dcpp/UserMatchManager.cpp	2012-06-18 15:56:01 +0000
@@ -48,7 +48,7 @@
 	auto lock = cm->lock();
 
 	// assign the new list.
-	const_cast<UserMatches&>(list) = std::forward<UserMatches>(newList);
+	const_cast<UserMatches&>(list) = move(newList);
 
 	// refresh user matches.
 	for(auto& i: cm->getOnlineUsers()) {

=== modified file 'dcpp/stdinc.h'
--- dcpp/stdinc.h	2012-01-13 20:55:20 +0000
+++ dcpp/stdinc.h	2012-06-18 15:56:01 +0000
@@ -85,4 +85,8 @@
 
 #endif
 
+// always include
+#include <type_traits>
+using std::move;
+
 #endif // !defined(STDINC_H)

=== modified file 'win32/FavHubGroupsDlg.cpp'
--- win32/FavHubGroupsDlg.cpp	2012-05-24 17:47:25 +0000
+++ win32/FavHubGroupsDlg.cpp	2012-06-18 15:56:01 +0000
@@ -281,7 +281,7 @@
 }
 
 void FavHubGroupsDlg::add(const tstring& name, HubSettings&& settings) {
-	add(FavHubGroup(Text::fromT(name), std::forward<HubSettings>(settings)));
+	add(FavHubGroup(Text::fromT(name), move(settings)));
 }
 
 HubSettings FavHubGroupsDlg::getSettings() const {

=== modified file 'win32/HtmlToRtf.cpp'
--- win32/HtmlToRtf.cpp	2012-03-18 15:21:56 +0000
+++ win32/HtmlToRtf.cpp	2012-06-18 15:56:01 +0000
@@ -233,7 +233,7 @@
 
 size_t Parser::addFont(string&& font) {
 	auto ret = fonts.size();
-	fonts.push_back("{\\f" + Util::toString(ret) + std::forward<string>(font) + ";}");
+	fonts.push_back("{\\f" + Util::toString(ret) + move(font) + ";}");
 	return ret;
 }
 

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2012-06-08 15:27:48 +0000
+++ win32/HubFrame.cpp	2012-06-18 15:56:01 +0000
@@ -1422,7 +1422,7 @@
 		return;
 	}
 
-	url = std::forward<string>(target);
+	url = move(target);
 
 	// the client is dead, long live the client!
 	client->removeListener(this);

=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp	2012-06-08 13:56:39 +0000
+++ win32/MainWindow.cpp	2012-06-18 15:56:01 +0000
@@ -1259,7 +1259,7 @@
 
 class ListMatcher : public Thread {
 public:
-	ListMatcher(StringList&& files) : files(std::forward<StringList>(files)) { }
+	ListMatcher(StringList&& files) : files(move(files)) { }
 
 	int run() {
 		for(auto& i: files) {

=== modified file 'win32/StylesPage.cpp'
--- win32/StylesPage.cpp	2012-03-11 18:29:17 +0000
+++ win32/StylesPage.cpp	2012-06-18 15:56:01 +0000
@@ -152,7 +152,7 @@
 	auto grouped = table->isGrouped();
 
 	auto add = [this, grouped](tstring&& text, unsigned helpId, int group, int fontSetting, int textColorSetting, int bgColorSetting) -> Data* {
-		auto data = new SettingsData(forward<tstring>(text), helpId, fontSetting, textColorSetting, bgColorSetting);
+		auto data = new SettingsData(move(text), helpId, fontSetting, textColorSetting, bgColorSetting);
 		this->table->insert(grouped ? group : -1, data);
 		return data;
 	};
@@ -210,7 +210,7 @@
 
 StylesPage::Data::Data(tstring&& text, const unsigned helpId) :
 Flags(),
-text(forward<tstring>(text)),
+text(move(text)),
 helpId(helpId)
 {
 }
@@ -246,7 +246,7 @@
 }
 
 StylesPage::SettingsData::SettingsData(tstring&& text, unsigned helpId, int fontSetting, int textColorSetting, int bgColorSetting) :
-Data(forward<tstring>(text), helpId),
+Data(move(text), helpId),
 fontSetting(fontSetting),
 textColorSetting(textColorSetting),
 bgColorSetting(bgColorSetting)