Or how to detect performance regressions at compile time.
There does exist a clang-tidy check for this, performance-move-const-arg: https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance-move-const-arg.html
It also checks for when the argument is trivially copyable, where a std::move() would be a no-op.
yes, it does, but it's a separate tool that at best runs as part of CI or lint checks, which is why sometimes it's useful to rely only on built-in compiler facilities like static_assert.
That is true. While some IDE's, Emacs have plugins with clang-tidy integration, nothing drives the point like a static_assert().
There does exist a clang-tidy check for this, performance-move-const-arg: https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance-move-const-arg.html
It also checks for when the argument is trivially copyable, where a std::move() would be a no-op.
yes, it does, but it's a separate tool that at best runs as part of CI or lint checks, which is why sometimes it's useful to rely only on built-in compiler facilities like static_assert.
That is true. While some IDE's, Emacs have plugins with clang-tidy integration, nothing drives the point like a static_assert().