diff libinterp/octave-value/ov-struct.cc @ 25337:3ff9192b676e

use auto keyword to declare iterator variables where possible * dialog.cc, files-dock-widget.cc, history-dock-widget.cc, file-editor.cc, octave-qt-link.cc, call-stack.cc, debug.cc, dynamic-ld.cc, fcn-info.cc, fcn-info.h, genprops.awk, graphics.cc, gtk-manager.cc, gtk-manager.h, hook-fcn.h, load-path.cc, load-save.cc, ls-mat5.cc, mex.cc, oct-map.cc, oct-stream.cc, octave-link.cc, regexp.cc, symscope.h, symtab.h, txt-eng.h, url-handle-manager.cc, variables.cc, ov-base.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-struct.cc, bp-table.cc, jit-ir.cc, jit-typeinfo.cc, pt-arg-list.cc, pt-arg-list.h, pt-array-list.cc, pt-check.cc, pt-classdef.cc, pt-decl.h, pt-eval.cc, pt-idx.cc, pt-jit.cc, pt-misc.cc, pt-pr-code.cc, pt-select.h, pt-stmt.h, caseless-str.h, lo-regexp.cc: Use auto keyword to declare iterator variables where possible. Style fixes.
author John W. Eaton <jwe@octave.org>
date Wed, 02 May 2018 01:36:20 -0400
parents 6652d3823428
children 416856765a55
line wrap: on
line diff
--- a/libinterp/octave-value/ov-struct.cc	Wed May 02 00:30:00 2018 -0400
+++ b/libinterp/octave-value/ov-struct.cc	Wed May 02 01:36:20 2018 -0400
@@ -79,7 +79,7 @@
 
   std::string nm = idx(0).string_value ();
 
-  octave_map::const_iterator p = map.seek (nm);
+  auto p = map.seek (nm);
 
   if (p != map.end ())
     retval = map.contents (p);
@@ -135,7 +135,7 @@
       {
         if (type.length () > 1 && type[1] == '.')
           {
-            std::list<octave_value_list>::const_iterator p = idx.begin ();
+            auto p = idx.begin ();
             octave_value_list key_idx = *++p;
 
             const Cell tmp = dotref (key_idx);
@@ -198,7 +198,7 @@
       {
         if (type.length () > 1 && type[1] == '.')
           {
-            std::list<octave_value_list>::const_iterator p = idx.begin ();
+            auto p = idx.begin ();
             octave_value_list key_idx = *++p;
 
             const Cell tmp = dotref (key_idx, auto_add);
@@ -291,7 +291,7 @@
           {
             if (type.length () > 1 && type[1] == '.')
               {
-                std::list<octave_value_list>::const_iterator p = idx.begin ();
+                auto p = idx.begin ();
                 octave_value_list t_idx = *p;
 
                 octave_value_list key_idx = *++p;
@@ -313,7 +313,7 @@
                 std::string next_type = type.substr (2);
 
                 Cell tmpc (1, 1);
-                octave_map::iterator pkey = map.seek (key);
+                auto pkey = map.seek (key);
                 if (pkey != map.end ())
                   {
                     map.contents (pkey).make_unique ();
@@ -365,7 +365,7 @@
             std::string next_type = type.substr (1);
 
             Cell tmpc (1, 1);
-            octave_map::iterator pkey = map.seek (key);
+            auto pkey = map.seek (key);
             if (pkey != map.end ())
               {
                 map.contents (pkey).make_unique ();
@@ -414,7 +414,7 @@
       {
         if (n > 1 && type[1] == '.')
           {
-            std::list<octave_value_list>::const_iterator p = idx.begin ();
+            auto p = idx.begin ();
             octave_value_list key_idx = *++p;
             octave_value_list idxf = idx.front ();
 
@@ -550,7 +550,7 @@
 
   size_t retval = 0;
 
-  for (octave_map::const_iterator p = map.begin (); p != map.end (); p++)
+  for (auto p = map.begin (); p != map.end (); p++)
     {
       std::string key = map.key (p);
 
@@ -1212,7 +1212,7 @@
           std::string next_type = type.substr (1);
 
           octave_value tmp;
-          octave_map::iterator pkey = map.seek (key);
+          auto pkey = map.seek (key);
           if (pkey != map.end ())
             {
               map.contents (pkey).make_unique ();
@@ -1264,7 +1264,7 @@
 
   size_t retval = 0;
 
-  for (octave_map::const_iterator p = map.begin (); p != map.end (); p++)
+  for (auto p = map.begin (); p != map.end (); p++)
     {
       std::string key = map.key (p);