Re: [Cython] Template functions

2013-03-18 Thread Robert Bradshaw
On Sun, Mar 17, 2013 at 12:15 PM, John Tyree wrote: >> >> I was thinking of something along the lines of >> >> cdef extern from ...: >> cpp_string to_string[T](T value) >> T my_func[T, S](T a, S b) >> ... >> >> It's more a question of how to implement it. >> >> - Robert > > Well this c

Re: [Cython] Template functions

2013-03-17 Thread John Tyree
> > I was thinking of something along the lines of > > cdef extern from ...: > cpp_string to_string[T](T value) > T my_func[T, S](T a, S b) > ... > > It's more a question of how to implement it. > > - Robert Well this closely matches the syntax used for classes and won't require an

Re: [Cython] Template functions

2013-03-16 Thread Robert Bradshaw
On Sat, Mar 16, 2013 at 10:16 AM, John Tyree wrote: > There is currently a void in Cython's C++ support with respect to function > (not > class) templates. It would be great to have such a thing, dangerous or not, so > I'm proposing something to get things rolling. > > Given that function templat

[Cython] Template functions

2013-03-16 Thread John Tyree
There is currently a void in Cython's C++ support with respect to function (not class) templates. It would be great to have such a thing, dangerous or not, so I'm proposing something to get things rolling. Given that function templates are 100% transparent to the caller, it seems that the only bar