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

Add support for void[0] types. #3

Closed
wants to merge 3 commits into from
Closed

Add support for void[0] types. #3

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 12, 2012

The void[0][Key] trick is used when you want to use builtin hashes as Set types (hashes with no values).

@repeatedly
Copy link
Member

This is interesting pull request :)
void[0] hash value type as set is popular?

@ghost
Copy link
Author

ghost commented Nov 13, 2012

I've seen it mentioned in several NG posts that using such a value type means the hashmap won't use any memory for the values, but I never checked this.

@ghost
Copy link
Author

ghost commented Nov 13, 2012

I think it could be true because:

alias void[0] Type;
writeln(Type.sizeof);  // writes 0

Add simple example to the readme.
@ghost ghost closed this Feb 26, 2013
@ghost ghost reopened this Feb 26, 2013
@ghost
Copy link
Author

ghost commented Feb 26, 2013

Ok I've significantly simplified this now, instead of hardcoding hash support everywhere I've simply implemented pack, unpack and as for void[0] type. So now this will automatically work for hashes having that type as a value.

@ghost
Copy link
Author

ghost commented Feb 26, 2013

Ah the commits somehow reference an older one, let me fix this first.

@ghost ghost closed this Feb 26, 2013
@ghost ghost mentioned this pull request Feb 26, 2013
This pull request was closed.
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