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

Immutable data deserialization support #1190

Merged
merged 1 commit into from Jul 31, 2015

Conversation

Projects
None yet
3 participants
@japplegame
Contributor

japplegame commented Jul 20, 2015

Adds the ability to deserialize immutable data. See unittest.

@@ -446,8 +446,12 @@ private void serializeImpl(Serializer, alias Policy, T, ATTRIBUTES...)(ref Seria
} else static assert(false, "Unsupported serialization type: " ~ T.stringof);
}
private T deserializeImpl(T, alias Policy, Serializer, ATTRIBUTES...)(ref Serializer deserializer) if(!isMutable!T)
{
return cast(T) deserializeImpl!(Unqual!T, Policy, Serializer, ATTRIBUTES)(deserializer);

This comment has been minimized.

@Geod24

Geod24 Jul 21, 2015

Contributor

I'd use assumeUnique here.

@Geod24

Geod24 Jul 21, 2015

Contributor

I'd use assumeUnique here.

This comment has been minimized.

@japplegame

japplegame Jul 21, 2015

Contributor

In this case assumeUnique will not help, because it works only with arrays.

@japplegame

japplegame Jul 21, 2015

Contributor

In this case assumeUnique will not help, because it works only with arrays.

This comment has been minimized.

@Geod24

Geod24 Jul 21, 2015

Contributor

Wut. I always assumed it worked with everything and was just documenting.
I'm not familiar with this part, but could you also add an unittest for a const/immutable object if there's not one already ?

@Geod24

Geod24 Jul 21, 2015

Contributor

Wut. I always assumed it worked with everything and was just documenting.
I'm not familiar with this part, but could you also add an unittest for a const/immutable object if there's not one already ?

This comment has been minimized.

@japplegame

japplegame Jul 22, 2015

Contributor

I slightly modified the unittest.

@japplegame

japplegame Jul 22, 2015

Contributor

I slightly modified the unittest.

Immutable data deserialization support
Adds the ability to deserialize immutable data. See unittest.

s-ludwig added a commit that referenced this pull request Jul 31, 2015

Merge pull request #1190 from japplegame/patch-1
Immutable data deserialization support

@s-ludwig s-ludwig merged commit 4929211 into vibe-d:master Jul 31, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment