3 ms·
I got to revisit C++ to port some code to boost::asio It crashed because the object was deallocated by time the handler ran. So now I'm taking a shared_ptr par
by __s 5y ago
I got to revisit C++ to port some code to boost::asio
It crashed because the object was deallocated by time the handler ran. So now I'm taking a shared_ptr parameter thisref parameter to keep "this" alive. Ideally it'd be a unique_ptr, but then my understanding is that ptr->func(std::move(ptr)) is undefined
It's nice if these sorts of details are compiler errors, but at least there were some compiler errors:
I ran into some issues over whether move being ambiguous for std::move. Took awhile figuring out where to get socket types for boost, between template parameters being duck typed & boost source being a tangle to read as documentation. Errors end up being in some header when the issue is my code somewhere passing the wrong thing
Got it all sorted out eventually, but glad to get back to C/Ruby/Go/Rust programming
- pjmlp 5y agoThat is why usually we plug stuff like SonarQube into the CI/CD pipeline.