Do we still need to write the empty angle brackets when using transparent std function objects?

GCC is wrong. There is already a bug report.

[dcl.type.simple]/2 says:

A type-specifier of the form typenameopt nested-name-specifieropt template-name is a placeholder for a deduced class type ([dcl.type.class.deduct]).

And [dcl.type.class.deduct]/2 says:

A placeholder for a deduced class type can also be used in the type-specifier-seq in the new-type-id or type-id of a new-expression, as the simple-type-specifier in an explicit type conversion (functional notation) ([expr.type.conv]), or as the type-specifier in the parameter-declaration of a template-parameter. A placeholder for a deduced class type shall not appear in any other context.

Such use is allowed.


[temp.arg]/4 describes the syntax error that a template-id is required but there is no <>. However here std::greater is not resolved as a template-id so that paragraph does not apply.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)