research-computing-with-cpp icon indicating copy to clipboard operation
research-computing-with-cpp copied to clipboard

Use brace initialization instead of copy initialization

Open krishnakumarg1984 opened this issue 1 year ago • 0 comments

@mmcleod89 Let us systematically replace all uses of C-style copy initialisations with uniform brace initialisation. This is a best practice that will prevent narrowing conversions.

See this C++ core guideline here for more explanation from Stroustrup: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-list

krishnakumarg1984 avatar Nov 09 '22 20:11 krishnakumarg1984