lemon/arg_parser.h
changeset 2448 ab899ae3505f
parent 2410 fe46b61da4e3
child 2553 bfced05fa852
equal deleted inserted replaced
5:2f5af15142d1 6:c20202949f6d
   330       operator double() 
   330       operator double() 
   331       {
   331       {
   332 	Opts::iterator i = _parser._opts.find(_name);
   332 	Opts::iterator i = _parser._opts.find(_name);
   333 	LEMON_ASSERT(i==_parser._opts.end(),
   333 	LEMON_ASSERT(i==_parser._opts.end(),
   334 		     std::string()+"Unkown option: '"+_name+"'");
   334 		     std::string()+"Unkown option: '"+_name+"'");
   335 	LEMON_ASSERT(i->second.type!=ArgParser::DOUBLE,
   335 	LEMON_ASSERT(i->second.type!=ArgParser::DOUBLE &&
       
   336 		     i->second.type!=ArgParser::INTEGER,
   336 		     std::string()+"'"+_name+"' is a floating point option");
   337 		     std::string()+"'"+_name+"' is a floating point option");
   337 	return *(i->second.double_p);
   338 	return i->second.type==ArgParser::DOUBLE ?
       
   339 	  *(i->second.double_p) : *(i->second.int_p);
   338       }
   340       }
   339       ///\e
   341       ///\e
   340       operator int() 
   342       operator int() 
   341       {
   343       {
   342 	Opts::iterator i = _parser._opts.find(_name);
   344 	Opts::iterator i = _parser._opts.find(_name);