Re-work OrtApi struct to satisfy C++20 compilers#15183
Merged
yuslepukhin merged 3 commits intomainfrom Mar 24, 2023
Merged
Conversation
Contributor
|
Talked to Dmitri about it and based on the hassle this is causing between the different compilers and different C++ versions, I said I'm fine just deleting the no copy preventer. Not worth the hassle just to prevent an accidental super minor perf issue if someone does copy this structure. |
edgchen1
reviewed
Mar 23, 2023
| NoCopy(const NoCopy&) = delete; | ||
| NoCopy& operator=(const NoCopy&) = delete; | ||
| }; | ||
| NoCopy m_no_copy; |
Contributor
There was a problem hiding this comment.
naming suggestion: NonCopyable non_copyable_;
RyanUnderhill
approved these changes
Mar 23, 2023
Contributor
|
Thanks @yuslepukhin! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove
deletionof copy functions fromOrtApias its initialization no longer compiles in C++20.Introduce a non-copyable member to implicitly delete copy ctor.
Motivation and Context
Inspired by #14901
Solution credits: @RyanUnderhill
Cc: @georgthegreat