[LyX/master] Drop C++17 if init-statements to support older compilers.

Scott Kostyshak skostysh at lyx.org
Wed Nov 16 20:48:27 UTC 2022


On Wed, Nov 16, 2022 at 03:26:15PM -0500, Richard Kimberly Heck wrote:
> On 11/16/22 14:29, Pavel Sanda wrote:
> > commit d9847302359b7f6d5ca02b97b3b323d7f6bc3df7
> > Author: Pavel Sanda <sanda at lyx.org>
> > Date:   Wed Nov 16 21:23:01 2022 +0100
> > 
> >      Drop C++17 if init-statements to support older compilers.
> 
> I find this syntax hard to read anyway. I'd personally support making it
> part of our coding style that we do not use it.

Makes sense, although I wonder if the C++17 style had a nice benefit:
does it make it clear that potential_terms is out of scope after the if
block? After the change, one has to search for the string
"potential_terms" to know that it is not used again.

For example, what do you think of the attached patch, which limits the
scope of potential_terms? I like it, but I have a feeling that others
will find it annoying :)

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: limit-scope.patch
Type: text/x-diff
Size: 1637 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20221116/d9403193/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20221116/d9403193/attachment.asc>


More information about the lyx-devel mailing list