Last active
January 30, 2018 08:52
-
-
Save fortheday/4ba65b2cd25f84e6345302b1ad0c1a34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CCaseA { | |
public: | |
CCaseA() = delete; | |
}; | |
class CCaseB { | |
public: | |
CCaseB() = default; | |
CCaseB & operator =(const CCaseB &) = delete; | |
}; | |
class CCaseC { | |
private: | |
char *m_pBuffer; | |
public: | |
CCaseC() : m_pBuffer(new char[10]) { } | |
}; | |
class CCaseC_Derived : public CCaseC { | |
public: | |
using CCaseC::CCaseC; | |
}; | |
void ConstructorTest() | |
{ | |
CCaseA caseA; // COMPILE ERROR | |
CCaseB caseB; | |
CCaseC caseC; | |
CCaseC_Derived caseCD; | |
caseC = caseC; // shallow copy | |
caseB = caseB; // COMPILE ERROR | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment