[Patch] Remove unnecessary forward declarations

Paolo Carlini pcarlini@suse.de
Thu Sep 21 15:48:00 GMT 2006


Hi,

this started yesterday, when I noticed that std::set and multiset and 
multimap - but *not* std::map - had on top forward declarations for the 
benefit of friendship. Those declarations appeared the first time in 
gcc3.0, probably to work around limitations of the C++ front-end, but in 
fact are not required by the standard, because we are granting 
friendship to all instances of the given template functions (*). As 
happens, there are quite a few additional examples of the issue, some 
recently added by myself in tr1::random and a couple other places.

This patch is a pure clean-up, doesn't properly belong to this Stage, 
but I'd really like to apply it anyway: if it's true, as a friend of 
mine explained, that some people look at the sources of the library 
while learning C++ (!), then what we have here is simply horrible. I 
will wait 'til this evening.

Tested x86-linux.

Paolo.

(*) People looking for a clear explanation outside the standard, may go 
to Lippman, Lajoie, Moo, p. 658, for example.

////////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_decl_cu
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20060921/a7a144e9/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_decl_cu
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20060921/a7a144e9/attachment-0001.ksh>


More information about the Libstdc++ mailing list