Idiomatic C++ code