Last active
November 5, 2015 17:44
-
-
Save thiagomg/9a22c15e33e1c9c82692 to your computer and use it in GitHub Desktop.
Ciclic dependency problem
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
//File main_window.h -------------------- | |
#pragma once | |
#include "window.h" | |
struct main_window { | |
void close_child(); | |
private: | |
window child; | |
}; | |
//File window.h ------------------------- | |
#pragma once | |
#include <string> | |
#include "main_window.h" | |
struct window { | |
window(main_window &parent) : _parent(parent) { } | |
void close(); | |
private: | |
main_window &_parent; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment