Skip to content

Commit 8328fbb

Browse files
authored
Use std::as_const for load_gen and load_gen_type
Signed-off-by: Martijn Govers <martijn.govers@alliander.com>
1 parent 22429e0 commit 8328fbb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • power_grid_model_c/power_grid_model/include/power_grid_model

power_grid_model_c/power_grid_model/include/power_grid_model/topology.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ class Topology {
556556
std::ranges::for_each(math_topology_,
557557
[](MathModelTopology& topo) { topo.load_gen_type.resize(topo.n_load_gen()); });
558558
// assign load type
559-
for (auto const& [idx_math, load_gen_type] : std::views::zip(comp_coup_.load_gen, comp_topo_.load_gen_type)) {
559+
for (auto const& [idx_math, load_gen_type] : std::views::zip(std::as_const(comp_coup_.load_gen),
560+
std::as_const(comp_topo_.load_gen_type))) {
560561
if (idx_math.group == -1) {
561562
continue;
562563
}

0 commit comments

Comments
 (0)