Created
February 20, 2018 18:47
-
-
Save tablatronix/2e1ab49ea4944654091da56cca501494 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
// .h | |
#ifdef whatnot | |
std::unique_ptr<classA> theclass; | |
#else | |
std::unique_ptr<classB> theclass; | |
#endif | |
// .cpp | |
// How can I avoid using the actual classnames here | |
#ifdef whatnot | |
theclass.reset(new classA(blargh)); | |
#else | |
theclass.reset(new classB(blargh)); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using