AMDG Ovanes Markarian wrote:
Hicham,
it does not create a new new type it only declares a type.
Consider the following example:
template
struct X {}; This means your type X expects a function pointer type with return value int and no parameters. This can be used in a meta programming to make some type assumptions or inspection. This is how the result_of works. Think of result_of as of type X but a bit more complex and which can give an assumption about the function type passed. We can write:
template
struct X { typedef int type; }; <snip>
Here MyFunc is a name of the function pointer type, which allows us to reference this type from inside the template.
Hope that helps.
This has very little to do with result_of.
The expression result_of