[Kde-pim] [RFC] Contact specific Akonadi API

robert at narnia.homeunix.com robert at narnia.homeunix.com
Mon Aug 10 09:11:58 BST 2009


> I am still not convinced that this is a suffiently big gain.
>
> job->payload<Addressee>();
>
> is not significantly more difficult then
>
> job->addressee();
>
> Templated getters are quite common in C++ APIs, including Qt (e.g.
> QVariant::value())

I had to use these kinds of getters in a kpilot patch recently (the 
hasPayload and payload methods) and I feel like they are particularly 
prone to programming errors.  For instance, if you put use the wrong class 
in for the hasPayload template, the method fails silently and doesn't 
generate any kind of compile time (or runtime) warning.  I'm not saying 
that we shouldn't use them.  Just that, if we do, we should take some 
precautions.

--Robert
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list