Optimize inspect with C++ 11 feature