Skip to content

[cxx-interop] NFC: Improve documentation comments #62869

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

Merged
merged 3 commits into from
Jan 12, 2023

Conversation

egorzhdan
Copy link
Contributor

No description provided.

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jan 5, 2023
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

/// array.
///
/// - Complexity: O(*n*), where *n* is the number of elements in the C++
/// collection.
/// container.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we should add a note (for all these APIs) saying "Note that copying each element of the array may not take constant time, if the type of the element is defined in C++".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's reasonable, I added a note about that, thanks.

///
/// This initializer copies each element of the C++ collection to a new Swift
/// This initializer copies each element of the C++ container to a new Swift
/// array.
///
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment "This initializer copies each element of the C++ container to a new Swift array." might be misinterpreted to mean the init is creating a new Swift Array internally. You could instead say "Initializes the array (or self) by copying every element of the C++ container".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@SaiJayanth18
Copy link

Hey, I am new to this, but I want to learn and work to fix. Can I get a explanation of what to do?

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-sequence-docs branch from bddedda to 2ac5ccf Compare January 12, 2023 00:39
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit 0c64fe4 into main Jan 12, 2023
@egorzhdan egorzhdan deleted the egorzhdan/cxx-sequence-docs branch January 12, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants