Youtube - Lightning Talk find-move-candidates in Cpp - Chris Cotter - CppCon 2022

Lightning Talk: find-move-candidates in Cpp - Chris Cotter - CppCon 2022

https://youtu.be/F8wbpi2kTmY

Transcrição

 00:26

Pasted image 20240105011323.png

 00:55

Pasted image 20240105011351.png

 01:49

Pasted image 20240105011432.png

Pasted image 20240105011449.png
1 https://github.com/bloomberg/clangmetatool find-move-candidates not open source (yet)

 02:51

Pasted image 20240105011546.png
When can the tool safely suggest a move? e std::move might change meaning of code o E.g., moving shared_ptr<unique_lock> can release mutex too soon o Anything with a user defined destructor e Some types are always safe to move o std::string o Trivial types is_trivial o Trivially destructible types o Containers or algebraic types of safe to move types m std::vector<std::map<int, int>>

 04:19

Pasted image 20240105011734.png
Helping teach modern C++ e Inexperienced C++11 developers who are not be familiar with move semantics e Hook the tool up in Cl to suggest std: :move e New clang-tidy modernize check? e What other tools can we add?

Pasted image 20240105011831.png