Coding standards

Nathan Myers ncm@best.com
Tue Nov 30 17:35:00 GMT 1999


Jason wrote:
 
> I've finally gotten around to reading the libstdc++ coding standards,
> and would like to discuss some of them.
> 
> 7) Perhaps the member-init-list should be indented?

That is reasonable, except then

Type
qualified::really_long_function_name(
  really_long_argument_type a)
  : initializers()
{
}

seems to put the initializers with the arguments, rather
than with the class body.
 
> 8) Why not
> 
>   try
>     {
>       ...
>     }
>   catch (...)
>     {
>       ...
>     }
> 
> ?  This is consistent with the C form for 'if' and such; the documented form
> seems gratuitously inconsistent.

No good reason.  Probably it should be made consistent.
 
> 9) I disagree strongly.  Declarations are all in one line in C, and member
>    function declarations should work the same way.  I see that people have
>    been ignoring this rule anyway.

The point here was not about the (optional!) line-break in the declaration, 
but rather about indentation under a template declaration in a class body.

Nathan Myers
ncm@cantrip.org


More information about the Libstdc++ mailing list