arximboldi / immer

Postmodern immutable and persistent data structures for C++ — value semantics at scale
https://sinusoid.es/immer
Boost Software License 1.0
2.51k stars 185 forks source link

Fix portability of IMMER_THROW when exceptions are disabled #275

Closed tjaneczko closed 10 months ago

tjaneczko commented 10 months ago

The current implementation of IMMER_THROW when exceptions are disabled relies on the compiler converting a character array to a truthy value, which can throw warnings and is not truly portable. Instead, we can use the comma operator to portably add additional data to an assertion: https://en.cppreference.com/w/cpp/error/assert.

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (5875f77) 90.53% compared to head (e644569) 90.53%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #275 +/- ## ======================================= Coverage 90.53% 90.53% ======================================= Files 119 119 Lines 12144 12144 ======================================= Hits 10994 10994 Misses 1150 1150 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

arximboldi commented 10 months ago

Nice one!