I have a static non-member function which returns a template class object depending on the type of the object.
template< typename T >
class Example
{
....
};
static Example non_member_function(int var) {
if (var == 1)
return Example<float>;
else
return Example<int>
}
This is not working as return type Example is a template. How can I write this return type