Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!well!nagle From: nagle@well.UUCP (John Nagle) Newsgroups: comp.lang.c++ Subject: Re: disappointed with Pohl's C++ book Message-ID: <13480@well.UUCP> Date: 4 Sep 89 16:16:56 GMT References: <2293@hub.UUCP> <6590235@hplsla.HP.COM> Reply-To: nagle@well.UUCP (John Nagle) Lines: 18 Yet another error in Pohl's book is on page 88, where he says, "A class with a static member cannot have a constructor." This is of course incorrect, and Pohl thus misses out on the whole area of classes which have internal relationships among their instances maintained automatically by the constructors and destructors of the class. (See Stroustrup, 5.4.4). The real restriction, according to Stroustrup, is that a static member of a class cannot be of a type which has a constructor. Static members are also forbidden initializers. (At first thought this seems strange. After all, static members are really just global variables to the implementation, and global variables can be of a type with a constructor. But think about what happens when a class definition is included into several files. Who does the initialization?) John Nagle