[C++-sig] Py++ and inner template classes

Roman Yakovenko roman.yakovenko at gmail.com
Mon Apr 28 17:26:01 CEST 2008


On Mon, Apr 28, 2008 at 3:58 PM, Pertti Kellomäki
<pertti.kellomaki at tut.fi> wrote:
> Can Py++ expose inner classes that come from templates?
>  I have code which is basically equivalent to the following:
>
>  class Outer {
>  public:
>   template <typename T>
>   class Inner {
>   public:
>     Inner(T);
>   };
>   typedef Inner<int> Inner_int;
>   Inner_int f();
>  };
>
>  If I use the Py++ module_builder to create bindings for
>  the code, the class Inner_int is not exposed, and I get
>  the warning
>
>  WARNING: Outer::Inner<int> [class declaration]
>  > execution error W1040: The declaration is unexposed, but there are other
> declarations, which refer to it. This
>  > could cause "no to_python converter found" run time error. Declarations:
> Outer::Inner<int> Outer::f() [member
>  > function]

I just created new test case and everything works fine:
http://pygccxml.svn.sourceforge.net/viewvc/pygccxml?view=rev&revision=1315

I attached the generated code.

I guess you somehow excluded the class.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: inner_tmpl_class.cpp
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080428/34947144/attachment.txt>


More information about the Cplusplus-sig mailing list