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

Add noexcept to the ResourceManager move constructor #328

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

jlee671
Copy link
Contributor

@jlee671 jlee671 commented Jan 8, 2025

What

Fix prefast warning 26439: This kind of function may not throw. Declare it 'noexcept'.

Why

Stay compliant with the C++ Core Guidelines and improve code safety by declaring the move constructor as noexcept.
 

How

Add noexcept to the ResourceManager move constructor.

Testing

Ensured unit test runs properly.

@jlee671
Copy link
Contributor Author

jlee671 commented Jan 8, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jlee671
Copy link
Contributor Author

jlee671 commented Jan 8, 2025

@heaths The warning was generated only for move constructor, should I add it to the default and copy constructor as well?

@heaths
Copy link
Member

heaths commented Jan 8, 2025

@heaths The warning was generated only for move constructor, should I add it to the default and copy constructor as well?

@jlee671 if those methods can't possibly throw, sure. Doesn't hurt. But they shouldn't thrown anywhere in the stack. That said, the compiler should catch if they do.

@jlee671 jlee671 merged commit 82d379d into main Jan 8, 2025
2 checks passed
@jlee671 jlee671 deleted the dev/jiwon/disable-c26439-for-prefast branch January 8, 2025 17:44
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

Successfully merging this pull request may close these issues.

2 participants