Typos / weirdness in QFlags default arguments

Adriaan de Groot <[email protected]>
Newsgroups gmane.comp.kde.devel.core,gmane.comp.kde.solaris
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQBGx4GUdqzuAf6io/4RAjN3AJ9V08QYFM+mxN0OBTjolz1gw/B50ACfRCMj
js4PCZH+pmaZVPcbFL6+6n4=
=M152
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.