Skip to content

Commit 0253725

Browse files
committed
[Interop] Make example in doc comment more idiomatic
Inheriting some class named `NonCopyable` is not what makes a type noncopyable. Explicitly use SWIFT_NONCOPYABLE in the example instead.
1 parent c82e85d commit 0253725

File tree

1 file changed

+4
-4
lines changed
  • lib/ClangImporter/SwiftBridging/swift

1 file changed

+4
-4
lines changed

lib/ClangImporter/SwiftBridging/swift/bridging

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
/// This example shows how to use this macro to let Swift know that
5454
/// a non-copyable reference counted C++ class can be imported as a reference counted type in Swift:
5555
/// ```c++
56-
/// class SWIFT_SHARED_REFERENCE(retainSharedObject, releaseSharedObject)
57-
/// SharedObject : NonCopyable, IntrusiveReferenceCounted<SharedObject> {
56+
/// class SWIFT_SHARED_REFERENCE(retainSharedObject, releaseSharedObject) SWIFT_NONCOPYABLE
57+
/// SharedObject : IntrusiveReferenceCounted<SharedObject> {
5858
/// public:
5959
/// static SharedObject* create();
6060
/// void doSomething();
@@ -84,8 +84,8 @@
8484
/// This example shows how to use this macro to let Swift know that
8585
/// a non-copyable singleton C++ class can be imported as a reference type in Swift:
8686
/// ```c++
87-
/// class SWIFT_IMMORTAL_REFERENCE
88-
/// LoggerSingleton : NonCopyable {
87+
/// class SWIFT_IMMORTAL_REFERENCE SWIFT_NONCOPYABLE
88+
/// LoggerSingleton {
8989
/// public:
9090
/// static LoggerSingleton &getInstance();
9191
/// void log(int x);

0 commit comments

Comments
 (0)