|
-
September 28th, 2009, 11:08 AM
#6
Re: what changes to class lead to recompile?
 Originally Posted by abeginner
So, seems like addiing constructor would require recompile of lib. Same for (d), adding default value to a function.
correct?
You're probably right about a. I didn't consider the case when the added constructor overloaded an existing one.
In d on the other hand, if you have
class A {
void a(double d) {...}
}
and change to,
class A {
void a(double d=0.0) {...}
}
that would be syntactically equivalent to this,
class A {
void a(double d) {...}
void a() {a(0.0);}
}
Although adding default to a parameter corresponds to adding an overloaded method, the existing code cannot have any calls to the added overload, in this case a(). So it shouldn't require a recompilation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|