Constructor missing in Swig4.0 new std_vector.i ?

Jean-Max Redonnet <[email protected]>
Newsgroups gmane.comp.programming.swig
Message-ID <CAMFfBxxpQ1fyBEezUMZqtEs5-RkT2YsCJLkEGJ01hvnwXqeBXA@mail.gmail.com>
Hi,

I am using Swig to wrap a C++ library with Java.

With Swig3.0, I used to write
%template(MyClass) vector<namespace::EnumType>;
and that's all. A fully functional MyClass was created.

Using Swig4.0, compilation still works but I lack the simple constructor
vector(size_type n);

Indeed, comparing std_vector.i files make appear this constructor is no
longer present in Swig4.0:
Swig3.0 std_vector.i  (extract)
      vector();
      vector(size_type n);
      size_type size() const;
      size_type capacity() const;

Swig4.0 std_vector.i  (extract)
      vector();
      vector(const vector &other);

      size_type capacity() const;

I probably miss something but reading the documentation doesn't really help
me (I'm not very familiar with C++, nor Swig).

Any hint to solve this problem would be really appreciated. And a solution
that works for both Swig 4.0 and Swig 3.0 would be ideal (I work with
people that still use Swig 3.0)

In advance, Thanks for any help.

jMax

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.