declaration

static const unsigned *s_someNames[aConstexpr];

storage _ cv-qualificationtype + operator _ declarator-id _ operator;

declaration declarator;

 

put 'const' specifier to right of declaration is goes from here: http://www.dansaks.com/articles/1999-02%20const%20T%20vs%20T%20const.pdf

I thouht 'const unsigned' is better than 'unsigned const' in reading. We just need to treat cv-qulification and type together to avoid misleading in typedef. Such as: 

typedef int *Ptr;
const Ptr pI = nullptr;

Because 'P' is type, we treat 'const P' as a whole and read as "const pionter".

Otherwise:

const int *p = nullptr;

In this example, only 'int' is type ('*' is operator), so we read it as "pointer to const int".

 

This way we avoid obscure typedef style when conjunction with cv-qualification. 

It can't be deny that Dan's article is excellent: http://www.dansaks.com/articles.htm

 

posted @ 2013-01-20 11:33  walfud  阅读(347)  评论(0编辑  收藏  举报