Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ciclic dependency problem
//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