[LyX/master] C++11 compilation fix

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Dec 7 17:15:51 UTC 2022


Le 07/12/2022 à 17:44, Jürgen Spitzmüller a écrit :
> Am Mittwoch, dem 07.12.2022 um 17:04 +0100 schrieb Jean-Marc
> Lasgouttes:
>> 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 was just surprised that it doesn't compile. In any case, I comment
> would be good, as at least I wouldn't understand why we use this, and
> not QPair.

My comment that it is a C++11 thing is probably wrong. I did not check 
what level of standard allows QPair without specialization. This issue 
was the reason why std::pair has a make_pair(), I think.

I have not tried it, but transforming a char to string is probably as 
easy as {c} in the right context, instead of the horrible string(1,c).

JMarc


More information about the lyx-devel mailing list