Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Concepts replace SFINAE?

Tags:

c++

Concepts likely to be in the C++ standard (C++17, or maybe C++20).

So I wonder if this new feature can completely replace SFINAE, or it's just a small version of SFINAE with nice error reports and type checking.

Are there any cases when SFINAE is the only choice instead of using Concepts?

like image 787
so61pi Avatar asked Jan 25 '15 04:01

so61pi


1 Answers

With concepts taking shape and being implemented in compilers (currently only gcc >= 6.1 with option -fconcepts), it appears that they can do everything that you could have done using SFINAE only much better (much clearer expression of intent and producing concise error messages), and much more (such as abbreviated templates).

So the simple answer is YES.

like image 133
Walter Avatar answered Oct 22 '22 01:10

Walter