Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!rex!uflorida!bikini!thoth From: thoth@springs.cis.ufl.edu (Gilligan) Newsgroups: gnu.g++.lib.bug Subject: possible bug in the Plex generic Message-ID: Date: 2 Feb 90 14:50:13 GMT Sender: news@uflorida.cis.ufl.EDU Distribution: gnu Organization: /cis/lightning0/thoth/.organization Lines: 54 If there is a known bug involving header/implementation mismatch (`const' .vs. no `const') with the Plex class under libg++-1.36.3, ignore me. Has anyone noticed a problem with the libg++-1.36.3 Plex generic class? I pulled the new libg++ off of prep a few days ago and installed it. I was recently using it with one of my own classes and I got an error (something like "argument list does not match in any class definition" ). After a good night's sleep I noticed that the prototypes in the .h file were different from the implementation in the .cc file to the tune of a `const' or two. What follows are my diffs to Plex that made it work. I've noticed that a lot of the classes have been sprouting `const's left and right. Good job! Koenig said that this was one of the things that no one tells you, but is almost necessary for good code. Someone may want to check the rest of the classes for missing `const's (header and code mismatch that is). *** Plex.ccP Fri Dec 1 08:24:10 1989 --- /local/lib/gnu/g++-include/Plex.ccP Fri Feb 2 09:16:30 1990 *************** *** 153,164 **** } ! void Plex::fill( x) { for (int i = lo; i < fnc; ++i) (*this)[i] = x; } ! void Plex::fill( x, int lo, int hi) { for (int i = lo; i <= hi; ++i) (*this)[i] = x; } --- 153,164 ---- } ! void Plex::fill(const x) { for (int i = lo; i < fnc; ++i) (*this)[i] = x; } ! void Plex::fill(const x, int lo, int hi) { for (int i = lo; i <= hi; ++i) (*this)[i] = x; } -- ( My name's not really Gilligan, It's Robert Forsman, without an `e' )