[gambit-list] (c-define-type array-int "std::vector<int>")

Marc Feeley feeley at iro.umontreal.ca
Fri May 5 17:54:33 EDT 2006


On 5-May-06, at 11:40 PM, Stephane Le Cornec wrote:

> Gambit does not tolerate :: or <> in this form. Is there any reason  
> why this wouldn't work, other than Gambit accepting the string?
>

No reason other than my lazyness.  C++ names are a pain to parse.  As  
a workaround use:

(c-declare "#define std_vector_int std::vector<int>")
(c-define-type array-int "std_vector_int")

> I could typedef std::vector<int> into std_vector_int for that, but  
> I lose genericity. The goal here is to use macro to generate  
> interface to native C struct and handle arrays of structs. I seems  
> much nicer to use lambda than to define
> the 8 conversion defines.
>
> Has anyone used in Gambit native C calls that accept/fill struct  
> arrays?
> How did you decide to handle this and why did you come to that  
> conclusion?

I'm not sure what you mean.

Marc




More information about the Gambit-list mailing list