This is part of an overall push to remove OpenSim- and SimTK- specific indexing methods/types from downstream code. Instead of patterns like:
for (int i = 0; i < array.getSize(); ++i)
{
someStdLibVector[static_cast<size_t>(i)] = true;
}
Define osc::size as (e.g.) size_t size(OpenSim::Set<T> const& s) { return static_cast<size_t>(s.getSize); } so that downstream code can be written in a stdlib-like style, rather than having to cast between int, size_t, and ptrdiff_t.
This is part of an overall push to remove OpenSim- and SimTK- specific indexing methods/types from downstream code. Instead of patterns like:
Define
osc::size
as (e.g.)size_t size(OpenSim::Set<T> const& s) { return static_cast<size_t>(s.getSize); }
so that downstream code can be written in a stdlib-like style, rather than having to cast betweenint
,size_t
, andptrdiff_t
.