Integer parameters also convert to double
authoralpar
Tue, 24 Apr 2007 09:39:01 +0000
changeset 24360c941c524b47
parent 2435 548f498fa059
child 2437 02c7076bf894
Integer parameters also convert to double
lemon/arg_parser.h
     1.1 --- a/lemon/arg_parser.h	Fri Apr 20 17:26:38 2007 +0000
     1.2 +++ b/lemon/arg_parser.h	Tue Apr 24 09:39:01 2007 +0000
     1.3 @@ -332,9 +332,11 @@
     1.4  	Opts::iterator i = _parser._opts.find(_name);
     1.5  	LEMON_ASSERT(i==_parser._opts.end(),
     1.6  		     std::string()+"Unkown option: '"+_name+"'");
     1.7 -	LEMON_ASSERT(i->second.type!=ArgParser::DOUBLE,
     1.8 +	LEMON_ASSERT(i->second.type!=ArgParser::DOUBLE &&
     1.9 +		     i->second.type!=ArgParser::INTEGER,
    1.10  		     std::string()+"'"+_name+"' is a floating point option");
    1.11 -	return *(i->second.double_p);
    1.12 +	return i->second.type==ArgParser::DOUBLE ?
    1.13 +	  *(i->second.double_p) : *(i->second.int_p);
    1.14        }
    1.15        ///\e
    1.16        operator int()