From: Ed Brey (brey_at_[hidden])
Date: 2001-04-24 12:31:15
From: "Jens Maurer" <Jens.Maurer_at_[hidden]>
> I like the template-based interface proposed earlier better,
> because it allows e.g. interval or boost::rational<int> constants.
I agree. It also solves the problem of getting access to constants of a
given type using reasonably short names, without having to specificly
declare each constant in use.
> > How is constant folding accomplished, given that the definition
> > to be out-of-line?
> Allowing constant folding (or not) is a quality-of-implementation
> and should not affect the interface. (In particular, implementors
> may choose to define the constants inline, but that's not what I'd
> do for the generic boost implementation.)
I agree that it's a QOI issue. All other things being equal, supporting
constant folding makes the library higher-quality. Why wouldn't we want
the boost library to have this quality? If not boost, where would one
go to find an implementation with this quality? I presume that there is
a tradeoff involved here, but I fail to see what it is, and could use
some enlightening. What trouble is there in putting everything in the
header, with #ifdefs sprinkled in as necessary?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk