Hi all,
I added a proper constructor for nodepath that does nothing at the moment. It should be private, people should use sp_nodepath_new to create new nodepaths. However, this does not work:
namespace Inkscape { namespace NodePath { class Path { private: Path() {}; friend Path * sp_nodepath_new (SPDesktop *, SPObject *, bool, const char *, SPItem *);
...
};
} }
Inkscape::NodePath::Path * sp_nodepath_new (SPDesktop * desktop, SPObject *object, bool show_handles, const char * repr_key = NULL, SPItem *item = NULL);
This gives a compiler error when newing Path in sp_nodepath_new.
Can someone else try and see if it works on Linux for example?
thanks a bunch,
Johan
J.B.C.Engelen wrote:
Hi all,
I added a proper constructor for nodepath that does nothing at the moment. It should be private, people should use sp_nodepath_new to create new nodepaths. However, this does not work: (snip)
The friend function has to be declared before the friend statement. Otherwise it will not work. By the way, consider making the constructor protected instead of private, because private constructors make inheritance impossible.
Regards, Krzysztof Kosiński
participants (2)
-
unknown@example.com
-
Krzysztof Kosiński