Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

c++11

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.

like image 639
BitTickler Avatar asked Feb 22 '15 13:02

BitTickler


People also ask

What is the syntax of search?

Search syntax allows you to perform searches for documents that have been linked together. Document relationship: This search will return entries given either side of a specific document relationship. This search will return at least two entries.

What is the syntax and rules to be followed when we search for fields?

However, the special field syntax allows you to search for specific terms in specific fields by typing (in the search box) the field name followed by a colon (":") and then the term you are looking for in that field. (Note that you cannot put any spaces before or after the colon.)

What is advanced search syntax?

Advanced search syntax gives you the ability to search your notes by special commands, like the date they were created, the type of content they contain (audio, images, etc.)

What is a search operator example?

Here are a few examples of advanced Google search operators: site: followed (without a space) by a website or domain returns files located there. filetype: followed by a file extension returns files of the specified type, such as DOC, PDF, XLS and INI.


1 Answers

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);
like image 77
T.C. Avatar answered Sep 29 '22 09:09

T.C.