|
-
February 1st, 2006, 10:25 AM
#6
Re: Clone function (pure virtual base class)
 Originally Posted by dus
Also I'm wondering why it is not allowed to use protected data members of the base class as default parameters of (pure) virtual functions defined in this base class.
You cannot dynamically bind default values in function definitions because the function type is defined statically and the default value is part of the function type. Thus the compiler must know the default value at compile time and does not figure it out at runtime.
NMTop40's approach (with the NVI idiom) was IMHO the best solution for this problem. But I still wonder whether whatever you want to do is well designed; sorry, but it looks a little strange to me.
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
|