remove use of C++11 auto