Skip to content
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

Make Stream's destructor public. #183

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

PieroV
Copy link
Contributor

@PieroV PieroV commented Oct 19, 2024

This commit makes ozz::io::Stream's destructor public.

The use case is having a function that returns a generic std::unique_ptr<ozz::io::Stream> which will be automatically destructed when the consumer is done with it without having to make assumption on the stream type.

If the constructor is protected/private, also std::unique_ptr cannot access it and the program fails to build.

A public destructor is needed to move around streams with their
interface pointers (or std::unique_ptr<Stream>) instead of the specific
implementation.
@PieroV PieroV changed the base branch from master to develop October 19, 2024 07:57
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.

1 participant