From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-26 14:23:31
From: "Joerg Walter" <jhr.walter_at_[hidden]>
> > I think I'd much prefer using expression
> > templates always, even in (otherwise) debug builds...
> Why? AFAIK using expression templates in debug builds increases compile
> times and object file size (but I'll recheck that).
Because the semantics could change in some cases, e.g.:
x = f(a + b + c);
If f is a function template, the deduced argument type will be different
when ETs are enabled, which could have consequences that are
hard-to-predict. I do nearly all of my testing against debug builds, and I
don't want to be surprised when I switch to release. I trust the compiler
to preserve semantics when I change optimization settings, but getting an
expression instead of a matrix in some generic function might be too big a
jump for me to tolerate.
Just personal preference; I have no problems with the defaults you chose,
though I would like it if you would issue a suitable warning about the
pitfalls in the documentation.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk