Coding style: white space around asterisks

Roman Gilg subdiff at gmail.com
Tue Aug 6 15:44:08 BST 2019


Hi,

Frameworks C++ coding style for pointer declarations follows the
asterisk to the right approach like Qt coding style recommends.

This is most often a sensible choice but is difficult to read in my
opinion when there is no identifier to the right the asterisk is
associated with, for example for function return types and casts.

Because of that I prefer a style like explained here:
https://www.quora.com/Where-should-I-put-the-asterisk-for-pointers-in-C++-Is-it-int*-ptr-int-*-ptr-or-int-*ptr/answer/David-Vandevoorde

Any arguments for or against doing it this way?

Cheers,
Roman


More information about the Kde-frameworks-devel mailing list