A* algorithm in C++11