Explicit-ness
Allen Winter
winter at kde.org
Thu Aug 31 01:35:35 BST 2006
On Wednesday 30 August 2006 18:59, Thiago Macieira wrote:
> Allen Winter wrote:
> > - constructor must be public
> > - constructor must have exactly 1 required argument
> > - constructor may have 1 or more optional arguments
> > - a class may have more than constructor declared 'explicit'
> > - copy constructors should not be declared 'explicit'
> > - templates ignored
>
> One more rule:
> - constructor is not intentionally implicit
>
> I have no idea how to detect that last one. But it is a valid use-case.
>
Yeah, I just ran into just such a case.
For now I will have Krazy ignore lines with a C++ comment saying
to keep the constructor explicit, or that is should be implicit.
All the following will be ignored, for example:
Duration(int seconds); //implicit
Duration(int seconds); // not explicit
Duration(int seconds): //please do not make explicit
--
KDE: Same Thing We Do Everyday... Try to Conquer the World
More information about the kde-core-devel
mailing list