You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies in advance if this is not the right place to ask questions. For reasons of backward compatibility (especially ABI compatibility), I am stuck with std::forward_list. So, switching to std::list is not possible.
TypeError: in method 'A_foo', argument 2 of type 'std::forward_list< A,std::allocator< A > > const &'
Additional information:
Wrong number or type of arguments for overloaded function 'A_foo'.
Possible C/C++ prototypes are:
A::foo(std::forward_list< A,std::allocator< A > > const &)
A::foo(std::forward_list< A,std::allocator< A > > &&)
Traceback (most recent call last):
File "/tmp/./testfoo.py", line 6, in <module>
a.foo([])
TypeError: in method 'A_foo', argument 2 of type 'std::forward_list< A,std::allocator< A > > const &'
Additional information:
Wrong number or type of arguments for overloaded function 'A_foo'.
Possible C/C++ prototypes are:
A::foo(std::forward_list< A,std::allocator< A > > const &)
A::foo(std::forward_list< A,std::allocator< A > > &&)
If this was std::list or any other mapped container, then the following interface:
Since this is not the case, I assume the best way (if not the only way) to handle this ambiguity would be to map the type on its own interface file. So I am looking for documentation on how to map a new container type or any workaround to resolve that ambiguity.
Any ideas?
The text was updated successfully, but these errors were encountered:
pp4x
changed the title
Question: how to deal with std::forward_list<T> ?
Question: how to handle std::forward_list<T> ?
Apr 16, 2024
I made my attempt at this, starting from std_list.i, but got stuck with a C++ compile error, because std::forward_list doesn't provide a method insert, required a function assign implementation in std_container.i. Instead, the there is a function called insert_after.
Apologies in advance if this is not the right place to ask questions. For reasons of backward compatibility (especially ABI compatibility), I am stuck with
std::forward_list
. So, switching tostd::list
is not possible.And this interface file
It compiles (this is a conversion to python) but, when trying this python script is run:
this is the error I get:
If this was
std::list
or any other mapped container, then the following interface:Would make things work.
Since this is not the case, I assume the best way (if not the only way) to handle this ambiguity would be to map the type on its own interface file. So I am looking for documentation on how to map a new container type or any workaround to resolve that ambiguity.
Any ideas?
The text was updated successfully, but these errors were encountered: