Re: [Cppcms-users] Read-only context
Brought to you by:
artyom-beilis
From: Artyom B. <art...@gm...> - 2017-01-17 21:00:43
|
Hello Nazim, Ohhh, I wish you were talking about it before you started to do all the hard work. The const correctness was discussed several times in the list and I explained why central classes do not provide const interface. Many of the interfaces that are used relay on lazy initialization/evaluation - as you noticed for example for - cache() object - it is created on demand. - map<string,string> http::request::getenv() does similar stuff - it converts the efficient internal representation to external only on demand. Even if some of the interfaces can be converted to "const" ones I still prefer to keep an option to use lazy initialization if I will need in future to without breaking API or const correctness and without creating unexpected side effects. It is very critical as CppCMS is strongly performance oriented and I need to keep the option for lazy evaluation performance improvements under the hood. So thank you for the effort but I can't accept this patch as it is today. Thanks Again, Artyom Beilis On Tue, Jan 17, 2017 at 6:42 PM, Nazım Can Bedir <naz...@ne...> wrote: > Hi Artyom, > > First of all, thank you (and all other contributors) for developing such > good C++ web development library. > > Now, in one of application I am developing; I need to pass HTTP context in > read-only manner. What I am trying to achieve is; writing predicate > functions taking const reference to context, and checking some conditions > related with the request. With current version of http::context and > application classes, this is not possible out-of-box. > > That's why I attached a patch to add "const-correct" member functions; which > works well for my case. If it's possible, could you apply patch to trunk? I > prefer to not fork a project just for small changes. > > Regards, > Nazim. > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |