Skip to content

Instantly share code, notes, and snippets.

@cbecker
Created April 7, 2017 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbecker/5ca855c173ba76fbbe46bf8e155de8ac to your computer and use it in GitHub Desktop.
Save cbecker/5ca855c173ba76fbbe46bf8e155de8ac to your computer and use it in GitHub Desktop.
Pimpl idea
#include "MyClass.h"
class MyClass::Impl
{
// etc..
};
MyClass::MyClass()
: m_pimpl(new Impl())
{
}
MyClass::~MyClass()
{
}
#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