I am writing a C++ class over the C PyObject so it can be handled more easily, for example when working with arrays, calling PySequence_GetItem a hundred times gets really annoying :D
I successfully managed to make something like "data[0][12].c_str()" to return the proper value.
Now, when I try to overload the [] operator with a const char*(to make dicts with string keys work, I have alot of them), I get a somewhat logical complaint from gcc. It says the overload is ambiguous; I guess gcc doesn't know whether the number I give as an argument is a char* or a size_t:
error: ambiguous overload for 'operator[]' in 'temp[0]' .\PyVariable.h|13|note: candidates are: PyVariable PyVariable::operator[](size_t) .\PyVariable.h|14|note: PyVariable PyVariable::operator[](const char*)
So... how do I fix this :P ?
Thanks for you help.


Sign In
Create Account


Back to top









