From e080d8c8c5ba8ed5a0cff53e721f4a46f9db24b4 Mon Sep 17 00:00:00 2001 From: Moritz Sallermann Date: Sat, 9 Mar 2024 15:02:28 +0000 Subject: [PATCH] Network: Used iterator + size span constructors, because of Apple clang weirdness --- src/network.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network.cpp b/src/network.cpp index 5c7d196..f0659f2 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -47,12 +47,12 @@ std::vector> Seldon::Network::strongly_connected_components( std::span Seldon::Network::get_neighbours( std::size_t agent_idx ) const { - return std::span( neighbour_list[agent_idx].cbegin(), neighbour_list[agent_idx].cend() ); + return std::span( neighbour_list[agent_idx].begin(), neighbour_list[agent_idx].size() ); } std::span Seldon::Network::get_neighbours( std::size_t agent_idx ) { - return std::span( neighbour_list[agent_idx].begin(), neighbour_list[agent_idx].end() ); + return std::span( neighbour_list[agent_idx].begin(), neighbour_list[agent_idx].size() ); } void Seldon::Network::set_neighbours_and_weights( @@ -84,12 +84,12 @@ void Seldon::Network::push_back_neighbour_and_weight( size_t i, size_t j, Weight std::span Seldon::Network::get_weights( std::size_t agent_idx ) const { - return std::span( weight_list[agent_idx].cbegin(), weight_list[agent_idx].cend() ); + return std::span( weight_list[agent_idx].cbegin(), weight_list[agent_idx].size() ); } std::span Seldon::Network::get_weights( std::size_t agent_idx ) { - return std::span( weight_list[agent_idx].begin(), weight_list[agent_idx].end() ); + return std::span( weight_list[agent_idx].begin(), weight_list[agent_idx].size() ); } void Seldon::Network::set_weights( std::size_t agent_idx, std::span weights )