1 /* 2 Lists 3 */ 4 5 %fragment("StdListTraits","header",fragment="StdSequenceTraits") 6 %{ 7 namespace swig { 8 template <class T > 9 struct traits_asptr<std::list<T> > { 10 static int asptr(VALUE obj, std::list<T> **lis) { 11 return traits_asptr_stdseq<std::list<T> >::asptr(obj, lis); 12 } 13 }; 14 15 template <class T> 16 struct traits_from<std::list<T> > { 17 static VALUE from(const std::list<T> & vec) { 18 return traits_from_stdseq<std::list<T> >::from(vec); 19 } 20 }; 21 } 22 %} 23 24 %ignore std::list::push_back; 25 %ignore std::list::pop_back; 26 27 #define %swig_list_methods(Type...) %swig_sequence_methods(Type) 28 #define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); 29 30 31 %rename("delete") std::list::__delete__; 32 %rename("reject!") std::list::reject_bang; 33 %rename("map!") std::list::map_bang; 34 %rename("empty?") std::list::empty; 35 %rename("include?" ) std::list::__contains__ const; 36 %rename("has_key?" ) std::list::has_key const; 37 38 %alias std::list::push "<<"; 39 40 %include <std/std_list.i> 41 42