Chapter 15 // Exercise 3
Modify Fct from the previous exercise to take an extra argument to control precision or whatever. make the type of that argument a template parameter for extra flexibility.
Github: Not done.
This was very confusing. I'm not good with templates; I don't particularly like them. By 'control precision' I thought he meant change doubles to ints or something but at the end of it all I have to convert the points into ints anyway as my version of Point only uses int.
And what does he want by it being a templated type? Would the precision mean "to this decimal place?" If it's templated, whats to stop someone from passing a string in? I'm so confused.
I've decided to just leave it as I don't understand what he wants me to do.
And what does he want by it being a templated type? Would the precision mean "to this decimal place?" If it's templated, whats to stop someone from passing a string in? I'm so confused.
I've decided to just leave it as I don't understand what he wants me to do.
No comments:
Post a Comment