
21 Jun
2009
21 Jun
'09
2 p.m.
Steven Watanabe wrote:
It's better to use non-members for operator+, operator-, etc.
In the case of a template class like SafeInt<T>, do you think the binary operator+, operator-, etc., should be friend functions, defined inside the class declaration, or template functions? Note that I've just posted a slightly related ticket on David LeBlanc's SafeInt: "Potential performance gain from non-member operator+" http://safeint.codeplex.com/WorkItem/View.aspx?WorkItemId=7910 BTW, I do think it would be great to have such a library in Boost. Kind regards, Niels -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center