diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index 718d51d..7725de9 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -332,11 +332,21 @@ class Arg }; /** - * Typedef of a list iterator. + * Typedef of an Arg list iterator. + */ +typedef std::list::iterator ArgListIterator; + +/** + * Typedef of an Arg vector iterator. */ -typedef std::list::iterator ArgIterator; typedef std::vector::iterator ArgVectorIterator; +/** + * Typedef of a Visitor list iterator. + */ +typedef std::list::iterator VisitorListIterator; + + ////////////////////////////////////////////////////////////////////// //BEGIN Arg.cpp ////////////////////////////////////////////////////////////////////// diff --git a/include/tclap/CmdLine.h b/include/tclap/CmdLine.h index b54343a..54c84d7 100644 --- a/include/tclap/CmdLine.h +++ b/include/tclap/CmdLine.h @@ -278,8 +278,8 @@ inline CmdLine::CmdLine(const std::string& m, inline CmdLine::~CmdLine() { - std::list::iterator argIter; - std::list::iterator visIter; + ArgListIterator argIter; + VisitorListIterator visIter; for( argIter = _argDeleteOnExitList.begin(); argIter != _argDeleteOnExitList.end(); @@ -354,8 +354,8 @@ inline void CmdLine::add( Arg& a ) inline void CmdLine::add( Arg* a ) { - for( ArgIterator iter = _argList.begin(); iter != _argList.end(); iter++ ) - if ( *a == *(*iter) ) + for( ArgListIterator it = _argList.begin(); it != _argList.end(); it++ ) + if ( *a == *(*it) ) throw( SpecificationException( "Argument with same flag/name already exists!", a->longID() ) ); @@ -382,7 +382,7 @@ inline void CmdLine::parse(int argc, char** argv) for (int i = 0; (unsigned int)i < args.size(); i++) { bool matched = false; - for (ArgIterator it = _argList.begin(); it != _argList.end(); it++) + for (ArgListIterator it = _argList.begin(); it != _argList.end(); it++) { if ( (*it)->processArg( &i, args ) ) { diff --git a/include/tclap/CmdLineOutput.h b/include/tclap/CmdLineOutput.h index c2a7043..c480666 100644 --- a/include/tclap/CmdLineOutput.h +++ b/include/tclap/CmdLineOutput.h @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/include/tclap/StdOutput.h b/include/tclap/StdOutput.h index 4e253f0..d44496e 100644 --- a/include/tclap/StdOutput.h +++ b/include/tclap/StdOutput.h @@ -167,7 +167,7 @@ inline void StdOutput::_shortUsage( CmdLineInterface& _cmd, } // then the rest - for (ArgIterator it = argList.begin(); it != argList.end(); it++) + for (ArgListIterator it = argList.begin(); it != argList.end(); it++) if ( !xorHandler.contains( (*it) ) ) s += " " + (*it)->shortID(); @@ -199,7 +199,7 @@ inline void StdOutput::_longUsage( CmdLineInterface& _cmd, } // then the rest - for (ArgIterator it = argList.begin(); it != argList.end(); it++) + for (ArgListIterator it = argList.begin(); it != argList.end(); it++) if ( !xorHandler.contains( (*it) ) ) { spacePrint( os, (*it)->longID(), 75, 3, 3 );