Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Quesiton with 'const'
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Greg, post: 2544728"] The aim is probably to make "v" read-only in A's context, but read/writeable in some other context. Declaring the member vector const prevents anyone from modifying it. However a pointer to a const object need not point to a object declared const. So a member declaration of the form: const vector<int>* v; could point to a non-const std:vector<int>; all access to the vector through v though would have to treat the vector as const. Greg [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Quesiton with 'const'
Top