From f17e45bdc34ee3f826aa40f71a0673927f40bc75 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 6 Aug 2012 20:02:46 -0700 Subject: [PATCH] Forcing the use of move in one location --- cpp/ycm/CompletionData.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/ycm/CompletionData.cpp b/cpp/ycm/CompletionData.cpp index b04f3ee5..7843eba3 100644 --- a/cpp/ycm/CompletionData.cpp +++ b/cpp/ycm/CompletionData.cpp @@ -18,6 +18,7 @@ #include "CompletionData.h" #include +#include namespace { @@ -132,7 +133,7 @@ std::string OptionalChunkToString( CXCompletionString completion_string, // the parameter BUT if this code is compiled in C++11 mode a move constructor // can be called on the passed-in value. This is not possible if we accept the // param by const ref. -std::string RemoveTwoUnderscores( std::string text ) +std::string RemoveTwoConsecutiveUnderscores( std::string text ) { boost::erase_all( text, "__" ); return text; @@ -184,7 +185,8 @@ CompletionData::CompletionData( const CXCompletionResult &completion_result ) // ANY C++ identifier with two consecutive underscores in it is // compiler-reserved. everything_except_return_type_ = - RemoveTwoUnderscores( everything_except_return_type_ ); + RemoveTwoConsecutiveUnderscores( + boost::move( everything_except_return_type_ ) ); detailed_info_.append( return_type_ ) .append( " " )