8000 Explicitly use std::move by WinterSolstice8 · Pull Request #349 · bombela/backward-cpp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Explicitly use std::move #349

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

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

Conversation

WinterSolstice8
Copy link

I'm using this library in a project that makes heavy use of linters/clang format etc and not using qualified std::move was causing compilation errors specifically in clang.

I made this change to accommodate for that

@bombela
Copy link
Owner
bombela commented Apr 14, 2025

The reason for using move unqualified is because it is std::move on C++11 and onward. But it is template <typename T> T &move(T &v) { return v; } on C++98. Which somewhat behaves a bit like std::move thanks to copy elision.

See what is being imported/set before/after C++11: https://github.com/bombela/backward-cpp/blob/master/backward.hpp#L414

@lahwaacz
Copy link
Contributor

However, the build system requires C++11: https://github.com/bombela/backward-cpp/blob/master/CMakeLists.txt#L65

@bombela
Copy link
Owner
bombela commented Apr 15, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0