Skip to content

Copy on Write #110

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Copy on Write #110

wants to merge 9 commits into from

Conversation

jamierpond
Copy link
Collaborator

  • Comments
  • string io affordance working
  • works
  • update copy
  • copy on write tests pass

@jamierpond jamierpond requested a review from thecppzoo April 29, 2025 04:23
}

auto makeExclusive() {
*sharedPointer() = std::make_shared<V>(*value());

Choose a reason for hiding this comment

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

Not that this would be an issue for the vast majority of cases, but maybe const qualify the lvalue reference so it always selects the copy constructor.

Suggested change
*sharedPointer() = std::make_shared<V>(*value());
*sharedPointer() = std::make_shared<V>(static_cast<const V &>(*value()));

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