From: Doug Gregor (dgregor_at_[hidden])
Date: 2005-05-17 16:57:13
On May 17, 2005, at 3:39 PM, Thorsten Ottosen wrote:
> "dan marsden" <danmarsden_at_[hidden]> wrote in message
> | It seems strange to need to force the more basic
> | behaviour of an unconstrainted array of chars with
> | zero cost for establishing the bounds, and default to
> | higher level behaviour implying a delimiter and a
> | linear cost to calculate the bounds.
> | Some of this depends on what you perceive as the
> | common case, but the differing behaviour between
> | char[N] and MyType[N] presents a lack of uniformity
> | that could hurt generic code developers and confuse
> | users.
> I'm not much interested in using naked arrays my-self, with the
> of literals.
But many other users are. You're writing the library for them, too,
> Would it be ok with people if const char[N] was the only
> special case?
That's even worse :)
Special cases cause problems in generic code. It doesn't mean that
special cases can't ever be used, but that they should be considered
very, very carefully. In this particular context, I don't think that
the special case is a good idea, for two reasons:
(1) Users have expressed a need for the normal behavior.
(2) Users have expressed a need to do what the special case does, but
in instances where the special case wouldn't be triggered.
So the special case isn't always useful and doesn't cover all of the
cases it needs to. It sounds like a separate facility is in order.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk