When I say everything I mean, suppose I have a custom class with a container as a member field, and then a function that passes by reference values and appends them into that member field.
If I have a const instantiation of this class, will constantness filter down?
If I have a const STL iterator of a non const container (of my sharedPointers to instantiations of my custom class), what exactly is const about it? Will I be able to alter the contents of the container using the aforementioned function? Will the pointed to data be mutable but nothing else?
Off topic for this site.
If I have a const instantiation of this class, will constantness filter down? Yes.
If I have a const STL iterator of a non const container. If const iterator
then you cannot increment or decrement the iterator, but you can use it to modify its referent. If const_iterator
then you can increment or decrement it, but you cannot use it to modify its referent. In either case, other non-const iterators to the container may also exist, so the container may be modified by them.