UCL / research-computing-with-cpp

UCL-ARC *C++ for Research* course
https://github-pages.ucl.ac.uk/research-computing-with-cpp/
25 stars 18 forks source link

Use brace initialization instead of copy initialization #101

Open krishnakumarg1984 opened 1 year ago

krishnakumarg1984 commented 1 year ago

@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