From: Richard Kimberly Heck Date: Fri, 14 Feb 2020 16:11:12 +0000 (-0500) Subject: Fix a strange warning in QtCreator: X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=854ea789c87c44d039de9e86f3e52f705b387a84;p=features.git Fix a strange warning in QtCreator: /cvs/lyx/lyx-devel/src/frontends/qt/TocModel.cpp:356: warning: loop variable 'toc' has type 'const pair > &' (aka 'const pair, shared_ptr > > &') but is initialized with type 'const std::pair, std::shared_ptr > > >' resulting in a copy /cvs/lyx/lyx-devel/src/frontends/qt/TocModel.cpp:356: use non-reference type 'pair >' (aka 'pair, shared_ptr > >') to keep the copy or type 'const std::pair, std::shared_ptr > > > &' to prevent copying Easier just to use 'auto'. --- diff --git a/src/frontends/qt/TocModel.cpp b/src/frontends/qt/TocModel.cpp index 51365311aa..e43b3df445 100644 --- a/src/frontends/qt/TocModel.cpp +++ b/src/frontends/qt/TocModel.cpp @@ -353,7 +353,7 @@ void TocModels::reset(BufferView const * bv) names_->insertColumns(0, 1); // In the outliner, add Tocs from the master document TocBackend const & backend = bv->buffer().masterBuffer()->tocBackend(); - for (pair> const & toc : backend.tocs()) { + for (auto const & toc : backend.tocs()) { QString const type = toqstr(toc.first); // First, fill in the toc models.