Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Given Concepts, are SFINAE helpers still in the spec as non-deprecated?

It appears that Concepts can do everything you could have done using SFINAE based techniques, only much better. The list of advantages includes increased readability of overload resolution and enabling to make compiler diagnostics substantially less verbose.

One option, given that all of these Concepts' features are already part of the new draft, is that some or all of these SFINAE related helper templates be declared deprecated.

My main concern here is feature fragmentation.

My question is whether such a proposal for deprecation has in fact been submitted?

like image 797
Geezer Avatar asked Aug 28 '18 12:08

Geezer


1 Answers

That seems like a rather pointless thing to do at this point. There is a lot of code out there using these templates, they won't be removed in the foreseeable future anyway.

Even removing trigraphs and the conversion from string literal to non-constant char* took quite a while, and at least the former was not even undisputed. (IBM wanted to keep them iirc.) Those templates have and had valid uses in current modern C++; they are here to stay.

Note that deprecating a feature in the C++ standard is a fairly drastic step, placing it under review for future removal. It is meant to be a temporary state; either the feature gets removed at some point, or is restored to be non-deprecated:

With the release of a new C++ standard, we get an opportunity to revisit the features identified for deprecation, and consider if we are prepared to clear any out yet, either by removing completely from the standard, or by reversing the deprecation decision and restoring the feature to full service.

In an ideal world, the start of every release cycle would cleanse the list of deprecated features entirely, allowing the language and library to evolve cleanly without holding too much deadweight. In practice, C++ has some long-term deprecated facilities that are difficult to remove, and equally difficult to rehabilitate. Also, with the three year release cadence for the C++ standard, we will often be considering removal of features whose deprecated status has barely reached print.

From P0619R3, emphasize mine.


At least for now. I'm not a member of the committee, so I can only speculate, but I would not rule out the possibility of deprecation at some point in the future, after concepts have settled in and if it becomes evident that the old helper templates do more harm than good.

like image 136
Baum mit Augen Avatar answered Oct 19 '22 04:10

Baum mit Augen