c++ - Why can't functions be overloaded by return type? -
possible duplicates:
function overloading return type?
puzzle: overload c++ function according return value
because have library exposes bunch of functions in form of:
bool getval(); double getval(); int getval(); long getval(); //so on.
and have wrap these. i'd rather not rewrite same set of functions again. i'd like
template<class t> t getval(){}
but can't seem working. ideas?
you can't overload on return types not mandatory use return value of functions in function call expression.
for example, can say
getval();
what compiler now?
Comments
Post a Comment