some c++ code snippet