Grey Wolf wrote: |
---|
Abstract factory pattern? |
The typical abstract factory design pattern is useful when the choice of
the type of the object to create is made while the program executes.
I believe Disch picks a class during compilation and sticks with it the
whole time. Also, I believe he doesn't have the option to make that
choice while the program executes, because then he would have to
actually compile code for all his target platforms while he (obviously)
builds his project on one of them, and that would not be possible.
Therefore, he is doomed to use #ifdefs, whether he wants it or not.
I guess he could use the boost preprocessor library to somehow implement
a compile - time abstract factory pattern, though. That would be very neat.
sloppy9 wrote: |
---|
Why not foward declare the class too? |
That was the main idea in my previous posts.
@Disch:
I have some more questions.
Why is it bad to put Friend inside the namespace? And
why is it bad to even make it a static function of the class?