implement an decorater in C++