Re: [Swig-user] c++ class with template template argument, gives a syntax error

19 views
Skip to first unread message

William S Fulton

unread,
Mar 22, 2012, 5:29:06 PM3/22/12
to Serge Ratke, swig...@lists.sourceforge.net
On 22/03/12 17:42, Serge Ratke wrote:
> hey,
>
> consider the following class declaration
>
> ==========================================
>
> #include <vector>
>
> using namespace std;
>
> template < template < class,class > class V, class T>
> class Test
> {
> public:
> Test()
> {
> }
>
> virtual ~Test()
> {
> }
>
> private:
> V<T, allocator<T> > m_t;
> };
>
> ==========================================
>
> and the following test.i
>
> ==========================================
>
> %module test
>
> %{
> #include "test.h"
> %}
>
> %include "test.h"
>
> %template(TestInt) Test<vector,int>;
>
> ===========================================
>
> the following call to swig gives me an error where the template <
> template ... declaration is located
>
> swig -c++ -lua test.i
>
> am i doing something wrong (some declaration missing)? found the
> question on so:
> http://stackoverflow.com/questions/6215165/wrapping-template-template-parameter-class-with-swig
>
> any advices as to how to circumvent this bug?
>
A known bug, I'm afraid:

https://sourceforge.net/tracker/index.php?func=detail&aid=3007410&group_id=1645&atid=101645

https://sourceforge.net/tracker/index.php?func=detail&aid=2931602&group_id=1645&atid=101645

and here which contains a workaround you might be able to use:

https://sourceforge.net/tracker/index.php?func=detail&aid=1861407&group_id=1645&atid=101645

But really it would be nice if someone got suitably inspired to have a
go at fixing the parser.

William

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Swig-user mailing list
Swig...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user

Reply all
Reply to author
Forward
0 new messages