updated grouper to support std::begin and std::end