Skip to content

Add a default copy constructor to CharProxy#154

Merged
DanielaOrtner merged 1 commit into
RebelToolbox:mainfrom
madmiraal:fix-implicit-copy-constructor
Apr 12, 2025
Merged

Add a default copy constructor to CharProxy#154
DanielaOrtner merged 1 commit into
RebelToolbox:mainfrom
madmiraal:fix-implicit-copy-constructor

Conversation

@madmiraal
Copy link
Copy Markdown
Contributor

When there is copy assignment operator defined, relying on the definition of an implicit copy constructor is deprecated. Currently CharProxy<T> has a copy assignment operator defined, but no copy constructor:

_FORCE_INLINE_ void operator=(const CharProxy<T>& other) const {
_cowdata.set(_index, other.operator T());
}

This PR tells the compiler to use the default copy constructor.

@madmiraal madmiraal added the PR Type: Bug Fix Your current game should now work as expected. label Apr 11, 2025
@DanielaOrtner DanielaOrtner self-requested a review April 12, 2025 12:17
Copy link
Copy Markdown
Contributor

@DanielaOrtner DanielaOrtner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for keeping our code clear and precise.

@DanielaOrtner DanielaOrtner merged commit 15c5184 into RebelToolbox:main Apr 12, 2025
@madmiraal madmiraal deleted the fix-implicit-copy-constructor branch April 13, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR Type: Bug Fix Your current game should now work as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants