KDE/kdevelop/languages/cpp

David Nolden david.nolden.kdevelop at art-master.de
Wed Oct 31 17:33:34 UTC 2007


On Wednesday 31 October 2007 17:37:06 Andreas Pakulat wrote:
> b) make the constructors of DUChainPointer implicit again, Hamish made
> them explicit and I don't really know why, but I didn't feel like
> changing that as there might have been a reason for that...
>
> Andreas

Maybe because that's a kind of design rule(see krazy)? Personally I don't 
really get the sense of that rule, except maybe for the transparency thing 
that Kris Wong mentioned some time ago on the list, but for me that doesn't 
apply for smart pointers. For example I don't really understand why 
KSharedPtr has an explicit constructor. For that reason I had to clutter the 
c++ part code with hundreds of ugly constructs like "callFunction( 
AbstractType::Ptr(otherPtr.data()) )".

Since DUChainPointer isn't a class that you usually use on the fly, maybe it 
doesn't matter that much there, but I too think that non-explicit 
constructors are nicer for smart pointers.

@Hamish: Is there a good reason to make it explicit? :)

greetings, David





More information about the KDevelop-devel mailing list