libcellml icon indicating copy to clipboard operation
libcellml copied to clipboard

Issue class: Bindings and C++ behaviour is no longer consistent

Open kerimoyle opened this issue 4 years ago • 2 comments

Since the Issue class changed to return just the std::any item from the item() function, instead of an AnyItem item, the behaviour of the bindings and the C++ version has diverged. We should either switch back to returning an AnyItem item, or update the bindings. The bindings currently return a tuple containing the type enum and the item (shadowing the AnyItem structure).

Which is better? And what was the original rationale for removing the AnyItem structure from the return? @hsorby @agarny @nickerso Thoughts?

kerimoyle avatar Oct 21 '20 02:10 kerimoyle

I think the bindings should be returning a single item of the type given by cellmlElementType.

hsorby avatar Oct 21 '20 02:10 hsorby

The original intention behind using a tuple/pair everywhere was to make sure that we didn't end up with orphaned std::any items that we don't know the type for. We've lost that now ... ?

kerimoyle avatar Oct 21 '20 02:10 kerimoyle