Xref: utzoo comp.lang.c++:6050 gnu.g++:587 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!kl-cs!nott-cs!gas From: gas@cs.nott.ac.uk (Alan Shepherd) Newsgroups: comp.lang.c++,gnu.g++ Subject: function modifiers Message-ID: <14940@robin.cs.nott.ac.uk> Date: 9 Jan 90 09:01:26 GMT Sender: root@cs.nott.ac.uk Reply-To: gas@cs.nott.ac.uk (Alan Shepherd) Organization: Computer Science, Nottingham Univ., UK. Lines: 25 In the code for the NIH library, there are several declarations of the following form: const Object* Object::method() const; and also: friend const Object* Object::method() const; I've tried to compile this with g++-1.36.2 and discovered that friends aren't allowed to have function modifiers in g++ i.e the terminating const. Looking at the gnu manual, it seems that the use of the terminating const (see 6.12) supposedly has a meaning unique to g++, yet must be legal syntax for AT&T 2.0 since the library is written for that compiler. Removing the terminating const causes lots of other related error messages to do with const member functions calling non-const member functions etc. Unfortunately, we don't have AT&T C++ or a reference manual, so I'm unsure of the precise effect the use of const. Could someone clarify this for me please and perhaps clear up the differences between AT&T and G++ ? Alan Shepherd