We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f4c744 commit d96b670Copy full SHA for d96b670
test/unit/zero_cost_square.cpp
@@ -54,10 +54,16 @@ auto square_scaled_integer(float input)
54
auto square_elastic(float input)
55
{
56
// alias to scaled_integer<elastic_integer<31, int>, -16>
57
- auto fixed = elastic_scaled_integer<15, power<-16>>{input};
+ // NOLINTNEXTLINE(cppcoreguidelines-owning-memory)
58
+ auto fixed = new elastic_scaled_integer<15, power<-16>>{input};
59
60
// concise, safe and zero-cost!
- auto prod = fixed * fixed;
61
+ auto prod = *fixed * *fixed;
62
+
63
+ if (input > 42) {
64
65
+ delete fixed;
66
+ }
67
68
return static_cast<float>(prod);
69
}
0 commit comments