[Cython] Non-type template parameters

Ian Henriksen insertinterestingnamehere at gmail.com
Thu Oct 1 07:31:49 CEST 2015

> I'd like to see this feature merged rather sooner than later. Would it help
> if we only require a type to be there (so that people get the syntax right
> in their code) but do not validate it for now?
> Stefan

Sorry for the delay, I've been mulling over what to do about this and
haven't been fully
satisfied with any of the answers. Not requiring the checks for now would
definitely make this
faster to implement though. My biggest concern is that, in C++, the types
can actually play a
significant role in the implementation of a given operation, and many of
the things that go
into determining what type may be returned are things that we don't want to
have visible in
Cython. Features like SFINAE and enable_if may be difficult for us to
support, but
syntactically, they don't use much fancy syntax. At some point, it seems to
be in the best
interest of our users if we let the C++ compiler finish off the type
checking rather than
requiring that all the type information be present in Cython. As near as I
can tell, adding type
specifiers to non-type template parameters won't put us into much murky
water though, so I'll
take another shot at adding the new syntax.

Thanks for following up here.

-Ian Henriksen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20151001/24a28efe/attachment.html>

More information about the cython-devel mailing list