Re: [Cppcms-users] Why isn't request const correct?
Brought to you by:
artyom-beilis
|
From: Marcel H. <ke...@co...> - 2014-07-30 10:57:11
|
On 30.07.2014 07:26, Noah Roberts wrote: > std::string auth_type(); > Does that function really alter the instance in an observable way? That it's non-const would indicate that it is, but I don't understand what it would change. That's an interesting fact and a bug imho. As far as I can see, the problem is, that auth_type calls impl something and then getenv (private/cgi_api.h). The connection class has a string_map, where it stores its values and here is the problem. Why do you use a custom string_map artyom and not a classic std::(unordered_)map. The get_safe method (in fact all get functions) are not const, because they call sort. But that's not necessary imho. You just have to sort the map whenever you insert an element, but not get one. So, two solutions: 1. get rid of the string_map and use a c++ (unordered_)map 2. Don't use sort in the get* method Marcel |