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

Investigate copy/move assignment operators #43

Open
mgradwohl opened this issue Feb 15, 2023 · 0 comments
Open

Investigate copy/move assignment operators #43

mgradwohl opened this issue Feb 15, 2023 · 0 comments

Comments

@mgradwohl
Copy link
Owner

Avoid partial construction by implementing copy/move assignment operators/constructors.

e.g. look at Board, Renderer, FPScounter, etc.

instead of constructing in mainwindow.h and then calling Attach(), Start() etc, which means the object isn't correctly initialized until those are called, see if you can implement this pattern.

MainWindow.h
fpscounter fps{nullptr_t}

MainWindow.cpp
fps = fps(foo, bar, blah);

For example Renderer.h has
Microsoft::Graphics::Canvas::CanvasRenderTarget _spritesheet{ nullptr };
Which isn't truly initialized until
Renderer.cpp
_spritesheet = Microsoft::Graphics::Canvas::CanvasRenderTarget(_canvasDevice, _spriteDipsPerRow, _spriteDipsPerRow, _dpi);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant