Do not modify the end iterator, make const
This commit is contained in:
		
							parent
							
								
									6643e7f499
								
							
						
					
					
						commit
						891ff7dd80
					
				| @ -15,8 +15,8 @@ namespace api | |||||||
| { | { | ||||||
| 
 | 
 | ||||||
| // Starts parsing and iter and modifies it until iter == end or parsing failed
 | // Starts parsing and iter and modifies it until iter == end or parsing failed
 | ||||||
| boost::optional<ParsedURL> parseURL(std::string::iterator &iter, std::string::iterator end); | boost::optional<ParsedURL> parseURL(std::string::iterator &iter, const std::string::iterator end); | ||||||
| // copy on purpose because we need mutability
 | 
 | ||||||
| inline boost::optional<ParsedURL> parseURL(std::string url_string) | inline boost::optional<ParsedURL> parseURL(std::string url_string) | ||||||
| { | { | ||||||
|     auto iter = url_string.begin(); |     auto iter = url_string.begin(); | ||||||
|  | |||||||
| @ -69,7 +69,7 @@ struct URLGrammar : boost::spirit::qi::grammar<Iterator> | |||||||
| }; | }; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| boost::optional<ParsedURL> parseURL(std::string::iterator &iter, std::string::iterator end) | boost::optional<ParsedURL> parseURL(std::string::iterator &iter, const std::string::iterator end) | ||||||
| { | { | ||||||
|     boost::optional<ParsedURL> parsed_url; |     boost::optional<ParsedURL> parsed_url; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user