Use std::exchange

This commit is contained in:
Jason Turner 2016-06-07 12:26:30 -06:00
parent 039d0edce3
commit 228c942b6c

View File

@ -200,8 +200,7 @@ namespace chaiscript
if (m_pos != m_end) { if (m_pos != m_end) {
if (*m_pos == '\n') { if (*m_pos == '\n') {
++line; ++line;
m_last_col = col; m_last_col = std::exchange(col, 1);
col = 1;
} else { } else {
++col; ++col;
} }