Monthly Archives: November 2013

Unique Flexibility

In my post the other day I off-handedly mentioned that “unique_ptr is much more flexible than shared_ptr”. No one took issue with that (either that or more likely no one read it) so this post might be unescessary but for completeness’ sake here we go… In some ways unique_ptr is an inflexible beast since it […]

Stockholm Sydrome?

So yeah, “BOO HISS” about C++ on the about page. I really need to go back and qualify that some. When I wrote that years ago I had just returned to C++ from a year-and-a-half sojourn in the J2EE world and found it hard to believe that I was working in C++ again. It seemed […]

Automatically Shared

Further towards yesterday's traffic spiking post, another useful function that I've come up with is to_shared that converts a std::unique_ptr to a std::shared_ptr. Such a function has limited uses, in most cases you'd just use std::make_shared when you wanted a shared_ptr. But suppose you had a factory function or object that returns a unique_ptrto the […]

Shutdown the Shutdown

The software I write at work is often left running overnight, if not for a couple of days, collecting data. There's very little that angers a user more than coming in in the morning and finding a rebooted computer instead of a full data file. Unfortunately recent versions of windows come configured to check for […]

Automatically Made Weak

I’ve been experimenting with the new “auto everything” style in C++. I also make regular use of std::weak_ptr, often when passing a lambda to be evaluated in another thread where the weak_ptr acts as a monitor to tell if I still need to do what I wanted to do by the time the other thread […]