Skip to content

Instantly share code, notes, and snippets.

@zao
Created August 26, 2011 23:20
Show Gist options
  • Save zao/1174675 to your computer and use it in GitHub Desktop.
Save zao/1174675 to your computer and use it in GitHub Desktop.
circular includes
#include "A.hpp"
#include "B.hpp"
void A::f(B* b)
{
b->g(this);
}
#pragma once
struct B;
struct A
{
void f(B* b);
};
#include "B.hpp"
#include "A.hpp"
void B::g(A* a)
{
a->f(this);
}
#pragma once
struct A;
struct B
{
void g(A* a);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment