Qual è il modo migliore per creare una funzione che abbia come argomento il puntatore con boost python? Vedo che ci sono molte possibilità per i valori di ritorno nei documenti, ma non so come farlo con gli argomenti.Argomento del puntatore per potenziare python
void Tesuto::testp(std::string* s)
{
if (!s)
cout << " NULL s" << endl;
else
cout << s << endl;
}
>>> t.testp(None)
NULL s
>>>
>>> s='test'
>>> t.testp(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
Tesuto.testp(Tesuto, str)
did not match C++ signature:
testp(Tesuto {lvalue}, std::string*)
>>>
a passare un riferimento a Boost.Python è un problema, possiamo solo passare il riferimento const, a meno di implementare il nostro wrapper di riferimento, hai qualche idea su come implementarlo? –