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

Disallow implicit construction from underlying handle value #15

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

kingsamchen
Copy link
Owner

@kingsamchen kingsamchen commented Apr 28, 2024

Current implementation will make an expression like

bool ok = handle.get() == 1;

fail to compile, because there are two possible implicit conversions:

  1. convert from 1 to unique handle
  2. convert handle.get() to int value (underlying handle value)

Now that we have wrap_* functions, we can disallow implicit construction from underlying handle value

@kingsamchen kingsamchen merged commit f3a9231 into master Apr 28, 2024
@kingsamchen kingsamchen deleted the improve-unique-handle branch April 28, 2024 16:28
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.

None yet

1 participant