On Wednesday, 24 September 2014 at 00:08:19 UTC, H. S. Teoh via Digitalmars-d wrote:
You *will* need SFINAE if you expect to interface C++ template libraries with D. Imagine that an existing codebase is using some C++ template library that depends on SFINAE. You'd like to start migrating to D, so you start writing new code in D. Eventually you need to make use of the C++ template library in order to interface with the C++ parts of the
code, so you write a .di that declares template functions in an
extern(c++) block. It works... some of the time. Other times you start getting weird errors or the wrong functions get called, because the C++ template library was written with SFINAE in mind, but D doesn't have
that. So at the end of the day, it's a gigantic mess, and you go
crawling back to C++.


I think you can support a large part of C++ template without SFINAE. It is not that common and only matter for the binding if it changes the interface or the layout of something.

If one want to map these, it can be done with some static if magic. But I'm fairly confident that it won't even be necessary is most situations.

Reply via email to