9

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?

so61pi
  • 780
  • 2
  • 7
  • 21

1 Answers1

10

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.

Walter
  • 44,150
  • 20
  • 113
  • 196