|
-
June 18th, 2012, 08:55 AM
#5
Re: static const class instances
 Originally Posted by tuli
The problem: The DisplayProvider would have to do some pre-processing, before handing over control to the base class, which then does the main work.
What you are saying here doesn't make much sense (to me). A struct or class defines a type. A type cannot actually do something, only functions can do something.
I think you need to explain better at which point in your program you need to do preprocessing, what needs to be preprocessed, and where the preprocessed data then needs to be used.
 Originally Posted by tuli
I would end up with something like this:
PHP Code:
class DispalyProvider
{
baseclass* owner;
int settings[10];
void PreProcessing(...);//ends up calling the owner.Processing(...) function
};
This doesn't make much sense either. If you have const instances of DisplayProvider then you cannot call the member function on them, since it is not a const member function. If you would make the member function const, it would seem to be a no-op, since it cannot modify the member variable.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
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
|