Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1265

Answer by HolyBlackCat for C++ mark arithmetic hard-coded fraction as constexpr in a one-liner

$
0
0

You're starting with a wrong premise.

All three major compilers (Clang, GCC, MSVC) generate worse assembly with constexpr variable when optimizations are disabled, and the same assembly when optimizations are enabled.

Here's Clang, for example: https://godbolt.org/z/qjvherx4v

Don't waste time worrying about microoptimizations on non-existent weird compilers.


Viewing all articles
Browse latest Browse all 1265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>