moved from ::iterator to decltype

This commit is contained in:
Jan Koniarik 2025-01-10 20:58:38 +01:00
parent 0b44c706f3
commit 13a3ca27e5

View File

@ -47,7 +47,7 @@ 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;
using diff_t = typename std::iterator_traits<decltype(formatted.end())>::difference_type;
if (lines_.size() < lines_to_save) {
lines_.emplace_back(formatted.begin(), formatted.end() - static_cast<diff_t>(eol_len));
}