rttr icon indicating copy to clipboard operation
rttr copied to clipboard

remove pessimizing moves on return

Open weatherhead99 opened this issue 5 years ago • 2 comments

remove several statements containing "return std::move(x)" which, according to the c++ standard 12.8/31 is pessimizing, because these objects are eligible for the NRVO. This issues a warning in gcc 9 otherwise.

weatherhead99 avatar Jun 04 '19 02:06 weatherhead99

seems to be not working with the older compilers

acki-m avatar Aug 13 '19 21:08 acki-m

I'm getting this problem too. May it be fixed by a macro?

#ifdef __GNUC__
	#if __GNUC__ >= 9
		#define MOVE(X) X
	#else
		#define MOVE(X) std::move(X)
	#endif
#else
	#define MOVE(X) std::move(X)
#end

And if so, are you happy for me to submit PR?

SnapperTT avatar Nov 20 '19 07:11 SnapperTT