> This is the main problem - it is saying there is no default assignment

> operator (because one of the members in pair is const). The solution is

> to avoid assignment. I've attached a patch to do this plus some error

> message corrections.

>

> William

I have tested your patch on both my platforms (Fedora/Guile 1.8 and Ubuntu/Guile 2.0) and it fixes the testcase twice. Great and thank you for helping out !

I notice that you do more than just strictly fixing the invalid const assignment. I would guess those are small changes that come from experience and best-practice programming.

Would you mind shortly describing why you did the following changes, so (and perhaps others on the list) can learn from them ?

- %typemap(in) pair<T,U> (std::pair<T,U>* m) {

+ %typemap(in) pair<T,U> %{

Here I notice you choose to change from {} delimiters to %{ %}. I read in the docs this means that the code block will not be parsed by the swig preprocessor. The code seemed to work ok before as well (other than the const assignment bug). So what made you change it ?

You also remove the (std::pair<T,U>* m) part. I don't know why it was there, or why you removed it.

- }

- %typemap(in) const pair<T,U>& (std::pair<T,U> temp,

- std::pair<T,U>* m),

- const pair<T,U>* (std::pair<T,U> temp,

- std::pair<T,U>* m) {

+ %}

+ %typemap(in) const pair<T,U>& (std::pair<T,U> *temp = 0),

+ const pair<T,U>* (std::pair<T,U> *temp = 0) %{

Here you do something similar. I'm mostly interested in why you changed

I gather this is added because you allocated memory using new, which has to be freed. While reading the docs to get to understand this, I also found the "freearg" typemap. With my limited knowledge I interpreted that typemap for this use case. Can you clarify my confusion here ?

I hope you won't find my questions too basic... I really feel I have much to learn still.

Oh, and lastly, what do I do with your patch ? Do I add it to my branch (and then how do I attribute you for it) ? Or will you apply it yourself after my patches have been merged in ?