This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] regex_traits implementation
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Tim Shen <timshen91 at gmail dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Stephen Webb <stephen dot webb at canonical dot com>
- Date: Tue, 02 Jul 2013 21:27:21 +0200
- Subject: Re: [patch] regex_traits implementation
- References: <CAPrifDmvwyXmOS4Wp1mo+ORnEk0o5=_dXbLimv9soahjcSuwAw at mail dot gmail dot com> <51CE1755 dot 1040401 at oracle dot com> <51CE1ED5 dot 6020104 at bregmasoft dot ca> <294c5ce0-0569-463f-b716-95abf2d2f848 at email dot android dot com> <CAGBC11ktNNzXhMLPuoxwyQ0o2QqEtq0S8Qi8YN3FMSsh5r_rZA at mail dot gmail dot com> <CAGBC11mJEnp70OdDdKr9BduhxXCrs9RUoN0TOXKhg7VSKnvQMQ at mail dot gmail dot com> <CAH6eHdShjBcZ+yF8O3+SOh222G5BQ5huMyE7-i0OhCTmbBhoeQ at mail dot gmail dot com> <CAPrifDnC--3U0KMW6DPZa_TCN=JAUrxLu3u-uTSihHPD_Hv_sg at mail dot gmail dot com>
Hi,
>Second, making it `const` enables more potential compiler
>optimizations.
Stylistically, we already discussed this in the past and the outcome was that normally we don't use const by value anywhere. But personally I don't have a strong opinion and certainly I would not object if it makes a difference from the optimization point of view: as far as I know it does *not*, like it does not declaring const a local, do you have some up to date evidence that it does?
Paolo