Skip to content

Jaime Rios

  • About
  • Github
  • LinkedIn
  • X

cpp

Using shared_ptr, a short article

December 2, 2025February 10, 2021 by jaimerios

How can I create a shared_ptr? How about a NULL shared_ptr? What if I already have a shared_ptr, that I own, and I want to null it out? Ok, ok. What if I want to null out my shared_ptr and at the same time, replace it with a new instance? How do I check if … Read more

Categories Uncategorized Tags cpp Leave a comment

Important command to demangle C++ code in your pasteboard

September 22, 2011 by jaimerios

Cool command line I can run from DTerm on the contents in my clipboard, outputted from Xcode: pbpaste | c++filt | mate This command will take my clipboard contents, which were originally created from Xcode, pass that to the c++filt command and then create a new file in TextMate with the resulting contents.

Categories Tip Tags cpp, Mac OS X, TextMate Leave a comment

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
Newer posts
← Previous Page1 Page2

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
© 2025 Jaime Rios • Built with GeneratePress