Lars Gullik Bjønnes wrote:
> | class os {
> | public:
> |         static void init(int argc, char * argv[]);
>>
> |         static string const & binpath();
> |         static string const & binname();
> |         static string const & homepath();
> |         static string const & nulldev();
> | private:
> |         struct impl {
> |                 virtual string const & binpath() const = 0;
> |                 virtual string const & binname() const = 0;
> |                 virtual string const & homepath() const = 0;
> |                 virtual string const & nulldev() const = 0;
> |         };
> |         static boost::scoped_ptr<impl> pimpl_;
> | };
> 
> Will this work? Remember that you can call a static function without
> the object.
> 
> (Ok I see what you want to do. (init should be private probably))

No, os::init() is called from main(int argc, char * argv).

A lot of these 'theoretical' problems with global data and order of 
initialization would go away if we had a single global LyX variable that 
held all other, currently global, variables.

Anyway, I class this all as a 'make the code nicer' project with no real 
user gains. I don't really see what it has to do with trying to get LyX 
running on Windows. In fact, producing something that works but is even 
clunkier than the existing code base (more #ifdefs) might provide even 
more motivation to refactor this piece of the code ;-)

Whereever this conversation goes, I don't think that any refactoring 
should be backported into the 1.3.x tree.

-- 
Angus

Reply via email to