i need to invoke the conversion that way: object.operator int&Code:class MyClass { public: template <typename T> operator T& () { /* code here */ } } int my_func() { MyClass mc; mc.operator int& (); // !! fails to compile: error: no matching function for call to ‘MyClass::operator T&()’ }
(the reason is that im using bison, and trying to hack that damn stack/union stuff...)
(int&)object works though - but i can't use that.
it seems that the template argument needs to be specified in order to explicitely instanciate a function template. how can that be done?