Boost logo

Boost :

From: Hervé Brönnimann (hervebronnimann_at_[hidden])
Date: 2008-05-16 22:35:36


On May 15, 2008, at 10:40 AM, John Moeller wrote:
> Fair enough. I think, though, if you're going to try to make sure
> that
> the compiler doesn't miss multiplication by 1, you may as well go
> all the
> way and add another template parameter to capture N%2, and get rid
> of the
> ternary statement:

To be clear, I'm not concerned about optimizing multiplication by 1
for builtin types, of course. But it seems to me that the compiler
shouldn't really be able to optimize for user-defined types (what if
multiplication isn't inlined, for instance...)

--
Hervé Brönnimann
hervebronnimann_at_[hidden]

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