implementation of delegates metodology in C++