How does one implicitly call a class object's templated function call operator?
class User_Type
{
public:
template< typename T > T operator()() const;
};
void function()
{
User_Type user_var;
int int_var_0 = user_var.operator()< int >(); // explicit function call operator; ugly.
int int_var_1 = user_var< int >(); // implicit function call operator.
}
g++-4.9 -Wall -Wextra
's output error is:
error: expected primary-expression before ‘int’
auto int_var_1 = user_var< int >();
^