const int *p vs. int const *p - Is const after the type acceptable?

前端 未结 15 1704
萌比男神i
萌比男神i 2020-12-08 05:01

My co-worker is 0 for 2 on questions he has inspired (1, 2), so I thought I\'d give him a chance to catch up.

Our latest disagreement is over the style issue of wher

15条回答
  •  感动是毒
    2020-12-08 05:26

    I was at a conference where Bjarne Stroustrup was giving a presentation, and he used something like const int* i. Someone asked him why does he use this style and he responded (paraphrasing):

    "people like to see const first when something is constant."

提交回复
热议问题