0

The C++11 standard says:

20.8.1 Definitions [func.def]
1 The following definitions apply to this Clause:
2 A call signature is the name of a return type followed by a parenthesized comma-separated list of zero or
more argument types.
3 A callable type is a function object type (20.8) or a pointer to member.
4 A callable object is an object of a callable type.

So my understanding is, a function is an instance of function type, so function is not "callable type". But definitely we can call functions.

This definition is a bit weird to me. Where did I get wrong?

Troskyvs
  • 7,537
  • 7
  • 47
  • 115
  • 3
    where do you read that a function is an instance of function type? It says a callable type is a function object type and an object of this type is a callable type. – user2393256 Jul 01 '16 at 11:57
  • 1
    A function is not an object, so nothing in this clause applies to functions. A pointer-to-function type, on the other hand, is a function object type, and hence a callable type. A pointer-to-function is then a callable object. Further, thanks to *function-to-pointer conversion* **[conv.func]**, "function" and "pointer-to-function" are interchangeable for most practical purposes (but not necessarily for formal standardese). – Igor Tandetnik Jul 01 '16 at 14:10

0 Answers0