Is it possible to create one function which is only available if the class is instantiated with a specific type? (Without rewriting the whole class for that type?)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand what you’re after, one possibility would be to use a base class that contains the other functions, then have a template and a specialization that both derive from that base class, with the specialization adding the extra function you want: