This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Type of result: const or not


Hi Wei,

>My questions is: which style is the better one to follow?

For your own code, I'd recommed Scott Meyer's guideline.

Keep in mind, it's a guideline.  Not an absolute commandment from on high.

The STL may-or-may-not follow Scott Meyer's guideline at the discretion of the compiler author.  And when they don't follow Scott Meyer's guideline, I'm willing to wager that it's for a good reason.

At times, there are very good reasons to ignore Scott Meyer's guidelines.  But, in the general case -- and especially if one doesn't understand the when & why -- Scott Meyer's guidelines are good advice.

Sincerely,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]