diff --git a/include/melon/algorithm/breadth_first_search.hpp b/include/melon/algorithm/breadth_first_search.hpp index 488b6cc..92bbedd 100644 --- a/include/melon/algorithm/breadth_first_search.hpp +++ b/include/melon/algorithm/breadth_first_search.hpp @@ -60,6 +60,7 @@ class breadth_first_search { cursor _queue_current; reached_map _reached_map; + [[no_unique_address]] pred_vertices_map _pred_vertices_map; [[no_unique_address]] pred_arcs_map _pred_arcs_map; [[no_unique_address]] distances_map _dist_map; diff --git a/include/melon/algorithm/depth_first_search.hpp b/include/melon/algorithm/depth_first_search.hpp index 0f142da..04a2ab6 100644 --- a/include/melon/algorithm/depth_first_search.hpp +++ b/include/melon/algorithm/depth_first_search.hpp @@ -55,6 +55,7 @@ class depth_first_search { std::vector _stack; reached_map _reached_map; + [[no_unique_address]] pred_vertices_map _pred_vertices_map; [[no_unique_address]] pred_arcs_map _pred_arcs_map; [[no_unique_address]] distances_map _dist_map; diff --git a/include/melon/algorithm/dijkstra.hpp b/include/melon/algorithm/dijkstra.hpp index cd77c08..4257bb1 100644 --- a/include/melon/algorithm/dijkstra.hpp +++ b/include/melon/algorithm/dijkstra.hpp @@ -84,6 +84,7 @@ class dijkstra { heap _heap; vertex_status_map _vertex_status_map; + [[no_unique_address]] pred_vertices_map _pred_vertices_map; [[no_unique_address]] pred_arcs_map _pred_arcs_map; [[no_unique_address]] distances_map _distances_map; diff --git a/include/melon/algorithm/topological_sort.hpp b/include/melon/algorithm/topological_sort.hpp index 16c3371..8e458e1 100644 --- a/include/melon/algorithm/topological_sort.hpp +++ b/include/melon/algorithm/topological_sort.hpp @@ -36,15 +36,18 @@ class topological_sort { using reached_map = vertex_map_t; using remaining_in_degree_map = vertex_map_t; + struct no_pred_vertices_map {}; using pred_vertices_map = std::conditional, - std::monostate>::type; + no_pred_vertices_map>::type; + struct no_pred_arcs_map {}; using pred_arcs_map = std::conditional, - std::monostate>::type; + no_pred_arcs_map>::type; + struct no_distance_map {}; using distances_map = std::conditional, - std::monostate>::type; + no_distance_map>::type; private: std::reference_wrapper _graph; @@ -53,6 +56,7 @@ class topological_sort { reached_map _reached_map; remaining_in_degree_map _remaining_in_degree_map; + [[no_unique_address]] pred_vertices_map _pred_vertices_map; [[no_unique_address]] pred_arcs_map _pred_arcs_map; [[no_unique_address]] distances_map _dist_map; @@ -93,11 +97,11 @@ class topological_sort { , _remaining_in_degree_map(create_vertex_map( g, std::numeric_limits::max())) , _pred_vertices_map(constexpr_ternary( - create_vertex_map(g), std::monostate{})) + create_vertex_map(g), no_pred_vertices_map{})) , _pred_arcs_map(constexpr_ternary( - create_vertex_map(g), std::monostate{})) + create_vertex_map(g), no_pred_arcs_map{})) , _dist_map(constexpr_ternary( - create_vertex_map(g), std::monostate{})) { + create_vertex_map(g), no_distance_map{})) { _queue.reserve(nb_vertices(g)); push_start_vertices(); }