Menu ▾ ▴

#25 Make CMakeLists.txt to use C++11 as default

Release 1.2
open
nobody
1
2015-04-25
2014-01-18
CN Liou
No

Modify CMakeLists.txt so that CppCMS will try to be compiled in C++11 mode.

Quoted from

http://www.cplusplus.com/reference/map/multimap/insert/

"The relative ordering of elements with equivalent keys is preserved, and newly inserted elements follow those with equivalent keys already in the container."

As such, with C++11 enabled, we will be able to iterate the elements in cppcms::http::request::form_type in correct order given the same key. This is extremely helpful for HTML form input controls that have the same name like this:

<form>
<input name="names" type="text" />
<input name="ages" type="text" />

<input name="names" type="text" />
<input name="ages" type="text" />

<input name="names" type="text" />
<input name="ages" type="text" />

<input type="submit" />
</form>

As long as the ordering of cppcms::application::request::post() is guaranteed, ages[i] is guaranteed to be correctly associated with names[i].

Discussion

  • CN Liou

    CN Liou - 2015-04-25

    My request seems to be an invalid one. Please close it.

     

Anonymous
Anonymous

Add attachments
Cancel