On Wed, Dec 07, 2022 at 05:04:58PM +0100, Jean-Marc Lasgouttes wrote: > Le 06/12/2022 à 16:17, Jean-Marc Lasgouttes a écrit : > > commit f3f478c2fbcf89302ccadeb30aac413a40039d12 > > Author: Jean-Marc Lasgouttes <lasgout...@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.
A slightly off-topic question: why use QPair instead of std::pair? The Qt documentation [1] says: QPair<T1, T2> can be used in your application if the STL pair type is not available. Also, this is an interesting Qt issue: https://bugreports.qt.io/browse/QTBUG-80309 It seems like they suggest using std::pair over QPair, but QPair was decided to not be deprecated. Scott [1] https://doc.qt.io/qt-5/qpair.html
signature.asc
Description: PGP signature
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel