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

nullptr context in standard library #660

Open
codygunton opened this issue Aug 15, 2023 · 2 comments
Open

nullptr context in standard library #660

codygunton opened this issue Aug 15, 2023 · 2 comments

Comments

@codygunton
Copy link
Collaborator

Null pointers are uses as the default context (pointer to a builder). This was a frequent source of issues when building the circuit simulator because we'd to access, for example, the failed state of the composer and get a segfault. Is there any subtle logic around the use of the nullptr context when we're constructing circuit constants? I think it would be best to always initialize the context and git rid of any special nullptr logic that exists in favor of something more explicit, and something that does not conflict with the strategy I took for the simlator.

@kevaundray
Copy link
Contributor

std::optional probably makes sense here, most of the logic around nullptr IIRC is just there to see if it has been set, if not then the stdlib type is likely a constant

@codygunton codygunton changed the title Nullptr context in standard library nullptr context in standard library Aug 17, 2023
@codygunton
Copy link
Collaborator Author

Note that the simulator has been scrapped but the questions above the issue is still worth investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants