The if-statement workaround seems dirtier to me. `assert` gets removed if `NDEBUG` is defined so it makes total sense to check for `NDEBUG`, don't you think?