Skip to content

Instantly share code, notes, and snippets.

@eXpl0it3r
Last active December 14, 2015 08:34
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 eXpl0it3r/757b5671918b90819115 to your computer and use it in GitHub Desktop.
Save eXpl0it3r/757b5671918b90819115 to your computer and use it in GitHub Desktop.
Forward Decleration
#include "B.hpp"
#include "C.hpp"
B::B()
: m_c(nullptr)
{
}
#pragma once
class C;
class B
{
public:
B();
private:
C* m_c;
};
#include "C.hpp"
#include "D.hpp"
C::C()
: m_d(nullptr)
{
}
#pragma once
class D;
class C
{
public:
C();
private:
D* m_d;
};
#pragma once
class D
{
};
#include "B.hpp"
int main()
{
B b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment