From d4bd099c8368f5d1f95d708ee115f8fca0f8baf6 Mon Sep 17 00:00:00 2001
From: Matthew Webster <mwebster@fmrib.ox.ac.uk>
Date: Wed, 17 Apr 2019 13:35:19 +0000
Subject: [PATCH] Fixed iterator type

---
 fslchfiletype.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fslchfiletype.cc b/fslchfiletype.cc
index b64810a..ed79241 100644
--- a/fslchfiletype.cc
+++ b/fslchfiletype.cc
@@ -16,7 +16,7 @@ int printUsage(const string& progname)
   cout << "Usage: fslchfiletype[_exe] <filetype> <filename> [filename2]" << endl << endl;
   cout << "Changes the file type of the image file [ or copies to new file ]." << endl;
   cout << "Valid values for filetype are:" << endl;
-  for ( std::vector<const pair<string,int> >::iterator it=formats.begin(); it != formats.end(); it++ )
+  for ( std::vector<pair<string,int> >::const_iterator it=formats.begin(); it != formats.end(); it++ )
     cout << "\t" << it->first << endl;
   return 1;
 }
@@ -29,7 +29,7 @@ int fmrib_main(int argc, char *argv[])
   read_volume(input,string(argv[2]));
   int format(-1);
   const vector<pair<string,int> > formats=NEWIMAGE::fileFormats::allFormats();
-  for ( std::vector<const pair<string,int> >::iterator it=formats.begin(); it != formats.end(); it++ )
+  for ( std::vector<pair<string,int> >::const_iterator it=formats.begin(); it != formats.end(); it++ )
     if ( string(argv[1]) == it->first ) format = it->second;
   if ( format == -1 )
     return printUsage(string(argv[0]));
-- 
GitLab