Re: Explicit-ness

David Jarvie lists at astrojar.org.uk
Thu Aug 31 09:57:26 BST 2006


On Thursday 31 August 2006 1:35, Allen Winter wrote:
>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

Do you mean these exact comments, or are they just examples? I think that a keyword (analogous to apidox ones) would be better so that 
people can word the comments as they like as long as the keyword is included.

--
David Jarvie.





More information about the kde-core-devel mailing list