Created
April 7, 2017 11:56
-
-
Save cbecker/5ca855c173ba76fbbe46bf8e155de8ac to your computer and use it in GitHub Desktop.
Pimpl idea
This file contains 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
#include "MyClass.h" | |
class MyClass::Impl | |
{ | |
// etc.. | |
}; | |
MyClass::MyClass() | |
: m_pimpl(new Impl()) | |
{ | |
} | |
MyClass::~MyClass() | |
{ | |
} |
This file contains 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
#pragma once | |
#include <memory> | |
class EXPORT_MACRO MyClass | |
{ | |
public: | |
MyClass(); | |
~MyClass() | |
private: | |
class Impl; | |
std::unique_ptr<Impl> m_pimpl; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment