[C++-sig] (Fwd) Previous email to Nicodemus

Niall Douglas s_sourceforge at nedprod.com
Tue Aug 5 04:26:48 CEST 2003

On 4 Aug 2003 at 21:19, Nicodemus wrote:

> >It's why python's great! I haven't had so much fun programming in it
> >since BBC Basic V on the Acorn Archimedes (a wonderful system for its
> > day)! A marriage between my C++ and python environments would be
> >ideal ... at least till I get some time to write the lazy functional
> >language I've always wanted to write (Haskell's too esoteric).
> Yes, I have this feeling too. But the merriage you propose between C++
> and Python is already possible: we have been using it with great
> sucess at our company.

I've wrapped /easy/ stuff ok and fine. But this library is proving 
hard. Has anyone tried wrapping the Qt library with boost.python? If 
so, please let me know - FOX is very like Qt.

> >class FXTopWindow : public FXWindow // in FXTopWindow.h
> >{
> >	FXObject *foo2();
> >}
> >
> >class FXWindow // in FXWindow.h
> >{
> >	FXObject *foo();
> >};
> >
> >If I do AllFromHeader on FXTopWindow.h, it pulls in all the base
> >classes of FXTopWindow (correctly) and then asks for you to set the
> >return policies of foo() and foo2().
> >
> >Now if I'm also doing FXAllFromHeader on FXWindow.h in the same pyste
> > file, it'll want a return policy set on foo(). My point is that if
> >you've already set the policy for foo() in FXWindow, you also set the
> > policy for all inherited versions of foo() in all subclasses of
> >FXWindow (because apart from covariant return, return types must stay
> > identical in overloads in C++). 
> >
> I couldn't reproduce this problem, actually. If you do an
> AllFromHeader in FXTopWindow, it should only complain about the lack
> of policy for FXTopWindow.foo2, since FXWindow won't be exported at
> that time. In other words, only when a function is about to be
> exported the check for a policy is made. But if instead of "foo2()" in
> FXTopWindow you meant "foo()", then I see the problem. 8)

No, because FXWindow::foo() is inherited by FXTopWindow, ie; there is 
also a FXTopWindow::foo().

My point is that if you tell pyste what FXWindow::foo() returns, it 
already knows the answer for FXTopWindow:foo() and doesn't need to 
ask again.


More information about the Cplusplus-sig mailing list