This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: slices ; Stroustrup & libstdc++
On 19 Jun 2000 at 09:32 (+0200), Gabriel Dos Reis said:
| brent verner <brent@rcfile.org> writes:
|
| | On 18 Jun 2000 at 23:08 (+0000), Gabriel Dos Reis said:
| | | brent verner <brent@rcfile.org> writes:
| | |
| | | [...]
| | |
| | | | FWIW, Josuttis (whose book Rocks!) only gave examples using
| | | | slice_array& valarray::operator[](slice) as an lvalue, and
| | | | mentioned that the valarray classes, "were not designed very well.
| | | | In fact, nobody tried to determine whether the final specification
| | | | worked."
| | |
| | | But that isn't a reason to write ill-formed programs. Is it?
| |
| | Of course not, but if the spec is flawed (which I'm not qualified
| | to determine, hence the quote by someone who might be :), it could
| | be impossible to write well-formed progs that adhered to the spec.
|
| I don't want to do a C++ hair splitting but the quote didn't say that
| the spec is flawed but that the classes were not very well designed.
| Whether the design is good or not is certainly debatable -- and other
| widely used components of the standard library can be subject to the
| same comment.
|
| Actually, I'm tired of hearing that quote as excuse over and over
| instead of trying to understand the library. There are some design
| errors in the valarray library (as there are in the rest of the
| standard library), but they have nothing to do with the code shown in
| the orginal post.
Agreed.
First, let me apologize for inappropriate use of the quote. Second,
let me say that I spent the past weekend trying to understand the
implementation of the valarray classes enough to fix some problems
I found.
valarray(const slice_array<T>&); // does not compile
valarray(const valarray& name); // only copies value of name[0]
(I'll post a full bug report later this week if I can't solve the
problems)
BTW, where is __restrict__ defined?
Brent
--
Damon Brent Verner
Cracker JackŪ Certified Professional
brent@rcfile.org, brent@linux1.org