4 ms·
In general you can't do it in C++. There is no way to propagate the result type to the function call itself. The workaround it to return a proxy object with a
by gpderetta 9y ago
In general you can't do it in C++. There is no way to propagate the result type to the function call itself.
The workaround it to return a proxy object with a template conversion operator, which is very effective but it is a leaking abstraction.
edit: as long as you are willing to manually specify the result type you can of course have an additional template argument which is not deduced from any function arguments.