h2zero / esp-nimble-cpp

C++ library for the esp32 NimBLE stack based on and mostly compatible with @nkolban cpp_utils BLE library.
https://h2zero.github.io/esp-nimble-cpp/
Apache License 2.0
182 stars 62 forks source link

Modernizing the codebase #154

Open mickeyl opened 7 months ago

mickeyl commented 7 months ago

I wonder whether it would be feasible to update the codebase a bit with regards to modern C++ constructs.

In particular, esp-nimble-cpp relies a lot on pointers (e.g., for callbacks). Devices such as std::unique_ptr and std::shared_ptr could improve this a lot.

But also trivial things like using auto and for (auto& item: collection) could help to make the codebase more simple to read, more friendly towards contributions, and better maintainable.

What's your take on that?

h2zero commented 7 months ago

Yes I've wanted to do some cleanup as the code is based on a pretty old library now. I just haven't had time or any real need for it.