I got a segmentation fault every time I use the HttpServerRequestRouter::map function (the version that takes an initializer_list as parameter).
After looking at the implementation of the code I saw that std::copy was used but in the wrong way:
std::copy(std::begin(map), std::end(map), std::end(priv->mappings));
Indeed a good version should be:
std::copy(std::begin(map), std::end(map), std::back_inserter(priv->mappings));
Hello,
I got a segmentation fault every time I use the HttpServerRequestRouter::map function (the version that takes an initializer_list as parameter). After looking at the implementation of the code I saw that std::copy was used but in the wrong way: std::copy(std::begin(map), std::end(map), std::end(priv->mappings)); Indeed a good version should be: std::copy(std::begin(map), std::end(map), std::back_inserter(priv->mappings));
You can look at the cplusplus.com reference: http://www.cplusplus.com/reference/iterator/back_inserter/
Regards,