[PATCH] KSharedPtr operator== problem

Adriaan de Groot groot at kde.org
Sat Oct 4 00:43:36 BST 2008


On Saturday 04 October 2008 00:27:09 Alex Merry wrote:
> How does the attached look?

I was going to write "that way lies madness" as a response before having read 
your whole message, but apparently that was drummed in sub-conciously. 

> I'm assuming that no-one would try compiling
> one part of KDE under gcc and another under a different compiler (since I
> would guess that way lies madness).

It just doesn't seem like a good idea to wriggle around like that, changing 
protected for public. I looks to me like a bit of ugliness that is just asking 
for maintainence trouble.

But in this particular case I'd like to doubt Thiago's words: template friends 
are documented to work in MSVC [1], IBM XL C++ [2]. I may be missing a 
subtlety here, though. I haven't actually tried compiling KSharedPtr with the 
earlier proposed patch in Sun Studio, though. I'll try it in the morning. 
Suffice to say the proposed workaround doesn't seem nice at all to me. Don't 
forget that the range of KDE-supported compilers is smaller than the range of 
Qt supported compilers (right?) so we need to just check those -- and the C++ 
standard. A quick search didn't turn up any chapter and verse saying you can't 
have template friends.


[1] http://www.cs.fiu.edu/~weiss/Deltoid/msvc_stl_3.html , scroll down to 3.6
[2] 
http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/friends_and_templates.htm





More information about the kde-core-devel mailing list