Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to access newly constructed AppStates #95

Open
LB-- opened this issue Feb 20, 2015 · 0 comments
Open

Unable to access newly constructed AppStates #95

LB-- opened this issue Feb 20, 2015 · 0 comments
Assignees

Comments

@LB--
Copy link
Member

LB-- commented Feb 20, 2015

Application::changeState() should return a reference to the new AppState instance so that calling code can interact with it beyond passing constructor arguments.

Additionally, something should be done about the destruction of the old AppState object inside the call - generally an AppState will be making the call to changeState() and will thus be destructing itself. This is dangerous even if documented.

I'm thinking of returning both the old and the new in a std::pair<std::unique_ptr<AppState>, std::reference_wrapper<NewState>> or making a simple custom struct to label them previous and current.

@LB-- LB-- self-assigned this Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant