Topic: Syntax for calling template member functions


Author: Branko Cibej <branko.cibej@hermes.si>
Date: 1997/09/18
Raw View
Given the following declaration:

    struct functor {
        template<typename T> T operator() () const;
    };

What is the correct syntax for calling functor::operator() ?
As I understand it, one way would be, e.g.,

    int i;
    functor f;

    i = f.template operator()<int>();

but that is so ugly that it would be better to live without an operator()
at all.

    Regards,
        Brane

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]