You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're in a C++11 world (and indeed C++14 if you take VFX Platform literally). A huge amount of Imath should be marked constexpr, and for that matter there should be noexcept littered all over the place.
What I did in OIIO is directly 'constexpr' the things that could be so in C++11, and define a macro (we could call it ILMBASE_CONSTEXPR14, say) that would #define to constexpr if it detects C++ >= 14 but define to nothing for C++11. Maybe similar for 17 and 20. Then in the future as we raise the C++ floor, we can eventually make them unconditional constexpr.
It would also be helpful to noexcept all the things that aren't designed to throw exceptions.
Both of these are utterly trivial to do for any individual function, the pain is merely that there are dozens of headers to overhaul.
It shouldn't affect "source compatibility" -- in the sense that adorning Imath with constexpr and noexcept will not cause anybody to need to edit client software that uses libIlmbase, only to recompile to get the goodness.
The text was updated successfully, but these errors were encountered:
We're in a C++11 world (and indeed C++14 if you take VFX Platform literally). A huge amount of Imath should be marked constexpr, and for that matter there should be noexcept littered all over the place.
What I did in OIIO is directly 'constexpr' the things that could be so in C++11, and define a macro (we could call it ILMBASE_CONSTEXPR14, say) that would
#define
to constexpr if it detects C++ >= 14 but define to nothing for C++11. Maybe similar for 17 and 20. Then in the future as we raise the C++ floor, we can eventually make them unconditional constexpr.It would also be helpful to
noexcept
all the things that aren't designed to throw exceptions.Both of these are utterly trivial to do for any individual function, the pain is merely that there are dozens of headers to overhaul.
It shouldn't affect "source compatibility" -- in the sense that adorning Imath with constexpr and noexcept will not cause anybody to need to edit client software that uses libIlmbase, only to recompile to get the goodness.
The text was updated successfully, but these errors were encountered: