vgteam / libhandlegraph

Library for the Handle Graph abstraction
MIT License
21 stars 5 forks source link

Null handle proposal #23

Open glennhickey opened 5 years ago

glennhickey commented 5 years ago

An example of a null handle as proposed in #22. I think this is handy, especially when re-working existing code that may rely on checks of the form Node* == nullptr or id == 0.

It's a trivial addition to the interface, but imposes a condition that all implementations reserve the chosen value. Thoughts?

jeizenga commented 5 years ago

I don't see this causing an issue on any existing implementations. In theory we could also accomplish this with ID 0, but it would require a bit of logic in implementations that don't explicitly encode the ID in the handle (namely XG). So yeah, I see the benefit.

jeizenga commented 4 years ago

Is there a reason this never got merged? I have an idea I want to try out, and I would need something along these lines for it.