etr / libhttpserver

C++ library for creating an embedded Rest HTTP server (and more)
GNU Lesser General Public License v2.1
884 stars 185 forks source link

Remove ineffective/unneeded const from shared_ptr return types #285

Closed stuart-byma closed 1 year ago

stuart-byma commented 1 year ago

Identify the Bug

https://github.com/etr/libhttpserver/issues/284

Description of the Change

Replace all instances of const shared_ptr<http_response> with shared_ptr<http_response>

Alternate Designs

There is no alternate design

Possible Drawbacks

I don't believe there are any.

Verification Process

All tests pass. Everything compiles fine. clang-tidy no longer reports the issue in a code base that uses this return type.

Release Notes

Remove ineffective/unneeded const from std::shared_ptr return types.

etr commented 1 year ago

Thanks for the cleanup. Very much appreciated

jcphill commented 3 months ago

I know it's a bit late but this should have been flagged as a breaking interface change because existing code that overrides httpserver::http_resource::render_GET etc. now has an "invalid covariant return type" error and there is no way to write code that works with both the old const and new non-const return types.