Search code examples
c++standardslanguage-designc++17type-traits

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?


Solution

  • 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.