LeonidPodosinnikov

cppClass.h

Mar 8th, 2017
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #ifndef CPP_CLASS_H__
  2. #define CPP_CLASS_H__
  3.  
  4. #include <string>
  5. #include <iostream>
  6.  
  7. #define _dbg(method) { std::cout << typeid(*this).name() << "::" << method << std::endl; }
  8.  
  9. struct cppClass
  10. {
  11.   explicit cppClass(std::string s): _str(s) { _dbg("cppClass(std::string)"); }
  12.   virtual ~cppClass() { _dbg("~cppClass()"); }
  13.  
  14.   std::string str() const { return _str; }
  15.   void set(const std::string& s) { _str = s; };
  16.   void print() const { std::cout << "cppClass::print(): " << _str << std::endl; }
  17.  
  18.   std::string _str;
  19. };
  20.  
  21. #endif // CPP_CLASS_H__
Advertisement
Add Comment
Please, Sign In to add comment