[Cython] Buffer must know exact C types

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Fri Jul 4 23:49:33 CEST 2008


Dag Sverre Seljebotn wrote:

> int main() {
>    int t;
>    cout << TypeChar<typeof(t)>::value;
> }
> 
> however I'm not sure if any tricks are possible in C to get something 
> like this?
> 

To be clear, C++ would then also allow this:

typedef int foo;
int main() {
   foo t;
   cout << TypeChar<typeof(t)>::value;
}

and so, one wouldn't need an "exact" foo ctypedef in Cython, one would 
just use the template to map the type to the character when needed...

-- 
Dag Sverre


More information about the Cython-dev mailing list