From: Johan E. <jbc...@sw...> - 2014-06-15 23:12:20
|
On 16-6-2014 0:06, Vinícius dos Santos Oliveira wrote: > 2014-06-15 19:01 GMT-03:00 Johan Engelen <jbc...@sw... > <mailto:jbc...@sw...>>: > > Would like to hear your thoughts, > encouragement or otherwise [...] > > > Looks interesting. > > Why don't you create a new class, base_point and make point just a > typedef for base_point<double>? I think it'd break less code and speed > up refactoring. Also, it mirrors design found on the standard c++ > library itself (see basic_string and string, as an example). Thanks for that idea. Do you know if there is a good reason for that design? Perhaps default template arguments are a bad idea / hinder future development? I am a bit worried that it will hide functions that should be generalized to work with all kinds of Points, instead of just base_point<double>. Methods that are defined using Point will be template-specialized functions, and will not be available for base_point<float>; but I won't learn about them until some user complains that a certain obscure function is not available. Unfortunately, Inkscape is the only real (somewhat extensive) testcase that we have... I guess this is solved by a search for "Point" over the whole codebase, and changing it where necessary... -Johan |