[glom] C++11: Use of std::next().



commit b27960f5cc493ada15f7a18fae14ff40dd4858b9
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jun 8 12:16:54 2016 +0200

    C++11: Use of std::next().

 glom/import_csv/csv_parser.cc   |    3 +--
 glom/mode_data/box_data_list.cc |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/glom/import_csv/csv_parser.cc b/glom/import_csv/csv_parser.cc
index 95fc8d5..ccd43e8 100644
--- a/glom/import_csv/csv_parser.cc
+++ b/glom/import_csv/csv_parser.cc
@@ -40,8 +40,7 @@ bool CsvParser::next_char_is_quote(const Glib::ustring::const_iterator& iter, co
     return false;
 
   // Look at the next character to see if it's really "" (an escaped "):
-  auto iter_next = iter;
-  ++iter_next;
+  const auto iter_next = std::next(iter);
   if(iter_next != end)
   {
     const auto c_next = *iter_next;
diff --git a/glom/mode_data/box_data_list.cc b/glom/mode_data/box_data_list.cc
index 82a20a3..5f1da4f 100644
--- a/glom/mode_data/box_data_list.cc
+++ b/glom/mode_data/box_data_list.cc
@@ -249,8 +249,7 @@ void Box_Data_List::on_details_nav_next()
     {
       //std::cout << "debug: " << G_STRFUNC << ": The current row was not the last row.\n";
 
-      iter++;
-      m_AddDel.select_item(iter);
+      m_AddDel.select_item(std::next(iter));
 
       signal_user_requested_details().emit(m_AddDel.get_value_key_selected());
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]