by elpocko on 2/8/25, 2:36 PM with 35 comments
by s5ma6n on 2/8/25, 3:50 PM
by HexDecOctBin on 2/8/25, 4:09 PM
by amadio on 2/8/25, 10:25 PM
https://github.com/RandyGaul/cute_headers/blob/755849fc2819d...
I fixed this exact problem in a highly used library in high energy physics:
https://gitlab.cern.ch/CLHEP/CLHEP/-/commit/5f20daf0cae91179...
Many believe the C++ compiler will magically optimize the switch away, but in some cases, like the example above for CLHEP, it doesn't happen, so you end up with bad performance.
by test1235 on 2/8/25, 4:58 PM
I'm sure I've also spotted him in the SDL channels.
by quotemstr on 2/8/25, 4:46 PM
Header-only libraries are static linking.
by malkia on 2/8/25, 5:04 PM
That's fine though. AFAIK, there is no sane way (across platforms) to have singletons, and that involves some of the the trick above, unless you know someother way
If you do, please add your idea here - https://github.com/open-telemetry/opentelemetry-cpp/issues/2... - "Header only singletons are not working properly for Windows #2534"
by steeleduncan on 2/8/25, 4:10 PM
I'm always suspicious of "Professional" in descriptions like this as it is a meaningless word you add to make it sound impressive.
Also, in this case it means a 900 line math library with 78 lines of tests...
by Alifatisk on 2/8/25, 4:53 PM
by NullPrefix on 2/8/25, 3:52 PM