Sign in to follow this  
Pooya65

templates with same name but diffrent params

Recommended Posts

Pooya65    127
hi how can i use Templates with same name but different argument params? like as:
template <class T1>
class functor
{
.....
};

template <class T1,class T2>
class functor
{
........
}; 

and use them:
functor<void> = func1;
functor<void,int> = func2;

Share this post


Link to post
Share on other sites
Sneftel    1788
You can specify default values for template parameters, just like with functions. You can then use partial template specialization to treat templates with the default value specially, if you like.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this