Replace static_cast<size_t>(-1) with std::numeric_limits<std::size_t>::max() via the detail::unknown_size() function