- better support for classes with no default constructor, equal or

comparison methods.

  you will be able to do

    struct Foo {
     Foo(int) {}
    };

    %std_nodefconst_type(Foo); // Says Foo has no def. constructor

    %template(vector_Foo) std::vector<Foo>;

  and the conflicting vector/list/deque methods will not be generated.


more cosmetic, and a note about the relation between std::map and
std::pair.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5810 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-03-31 11:27:53 +00:00
commit 29a30e2dcc
10 changed files with 79 additions and 77 deletions

View file

@ -34,6 +34,20 @@
%enddef
// **** Note ****
//
// If you are going to use a map, you need to instantiate both the
// map and the pair class:
//
// %template(pair_ii) std::pair<int, int>;
// %template(map_ii) std::map<int, int>;
//
// or
//
// %template() std::pair<int, int>;
// %template(map_ii) std::map<int, int>;
//
// **** Note ****
// ------------------------------------------------------------------------
// std::map
//
@ -82,8 +96,6 @@
template <class K, class T>
struct traits_asptr<std::map<K,T> > {
typedef std::map<K,T> map_type;
typedef K key_type;
static int asptr(PyObject *obj, map_type **val) {
if (PyDict_Check(obj)) {
PyObject_var items = PyMapping_Items(obj);
@ -157,7 +169,7 @@ namespace std {
%typemap_traits_ptr(SWIG_CCode(MAP), std::map<K, T >);
%std_map_methods(std::map<K, T >);
%std_map_methods(map);
%pydict_methods(SWIG_arg(std::map<K, T >));
};