1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #include <string> #include <vector>
class someClass { public: using VecI = std::vector<int>;
someClass() = default; someClass(const someClass& some1) { mPtrInt = new int(*some1.mPtrInt); }; someClass(const std::string str; const VecI& vec): mStr(str), mVecInt(vec) {};
~someClass() { delete mPtrInt; };
void foo(); int foo2(); double foo3();
void setStr(const std::string& inputStr) { mStr = inputStr; }; void setVecInt(const VecI& inputVec) { mVecInt = inputVec; };
std::string getStr() { return mStr } const; VecI getVecInt() { return mVecInt } const;
protected:
private: std::string mStr; VecI mVecInt; int* mPtrInt; }
|