Monday, September 14th, 2009...10:56 am

some code for a change

Jump to Comments

I’ve written this function a zillion times, so I decided to post it on my blog. Yes, it could do more error checking (what if that new returns a NULL? what if an exception is thrown?). But it does more than zero error checking, so there you go. This is super useful if you are getting ANSI code paths from legacy APIs or if you are using boost::filesystem::path to store paths in a platform independent way (until the new boost comes out).

This particular version isn’t battle tested (yet), but it does work.

On a separate note, I like snipt, but I wish they had better mechanisms to allow you to own your snippets without handing over login info to other sites.

Leave a Reply