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


1
Expert's answer
2020-12-24T03:55:37-0500
Dear Nilesh , your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS