What is the (searchable) name for this syntax...?

c++, c++11

Solution

I don't know of a common name for this. In the standard, it's called a type-id, after its grammar production.

The type-id `bool(int)` names the type "function of `(int)` returning `bool`".

It doesn't work with `typedef` (which uses the normal declaration syntax instead), but alias declared with `using` does use a type-id:

using MyFunctionType = bool(int);

Problem

``` typedef std::function<bool(int)> MyFunction; ``` That `bool(int)` template argument notation syntax - does it have a name? I tried to read C++ standard about this syntax and did not know what to search for. Obviously, using it in other contexts seems to fail. ``` typedef bool(int) MyFunctionType; // does not work. ``` So I assume there is a special chapter about this syntax somewhere... Thanks.

Original source