Skip to content

Commit eef1962

Browse files
committed
refactor: use c++23
1 parent 9df865c commit eef1962

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ project(
1414
CXX
1515
)
1616

17-
set(CMAKE_CXX_STANDARD 20)
17+
set(CMAKE_CXX_STANDARD 23)
1818
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1919
set(CMAKE_CXX_EXTENSIONS OFF)
2020

source/compiler/compiler.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,9 @@ auto compiler::replace_last_pop_with_return() -> void
118118

119119
auto compiler::replace_instruction(const std::size_t pos, const instructions& instr) -> void
120120
{
121-
// cppcheck-suppress variableScope
122121
auto& target_instrs = m_scopes[m_scope_index].instrs;
123-
for (auto idx = 0UL; const auto& inst : instr) {
122+
for (auto [idx, inst] : std::ranges::views::enumerate(instr)) {
124123
target_instrs[pos + idx] = inst;
125-
idx++;
126124
}
127125
}
128126

0 commit comments

Comments
 (0)