Use std::begin / std::end instead of sizeof

Thanks to Kevin!