Relative Content

Tag Archive for c++polymorphismraii

How to get more loosely coupled code in C++

I know something about RAII principle which says allocate memory in constructor and deallocate in destructor; But problem is: i wanna use interfaces(classes with only abstract methods, at least one);
And i try to create class-variable of interface type and initialize this variable in cotructor, for example: