Birunthan Mohanathas writes:

> For top-level function definitions, the recommended style is:
>
>     template<typename T>
>     static inline T
>     Foo()
>     {
>       // ...
>     }

The main reasons for having the function name at the start of a
new line, I assume, was to help some tools (including diff) that
look there for function names.

> However, for function declarations and inline member functions, there
> does not seem to be a definitive style.

For indented declarations within a class, AFAIK the only reason
for a line break would be if there is a limit on the number of
characters in a line.  (diff and other tools are not going to
find the function name anyway.)  Then it comes down to judgement
re whether to split the line before the function name, or between
parameters, etc.

If there are no parameters, then there is usually no need to break
the line.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to