Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove pessimizing moves on return #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weatherhead99
Copy link
Contributor

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.

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.
@acki-m
Copy link
Contributor

acki-m commented Aug 13, 2019

seems to be not working with the older compilers

@SnapperTT
Copy link

SnapperTT commented Nov 20, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants