Skip to content

Jaime Rios

  • About
  • Github
  • LinkedIn
  • X

shared_ptr

Setting a boost shared_ptr to NULL

April 25, 2011 by jaimerios

If you need to set a boost shared_ptr to NULL, then you can do it like this: boost::shared_ptr(); So, if you have a function that returns a boost shared_ptr and you want to pass NULL to represent either an error state or a not-found state, you can do this: #include typedef boost::shared_ptr OohClassPtr; typedef std::map< ... Read more

Categories Coding Tags Boost, C++, cpp, shared_ptr Leave a comment

Recent Posts

  • Package management with CMake’s CPM
  • Automate Evernote using AppleScript
  • Unit Tests and CMake
  • clang static analyzer
  • C++ std::erase and rbegin/rend

Recent Comments

  1. Connecting with C++ – Jaime Rios on Working with REST
  2. Connecting with C++ – Jaime Rios on Making a connection using Swift
  3. Jaime on Xcode 3.1, Perforce and Scripts
  4. jaimerios.com » Blog Archive » Haversine formula now on GitHub on Calculating distance between 2 points on Earth using the Haversine formula
  5. iPhone 3G: How to show locations around a fixed point? | Questions on Calculating distance between 2 points on Earth using the Haversine formula
© 2026 Jaime Rios • Built with GeneratePress