[LyX/master] C++11 compilation fix

Richard Kimberly Heck rikiheck at gmail.com
Wed Dec 7 16:21:28 UTC 2022


On 12/7/22 11:04, Jean-Marc Lasgouttes wrote:
> Le 06/12/2022 à 16:17, Jean-Marc Lasgouttes a écrit :
>> commit f3f478c2fbcf89302ccadeb30aac413a40039d12
>> Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
>> Date:   Tue Dec 6 17:12:45 2022 +0100
>>
>>      C++11 compilation fix
>
>>       for (iter = refs_.begin(); iter != refs_.end(); ++iter) {
>>           // first: plain label name, second: gui name
>>           QString const lab = toqstr((*iter).first);
>> -        refsNames.append(QPair(lab, toqstr((*iter).second)));
>> +        refsNames.append({lab, toqstr((*iter).second)});
>
> This elicited the answer "Huh?" from Jürgen, but sent to the lyx-cvs 
> list, so only Riki and I saw it.
>
> Could I have a authoritative answer to the question whether a 
> constructor like QPair(a, b) can be replaced with {a, b} when the 
> context is clear enough?
>
> I notice that we use that already, but I may be wrong about when it is 
> acceptable.

I don't have a strong view about this. It seems to me a case where, if 
you're not used to it, it will look weird. That said, the {a,b} 
construction is less explicit.

Riki




More information about the lyx-devel mailing list