Skip to content

Commit 839bbca

Browse files
committed
Remove throw expression from hex::num_encoded_tail_symbols()
It was only there for demonstrative purposes / consistency with other codecs, but conflicted with the noexcept declaration and thus caused a warning for at least VC14. Replaced it with a comment.
1 parent 3236725 commit 839bbca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cppcodec/detail/hex.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ class hex : public CodecVariant::template codec_impl<hex<CodecVariant>>
6868

6969
static CPPCODEC_ALWAYS_INLINE constexpr uint8_t num_encoded_tail_symbols(uint8_t /*num_bytes*/) noexcept
7070
{
71-
return true ? 0 : throw std::domain_error("no tails in hex encoding, should never be called");
71+
// Hex encoding only works on full bytes so there are no tails,
72+
// no padding characters, and this function should (must) never be called.
73+
return 0;
7274
}
7375

7476
template <uint8_t I>

0 commit comments

Comments
 (0)