5 ms·
auto with lambdas can be quite dangerous if you are adding different types inside their bodies. Type promotion rules should be well understood. During code revi
by dbyte 11y ago
auto with lambdas can be quite dangerous if you are adding different types inside their bodies. Type promotion rules should be well understood. During code reviews we spotted several overflow bugs when using ints because the dev were thinking auto as a sort of very powerful resource.
Explicit casting if often required to make sure subtle bugs won't show up in production.
- cheez 11y agoWhat do you mean about promotion rules with auto?
- RotsiserMho 11y agoCouldn't that have been found by turning on the signed-to-unsigned conversion warning?