By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,881 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,881 IT Pros & Developers. It's quick & easy.

Why Can't we make constructor as constant

P: 10
hello friends
I want to know that why can't we make a consturctor function a constant function.
Please provide the solution
Sep 22 '06 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
hello friends
I want to know that why can't we make a consturctor function a constant function.
Please provide the solution
A constant member function cannot modify any data members or call any member functions that aren't constant. If you really think about the uses of the constructor, you might be convinced that it would therefore be useless to define a constructor as constant
Sep 22 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.