c++ - Visual Studio 2015: is a set of const pointers allowed? -
we upgrading vs2015 soon, , found in breaking changes list:
const elements
the c++ standard has forbidden containers of const elements (such vector or set). visual c++ 2013 , earlier accepted such containers. in current version, such containers fail compile.
i wondering if knows if applies set. know map can still contain const pointers keys, since const anyway.
an example:
std::set<const qobject*>
can still this? think not, according post on site of microsoft.
const qobject*
pointer to a const qobject
. pointer still modifiable. const qobject* const
make pointer const
.
since microsoft article talks const
objects, const qobject*
not, example fine.
Comments
Post a Comment