Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > const member functions

Reply
Thread Tools

const member functions

 
 
Denver Dash
Guest
Posts: n/a
 
      12-01-2003
I've been having trouble with my news reader. Sorry if I posted this message
multiple times...

Hi. I heard once that there is a way to allow a const member function to
alter the value of a member if the member is declared in some way. Can
someone tell me how to do that, or is this impossible?

For example:

class foo
{
specialdeclaration int index;
void bar() const
{
index = 0; \\ ok because index has been declared in a special way.
}
};

thanks,
denver.







 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
overloading non-template member functions with template member functions Hicham Mouline C++ 0 04-23-2009 11:42 AM
const correctness - should C++ prefer const member over non-const? fungus C++ 13 10-31-2008 05:33 AM
const vector<A> vs vector<const A> vs const vector<const A> Javier C++ 2 09-04-2007 08:46 PM
const objects ->const member functions? puzzlecracker C++ 2 02-07-2005 08:10 AM
Picking const vs. non-const member functions upon a call cheeser C++ 17 10-18-2003 06:35 AM



Advertisments