[kde-solaris] Typos / weirdness in QFlags default arguments
Adriaan de Groot
groot at kde.org
Sun Aug 19 01:32:36 CEST 2007
In kdelibs methods that take QFlags arguments with a default, like so (from
kdeui/):
void setShapeGesture(const KShapeGesture& gest, ShortcutTypes type =
static_cast<ShortcutType>(ActiveShortcut | DefaultShortcut));
there seem to be two things wrong: the static cast to ShortcutType instead of
ShortcutTypes and the fact that static cast is being used at all. Is there a
good reason to avoid
ShortcutTypes(ActiveShortcut | DefaultShortcut)
or
QFlags<ShortcutType>(ActiveShortcut) | QFlags<ShortcutType>(DefaultShortcut)
here? I vaguely recall there being compiler issues with templated default
arguments a year or more back; there's certainly compiler issues with the
existing static casts.
--
These are your friends - Adem
GPG: FEA2 A3FE Adriaan de Groot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-solaris/attachments/20070819/b59adc73/attachment.pgp
More information about the kde-solaris
mailing list