[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    plasma/kdelibs coding style and pointers
From:       Jason Stubbs <jasonbstubbs () gmail ! com>
Date:       2008-08-31 13:25:47
Message-ID: 48BA9BDB.2080306 () gmail ! com
[Download RAW message or body]

The kdelibs coding style on techbase[1] only says "For pointers or 
references, use a single space before '*' or '&', but not after". When 
looking through applet.h and applet.cpp, I see this rule being broken in 
some circumstances. Am I right to believe that the first in each of the 
following groups is "correct"?

QString *p;
QString* p;

void foo(QString *p);
void foo(QString* p);

void foo(QString*);
void foo(QString *);

Blah* const d;
Blah *const d;
Blah * const d;

QList<Blah*> foo;
QList<Blah *> foo;

QString* Blah::foo();
QString *Blah::foo();
QString * Blah::foo();

Assuming the above are all correct, is it "correct" to put the asterisk 
next to the variable (but not function) name when one is present and 
next to the class/struct name otherwise?


[1] http://techbase.kde.org/Policies/Kdelibs_Coding_Style

-- 
Jason Stubbs
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic