65 611
Assignments Done
99,2%
Successfully Done
In October 2018

Answer to Question #9859 in C++ for Nilesh

Question #9859
I have a template class where I instantiate templates for int, unsigned. I have declared constructors with the template type type as one of the arguments.
Now I want to include a constructor with same set of arguments but want to implenet it differently.
Eg: Constructor : radius is of type either unsigned or signed int.
template<class area, class radius>
const1(radius rad1)

now I want to implement a constr
const2(int check_area)
{
// here the implementation will be different when the radius is of type int.
}

But the problem is constructor is getting overloaded with some signature and that is not acceptable.
Is there any solution to this problem.

Thanks in advance,
-Nilesh
Expert's answer
This link will help you in your problem solving

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions