explicitly cast diff variable in test_sink

This commit is contained in:
Jan Koniarik 2025-01-10 17:47:54 +01:00
parent 48768d0aca
commit 0b44c706f3

View File

@ -47,8 +47,9 @@ protected:
base_sink<Mutex>::formatter_->format(msg, formatted);
// save the line without the eol
auto eol_len = strlen(details::os::default_eol);
using diff_t = typename std::iterator_traits<typename memory_buf_t::iterator>::difference_type;
if (lines_.size() < lines_to_save) {
lines_.emplace_back(formatted.begin(), formatted.end() - eol_len);
lines_.emplace_back(formatted.begin(), formatted.end() - static_cast<diff_t>(eol_len));
}
msg_counter_++;
std::this_thread::sleep_for(delay_);