This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Type of result: const or not
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Wei Qin <wqin at EE dot Princeton dot EDU>, gcc-help at gcc dot gnu dot org
- Date: Mon, 04 Aug 2003 10:16:47 -0500
- Subject: 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