
I might go further and add units (maybe defaulting to pixels)
typedef gui::rect<px,int> rect 1; typedef gui::rect<pc,double> rect 2; typedef gui:rect<mm,int> rect 3;
That looks great :)!
I disagree. I think you should stick to only one type (probably float for now, and eventually allow overriding it -- but, use this consistently throughout the app). Just think of the many places you'll need to deal with geometry (rectangle/point/size), and converting from one type of unit (px to cm, cm to in, etc) to another. And, about usability in code. Why would I want in my program, both: gui::rect<pc,double> and gui::rect<pc,int> ? This IMHO would confuse users of the library. Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/surfaces.html - Sky's the limit! -- http://www.torjo.com/cb/ - Click, Build, Run!