Article View: gnu.g++.lib.bug
Article #561possible bug in the Plex generic
From: Gilligan
Date: Fri, 02 Feb 1990 14:50
Date: Fri, 02 Feb 1990 14:50
54 lines
2070 bytes
2070 bytes
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 <T>Plex::fill(<T&> x)
{
for (int i = lo; i < fnc; ++i) (*this)[i] = x;
}
! void <T>Plex::fill(<T&> x, int lo, int hi)
{
for (int i = lo; i <= hi; ++i) (*this)[i] = x;
}
--- 153,164 ----
}
! void <T>Plex::fill(const <T&> x)
{
for (int i = lo; i < fnc; ++i) (*this)[i] = x;
}
! void <T>Plex::fill(const <T&> 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' )
Technical Details
Message-ID:
<THOTH.90Feb2095013@springs.cis.ufl.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!rex!uflorida!bikini!thothShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <THOTH.90Feb2095013@springs.cis.ufl.edu> Date: 2 Feb 90 14:50:13 GMT Sender: news@uflorida.cis.ufl.EDU Distribution: gnu Organization: /cis/lightning0/thoth/.organization Lines: 54