[C++-sig] py++ with template member function of template class

Roman Yakovenko roman.yakovenko at gmail.com
Tue Jun 17 21:21:18 CEST 2008


2008/6/17 Soloman <soloman817 at msn.com>:
> Hi,
>
> I have met a problem using py++ (pyplusplus) to generate code.
> I followed the instruction in py++ homepage->FAQ, and this works, a call to
> a.foo<int> will generate an instance of that template member function.
>
> But, then, I used template class, and it won't work any more:
> /////////////////////////////////////////////////////////////////////////
> // test template member function in template class
> // THIS WON'T WORK!!!!!!!!!!!!!
> template <typename A>
> class BFunc
> {
> public:
>     template <typename T>
>     T foo(const T& t) const;
> };
>
> template <typename A> template <typename T>
> T BFunc<A>::foo(const T& t) const { return t + 1; };
>
> #ifdef PYTHONWRAP

Unfortunately GCC-XML doesn't dump the information. I am also not
aware of any workaround :-(.

You will have to create the code by yourself. Py++ allows you to
integrate your code easily(
http://language-binding.net/pyplusplus/documentation/inserting_code.html
)

HTH

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list