From f558e7c68202814b6da6951b36a713291d844d47 Mon Sep 17 00:00:00 2001 From: BenPinet Date: Thu, 6 Aug 2026 14:07:32 +0200 Subject: [PATCH] fix(Tuple): remove std::make_pair and std::make_tuple --- .../component_meshes_degeneration.cpp | 22 +++++++++++++------ .../manifold/surface_edge_manifold.cpp | 3 ++- .../topology/internal/expected_nb_cmvs.cpp | 6 ++--- .../inspection/test-surface-intersections.cpp | 15 ++++++++----- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/geode/inspector/inspection/criterion/internal/component_meshes_degeneration.cpp b/src/geode/inspector/inspection/criterion/internal/component_meshes_degeneration.cpp index 90709b80..a0ecf0bb 100644 --- a/src/geode/inspector/inspection/criterion/internal/component_meshes_degeneration.cpp +++ b/src/geode/inspector/inspection/criterion/internal/component_meshes_degeneration.cpp @@ -71,11 +71,14 @@ namespace geode const EdgedCurveDegeneration< Model::dim > inspector{ line.mesh() }; - auto issues = inspector.small_edges( threshold ); + std::pair< uuid, InspectionIssues< index_t > > result; + auto& [line_id, issues] = result; + line_id = line.id(); + issues = inspector.small_edges( threshold ); issues.set_description( absl::StrCat( "Line ", line.name().value_or( line.id().string() ), " (", line.id().string(), ") small edges" ) ); - return std::make_pair( line.id(), std::move( issues ) ); + return result; } ) ); } for( auto& task : @@ -102,13 +105,15 @@ namespace geode } const geode::SurfaceMeshDegeneration< Model::dim > inspector{ surface.mesh() }; - auto issues = inspector.small_edges( threshold ); + std::pair< uuid, InspectionIssues< index_t > > result; + auto& [surface_id, issues] = result; + surface_id = surface.id(); + issues = inspector.small_edges( threshold ); issues.set_description( absl::StrCat( "Surface ", surface.name().value_or( surface.id().string() ), " (", surface.id().string(), ") small facet edges" ) ); - return std::make_pair( - surface.id(), std::move( issues ) ); + return result; } ) ); } for( auto& task : @@ -142,11 +147,14 @@ namespace geode tasks.emplace_back( async::spawn( [&threshold, &surface] { const geode::SurfaceMeshDegeneration< Model::dim > inspector{ surface.mesh() }; - auto issues = inspector.small_height_polygons( threshold ); + std::pair< uuid, InspectionIssues< index_t > > result; + auto& [surface_id, issues] = result; + surface_id = surface.id(); + issues = inspector.small_height_polygons( threshold ); issues.set_description( absl::StrCat( "Surface ", surface.name().value_or( surface.id().string() ), " (", surface.id().string(), ") small height polygons" ) ); - return std::make_pair( surface.id(), std::move( issues ) ); + return result; } ) ); } for( auto& task : diff --git a/src/geode/inspector/inspection/criterion/manifold/surface_edge_manifold.cpp b/src/geode/inspector/inspection/criterion/manifold/surface_edge_manifold.cpp index 8619daff..4a27268c 100644 --- a/src/geode/inspector/inspection/criterion/manifold/surface_edge_manifold.cpp +++ b/src/geode/inspector/inspection/criterion/manifold/surface_edge_manifold.cpp @@ -52,7 +52,8 @@ namespace }; if( !polygons_around_edges .try_emplace( polygon_edge_vertex_cycle, - std::make_pair( 1, false ) ) + std::pair< geode::local_index_t, bool >{ + 1, false } ) .second ) { polygons_around_edges[polygon_edge_vertex_cycle].first += 1; diff --git a/src/geode/inspector/inspection/topology/internal/expected_nb_cmvs.cpp b/src/geode/inspector/inspection/topology/internal/expected_nb_cmvs.cpp index 9b8dd93b..ef2b5dc3 100644 --- a/src/geode/inspector/inspection/topology/internal/expected_nb_cmvs.cpp +++ b/src/geode/inspector/inspection/topology/internal/expected_nb_cmvs.cpp @@ -197,10 +197,10 @@ namespace if( nb_block_cmvs == predicted_nb_block_cmvs + nb_lines_on_several_boundaries ) { - return std::make_pair( nb_block_cmvs, std::nullopt ); + return { nb_block_cmvs, std::nullopt }; } } - return std::make_pair( predicted_nb_block_cmvs, + return { predicted_nb_block_cmvs, nb_block_cmvs == predicted_nb_block_cmvs ? std::nullopt : std::make_optional( absl::StrCat( "unique vertex ", @@ -227,7 +227,7 @@ namespace nb_line_on_boundary_cmvs, " cmvs counted for lines on the boundary, with ", nb_block_cmvs, " Block CMVs (expected ", - predicted_nb_block_cmvs, " with valid topology)." ) ) ); + predicted_nb_block_cmvs, " with valid topology)." ) ) }; } } // namespace diff --git a/tests/inspection/test-surface-intersections.cpp b/tests/inspection/test-surface-intersections.cpp index 2707ea12..ce46d386 100644 --- a/tests/inspection/test-surface-intersections.cpp +++ b/tests/inspection/test-surface-intersections.cpp @@ -58,17 +58,20 @@ void check_intersections2D() "2D Surface should have 3 intersecting elements pair." ); bool right_intersections{ true }; const auto &triangles_inter = inspection.issues(); - if( absl::c_find( triangles_inter, std::make_pair( 2u, 0u ) ) + if( absl::c_find( triangles_inter, + std::pair< geode::index_t, geode::index_t >{ 2u, 0u } ) == triangles_inter.end() ) { right_intersections = false; } - if( absl::c_find( triangles_inter, std::make_pair( 2u, 1u ) ) + if( absl::c_find( triangles_inter, + std::pair< geode::index_t, geode::index_t >{ 2u, 1u } ) == triangles_inter.end() ) { right_intersections = false; } - if( absl::c_find( triangles_inter, std::make_pair( 0u, 1u ) ) + if( absl::c_find( triangles_inter, + std::pair< geode::index_t, geode::index_t >{ 0u, 1u } ) == triangles_inter.end() ) { right_intersections = false; @@ -112,12 +115,14 @@ void check_intersections3D() inspection.nb_issues(), "." ); bool right_intersections{ true }; const auto &triangles_inter = inspection.issues(); - if( absl::c_find( triangles_inter, std::make_pair( 0u, 4u ) ) + if( absl::c_find( triangles_inter, + std::pair< geode::index_t, geode::index_t >{ 0u, 4u } ) == triangles_inter.end() ) { right_intersections = false; } - if( absl::c_find( triangles_inter, std::make_pair( 2u, 4u ) ) + if( absl::c_find( triangles_inter, + std::pair< geode::index_t, geode::index_t >{ 2u, 4u } ) == triangles_inter.end() ) { right_intersections = false;