Hi,

we have multiple ways to test whether a Handle is valid. I've encountered the followings

1. if (h) then ...

2. if (h != nullptr) then ...

3. if (h.is_defined()) then ...

4. if (h != Handle::UNDEFINED) then ...

there might be more but that's the ones I can recall.

First question: Are they all strictly equivalent?

Second question: can we agree on a canonical way to do that and stick with it?

Since `if (h)` is the shortest I would suggest to go with that, but there might be reasons to go with something else, like more long term reasons, etc.

I'll update the wikipage with the conclusion of this thread. Thanks for you help.

Nil

--
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/a171e4aa-c840-6ac5-94ac-64be9174d087%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to