Hi all. I am currently writing a large number class and was curious if I should use a template. I am setting up my constructors and I have one for a string and i was thinking i could use a template for a constructor so it can take in an int, float, double, etc. instead of writing a constructor for each type.
template<typename T>
Number
{
Number();
Number(string);
Number(T); // cover for built in number data types
}
I'm thinking this will make writing the code easier but I'm not sure if this will have unexpected consequences down the line. besides the fact some one could try and put a dog into the Number.