Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is "std::is_callable" replaced with "std::is_invocable" in C++17?

cppref has removed the entry page for std::is_callable, and use std::is_invocable entry page instead.

However, std::is_callable is still available in Visual Studio 2017.

Is std::is_callable formally [replaced|deprecated|removed] with std::is_invocable in C++17?

like image 246
xmllmx Avatar asked Mar 26 '17 06:03

xmllmx


1 Answers

Yes, is_callable has been renamed is_invocable as described in p0604r0. The paper includes the rationale for this decision:

Rename is_callable to is_invocable: is_callable would be the most natural name for a trait that answers the question whether a function call expression would be valid or not, which is a strict subset of the expressions, INVOKE supports, furthermore the changed name is_invocable much clearer expresses its meaning. Releasing the name is_callable allows us in the future to possibly introduce a pure is_callable trait.

like image 181
Praetorian Avatar answered Oct 04 '22 02:10

Praetorian