Jean-Marc Lasgouttes wrote: >>> A little digression: instead of our current os:: namespace, >>> wouldn't it be better to have a hierarchy of os_foo classes with >>> static methods, so that some environment could inherit others (like >>> cygwin = unix + some stuff). The some of the code from this init >>> method could be moved to os_foo.C files. > > Angus> You can't have static virtual member functions, but you could > Angus> have either a "class os" (à la 13x) or a "namespace os" (à la > Angus> 14x) that hid the implementation: > > Did I say virtual? I thought of static member functions and os.h would > do > > #if in unix > #include "os_unix.h" > typedef os_unix os; > #else if in win32 > #include "os_win32.h" > typedef os_win32 os; > ...
You're just too clever for me ;-) However, static member functions can't inherit, which is what I thought the point was: class os_unix {}; class os_cygwin : public os_unix { // Override some specific member function. }; If you want to do something like that, then some sort of indirection with "class os" hiding a member variable, is inevitable I fear. Anyway, the principle point remains. Do you want to do this in the 1.3.x series or should we leave that as "ugly but working"? -- Angus