As I can understand what you are looking for is possible in C++ but not the way you have written it.