mgradwohl / mgradwohl/ModernLife

Investigate copy/move assignment operators

Open
#43 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
13
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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);

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing Board, Renderer, and FPScounter with their uses in MainWindow.h and MainWindow.cpp, especially Attach() and Start(). Review Renderer.h and Renderer.cpp to identify members that are only initialized after construction. Done means the affected objects use copy/move assignment or constructors so they are fully initialized without relying on later setup calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.