foreach ? foreach_rs ?
/**
* Template function, extract internal frame handles from the frameset and invoke the action function
* \param[in] action - instance with () operator implemented will be invoke after frame extraction.
*/
template<class T>
void foreach_rs(T action) const
{
rs2_error* e = nullptr;
auto count = size();
for (size_t i = 0; i < count; i++)
{
auto fref = rs2_extract_frame(get(), (int)i, &e);
error::handle(e);
action(frame(fref));
}
}