arximboldi / lager

C++ library for value-oriented design using the unidirectional data-flow architecture — Redux for C++
https://sinusoid.es/lager/
MIT License
704 stars 66 forks source link

Fix build of http_debug_server with boost >= 1.80 #196

Closed pinotree closed 1 year ago

pinotree commented 1 year ago

Boost Beast 1.80 switches from boost::string_view to boost::core::string_view [1][2], and thus the to_string() method to convert to std::string is not available anymore.

Both the old and the new string_view types used support converting to std::string via operator, hence switch to a static_cast to do the conversion. This supports building with all the versions of boost.

[1] https://www.boost.org/doc/libs/release/libs/beast/doc/html/beast/release_notes.html [2] https://github.com/boostorg/beast/issues/2417

codecov-commenter commented 1 year ago

Codecov Report

Merging #196 (ed62d99) into master (9e078dc) will not change coverage. The diff coverage is n/a.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master     #196   +/-   ##
=======================================
  Coverage   94.78%   94.78%           
=======================================
  Files          81       81           
  Lines        2875     2875           
=======================================
  Hits         2725     2725           
  Misses        150      150           
pinotree commented 1 year ago

Note: using std::to_string() does not work for boost < 1.80 (i.e. with boost::string_view, and I suspect that is also why they switched to boost::core::string_view.