The data() method seems to get a wrong return type:
auto data() const noexcept {
if constexpr (bytes_saved() > 0)
return compressed_data; // unsigned char[]
else
return raw_data; // huffman_string_container
}
Should return raw_data here be changed to return raw_data.data?