I've seen both styles used, although I think that 

int Foo(); 

is the most common style when declaring a function prototype in a class header. 

Generally speaking its more important to be consistent with the rest of the 
file. 

Dave Hylands 

----- Original Message -----

> From: "Birunthan Mohanathas" <birunt...@mohanathas.com>
> To: "dev-platform" <dev-platform@lists.mozilla.org>
> Sent: Sunday, May 18, 2014 4:27:07 AM
> Subject: Gecko style: Formatting function return type and specifiers

> For top-level function definitions, the recommended style is:

> template<typename T>
> static inline T
> Foo()
> {
> // ...
> }

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

> int Foo();

> class Bar
> {
> virtual int Baz()
> {
> // ...
> }
> };

> ... and others use:

> int
> Foo();

> class Bar
> {
> virtual int
> Baz()
> {
> // ...
> }
> };

> Which one should be preferred?
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to