[bugfix] use std::size_t as template argument in function