Skip to content

Conversation

ocelaiwo
Copy link
Contributor

This PR makes callback UniqueCore/SharedCore instances move the result from the caller SharedCore when they are the last callback to ever need the value

@coveralls
Copy link

coveralls commented Aug 13, 2025

Pull Request Test Coverage Report for Build 16950797610

Details

  • 15 of 15 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 16837660144: 0.0%
Covered Lines: 1904
Relevant Lines: 1904

💛 - Coveralls

@@ -13,8 +13,8 @@ using SharedContract = std::pair<SharedFuture<V, E>, SharedPromise<V, E>>;

template <typename V = void, typename E = StopError>
[[nodiscard]] SharedContract<V, E> MakeSharedContract() {
// 2 refs for SharedPromise, 1 ref for SharedFuture
auto core = MakeShared<detail::SharedCore<V, E>>(3);
// 3 refs for SharedPromise, 1 ref for SharedFuture
Copy link
Member

@MBkkt MBkkt Aug 13, 2025

Choose a reason for hiding this comment

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

Suggested change
// 3 refs for SharedPromise, 1 ref for SharedFuture
// 1 refs for SharedPromise, 1 ref for SharedFuture, 2 ref for last Set

@MBkkt MBkkt marked this pull request as ready for review August 13, 2025 17:25
@MBkkt MBkkt requested a review from kononovk as a code owner August 13, 2025 17:25
@MBkkt MBkkt self-assigned this Aug 13, 2025
@MBkkt MBkkt merged commit c60dc94 into YACLib:main Aug 13, 2025
34 checks passed
@ocelaiwo ocelaiwo deleted the move_from_shared branch September 3, 2025 14:05
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.

3 participants