Boost logo

Boost :

Subject: Re: [boost] SafeInt code proposal
From: Niels Dekker - address until 2010-10-10 (niels_address_until_2010-10-10_at_[hidden])
Date: 2009-06-21 10:00:27


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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk