C++Optimization in C++