Notice how in this case my_func is called multiple times, even tho it would be possible to avoid the second call. This behaviour would be preferable because the call could be very expensive, even if inlined.
https://godbolt.org/z/WK1qbrcdh
Notice how in this case `my_func` is called multiple times, even tho it would be possible to avoid the second call. This behaviour would be preferable because the call could be very expensive, even if inlined.
The 'pure' attribute is already respected within the same expression: https://godbolt.org/z/Ezj5v7rTE
https://godbolt.org/z/WK1qbrcdh
Notice how in this case
my_func
is called multiple times, even tho it would be possible to avoid the second call. This behaviour would be preferable because the call could be very expensive, even if inlined.The 'pure' attribute is already respected within the same expression: https://godbolt.org/z/Ezj5v7rTE