← Back to team overview

kicad-developers team mailing list archive

Re: Formatting: break after templates

 

Oops, missing newline in the "after" case: should be:

template <>
struct STRUCT_TYPE<TYPE>

On Tue, Mar 26, 2019 at 12:26 PM John Beard <john.j.beard@xxxxxxxxx> wrote:
>
> Hi,
>
> Quick question about formatting: clang-format says
> "AlwaysBreakTemplateDeclarations: false", which can produce things
> like this:
>
> template <typename FOO> void function( int aParam )
>
> template <> struct STRUCT_TYPE<TYPE>
>
> I think it's clearer if the template declaration is always broken
> after ("AlwaysBreakTemplateDeclarations: true"):
>
> template <typename FOO>
> void function( int aParam )
>
> template <> struct STRUCT_TYPE<TYPE>
>
> This keeps the function signature in the "normal" format (i.e. return
> type on the left), and puts the "struct" or "class", etc, in the
> "normal"  place too.
>
> There aren't that many cases of either, but newline cases win by count
> (77 to 10). the Uncrustify.cfg file agrees with newline:
>
> nl_template_class = force # line 1076
>
> The style guide has no mention of it.
>
> Cheers,
>
> John


Follow ups

References