Skip to content

Conversation

hnrklssn
Copy link
Contributor

Some cleanup in swift/bridging.

Inheriting some class named `NonCopyable` is not what makes a type
noncopyable. Explicitly use SWIFT_NONCOPYABLE in the example instead.
@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test

/// ```c++
/// class SWIFT_SHARED_REFERENCE(retainSharedObject, releaseSharedObject)
/// SharedObject : NonCopyable, IntrusiveReferenceCounted<SharedObject> {
/// class SWIFT_SHARED_REFERENCE(retainSharedObject, releaseSharedObject) SWIFT_NONCOPYABLE
Copy link
Contributor

Choose a reason for hiding this comment

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

Does SWIFT_NONCOPYABLE actually have any effect when applied to reference types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point actually

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then I'm not sure I follow the intent of the example 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove the noncopyable here entirely, just to avoid the (incorrect) assumption that a foreign reference type must be annotated as a noncopyable type explicitly.

@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test

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