Skip to content

InfoType for pointers #3103

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

Closed
wants to merge 1 commit into from
Closed

Conversation

marler8997
Copy link
Contributor

@marler8997 marler8997 commented Aug 20, 2019

Related Proposal: #2907 (ability to create primitive types from TypeInfo, but not necessarily aggregate types)

A standard library implementation of a function that can convert TypeInfo values to their corresponding type value.

Currently I've only implemented the Pointer subset. If this solution is accepted, then we can expand it to other types as well.

@daurnimator
Copy link
Contributor

I think this was intended to be done as a builtin?

@marler8997
Copy link
Contributor Author

marler8997 commented Aug 21, 2019

@daurnimator correct. Here is what it would look like if it was implemented in the standard library. At least a preview. The complete implementation for all types that "make sense" (see #2907 (comment)) to implement would be larger.

In the D community people tend to prefer standard library changes over changes to the language itself. I figured I would put together a standard library solution for comparison. Though, I'm not sure what all the pros/cons of a language vs library solution would be.

@marler8997 marler8997 mentioned this pull request Aug 22, 2019
@marler8997
Copy link
Contributor Author

I'm going to guess that the builtin will be preferred so closing this one.

@marler8997 marler8997 closed this Aug 23, 2019
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.

2 participants