scoped process control for c++