Skip to content

Instantly share code, notes, and snippets.

@fpersson
Created December 10, 2011 14:51
Show Gist options
  • Save fpersson/1455335 to your computer and use it in GitHub Desktop.
Save fpersson/1455335 to your computer and use it in GitHub Desktop.
Circular depediance
#include <iostream>
class Barney;
class Fred{
public:
void tada(){
std::cout << "tada" << std::endl;
}
private:
Barney* y;
};
class Barney{
public:
void method(){
x->tada();
}
private:
Fred* x;
};
int main(){
Barney b;
b.method();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment