C++ 11: Welcome to the New World

I like C++. Always have. It’s the first programming language I learned. I purchased a C++ programming text from a second-hand store, read it in a month, and figured out that my life was about to change. And it did. I’m now a computer scientist/software engineer/web developer/number theory enthusiast. But there came a point at which it felt like the only secrets remaining in C++ were those weird quirks that make it so hard to do useful things.

Enter C++ 11, which has, once again, changed my life. For my senior project at my university, I am constructing a live implementation of Eulerian video magnification (created by the good folks at MIT) and will be releasing it on GitHub when it’s finished. I’m writing this in C++ for efficiency, but I was continually running into problems. For example, with POSIX threads, it’s not possible to spin off a method of a class as a thread. Boost is nice, but I wanted to try C++ 11 threads first. Come to find out, these are super nice!

I then wanted to both call a method and, upon completion, modify a member variable of another class. This was difficult to do in classic C++ due to interesting interplay of class scopes. However, C++ 11 introduced lambda functions to C++. Suddenly, I don’t have to put a tiny global function in my code, thereby reducing readability. That function would only ever be called in one place anyway (when the threads are created), so it makes sense to create an anonymous function right then and there like we would in Java.

Needless to say, I’m super excited about C++ 11 and will be digging deeper into it from here on out.

Adam Nickle

About Adam Nickle

I'm a total nerd, intellectual explorer, number theory enthusiast, and computer science nut. I'll write about anything from math and programming to religion and science fiction, all of which play central roles in my life.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *