Subject: [Boost-bugs] [Boost C++ Libraries] #8157: Access violation of const objects
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-23 14:13:27
#8157: Access violation of const objects
--------------------------------------------------+-------------------------
Reporter: MichaÅ KÄdrzyÅski <kedrzu@â¦> | Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.52.0 | Severity: Problem
Keywords: const |
--------------------------------------------------+-------------------------
There is an issue, that I've found, which is related with access
protection of the constant objects. Consider this piece of code, which is
derived from tutorial:
http://pastebin.com/v4vAFy4Z
(sorry about not pasting it right there, but comment slashes was
disapearing)
Though object is constant, while serializing it, values of its members
change, because object is cast to non-const in the implementation of
serialization. It of course causes program to behave unpredictably.
If the serialize() method would be forced to have the const qualifier,
there would be no problem, as no changes of members can be done in the
method.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8157> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC