← Back to team overview

kicad-developers team mailing list archive

Re: Coding style question


Hi Tom,

> - always use std::shared_ptr<TYPE> explicitly?

I'd vote for explicit smart pointers in function signatures and member
definitions, and "auto" in places where it can be deduced.

MSVC's /ANALYZE also has some helpful diagnostics like C26418[1] "Shared
pointer parameter X is not copied or moved. Use T* or T& instead." to find
instances where smart pointers wouldn't be needed.


[1] https://jenkins.simonrichter.eu/job/windows-kicad-msvc-analyze-head/build=release,cpu=amd64,label=msvc/70/msbuild/category.1965989428/#issuesContent