From 854ea789c87c44d039de9e86f3e52f705b387a84 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Fri, 14 Feb 2020 11:11:12 -0500 Subject: [PATCH] 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'. --- src/frontends/qt/TocModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- 2.39.5