mcneel / rhino3dm

Libraries based on OpenNURBS with a RhinoCommon style
MIT License
610 stars 139 forks source link

Need a GetTuple() to complete tuple syntax #374

Closed fraguada closed 3 years ago

fraguada commented 3 years ago

Certain methods still rely on std::... tuple syntax. We could completely update the syntax by adding a GetTuple analog to std::get<0>(). Would it be something like this in bindings.h:

T& GetTuple(BND_TUPLE& tuple, int index)
{
#if defined(ON_PYTHON_COMPILE)
  return tuple[index];
#else
  return tuple.get(index);
#endif
}

What would be the appropriate return type?

fraguada commented 3 years ago

Reviewing this and I can only find very few cases where something like this would be needed, and it is more a cosmetics benefit.