c++ - Why isn't zlibs z_stream::next_in const? -
i integrating code stack-overflow question, uncompresses data qbytearray
application.
since enabled compiler errors, have reinterpret_cast , const_cast qbytearray::data():
z_stream strm; strm.next_in = reinterpret_cast<bytef *>(const_cast<char *>(data.data()));
why input parameter non-const? in opinion, suggests, data somehow modified, not want , not believe happening.
by default z_stream
interface functions aren't const
, presumably legacy reasons.
you can build zlib const
support running configure
--const
.
Comments
Post a Comment