From c2bd84100a1080dfa10ca1e5a79c3b0a76fbb11a Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis <spiros.tsalikis@kitware.com> Date: Wed, 12 Feb 2025 12:30:43 -0500 Subject: [PATCH] Eliminate modernize-use-transparent-functors warnings --- Common/Core/vtkSortDataArray.cxx | 4 ++-- Common/DataModel/vtkDataSetAttributesFieldList.cxx | 2 +- Common/DataModel/vtkPolyhedron.cxx | 4 ++-- Common/DataModel/vtkSphericalPointIterator.cxx | 2 +- Common/DataModel/vtkStaticCellLocator.cxx | 2 +- Filters/FlowPaths/vtkParticlePathFilter.h | 2 +- Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx | 4 ++-- Filters/ParallelDIY2/vtkExtractSubsetWithSeed.cxx | 2 +- IO/ADIOS2/Testing/Cxx/TestIOADIOS2VTX_VTI3DRendering.cxx | 2 +- IO/ADIOS2/VTX/common/VTXHelper.cxx | 2 +- IO/Cesium3DTiles/Testing/Cxx/TestCesium3DTilesWriter.cxx | 4 ++-- .../BoostGraphAlgorithms/vtkBoostBetweennessClustering.cxx | 2 +- Infovis/Core/vtkAdjacencyMatrixToEdgeTable.cxx | 2 +- Infovis/Core/vtkDotProductSimilarity.cxx | 4 ++-- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Common/Core/vtkSortDataArray.cxx b/Common/Core/vtkSortDataArray.cxx index 3d1edefb41d..007ef1e8f08 100644 --- a/Common/Core/vtkSortDataArray.cxx +++ b/Common/Core/vtkSortDataArray.cxx @@ -41,7 +41,7 @@ void vtkSortDataArray::Sort(vtkIdList* keys, int dir) } else { - vtkSMPTools::Sort(data, data + numKeys, std::greater<vtkIdType>()); + vtkSMPTools::Sort(data, data + numKeys, std::greater<>()); } } @@ -75,7 +75,7 @@ void vtkSortDataArray::Sort(vtkAbstractArray* keys, int dir) switch (keys->GetDataType()) { vtkExtendedTemplateMacro(vtkSMPTools::Sort( - static_cast<VTK_TT*>(data), static_cast<VTK_TT*>(data) + numKeys, std::greater<VTK_TT>())); + static_cast<VTK_TT*>(data), static_cast<VTK_TT*>(data) + numKeys, std::greater<>())); } } } diff --git a/Common/DataModel/vtkDataSetAttributesFieldList.cxx b/Common/DataModel/vtkDataSetAttributesFieldList.cxx index 11c3a7845c9..8d4bfe4899f 100644 --- a/Common/DataModel/vtkDataSetAttributesFieldList.cxx +++ b/Common/DataModel/vtkDataSetAttributesFieldList.cxx @@ -264,7 +264,7 @@ std::array<const detail::FieldInfo*, vtkDataSetAttributes::NUM_ATTRIBUTES> GetAt for (const auto& inattrs : finfo->AttributeTypes) { std::transform(accumulated_attrs.begin(), accumulated_attrs.end(), inattrs.begin(), - accumulated_attrs.begin(), std::logical_and<bool>()); + accumulated_attrs.begin(), std::logical_and<>()); } std::transform(attrs.begin(), attrs.end(), accumulated_attrs.begin(), attrs.begin(), diff --git a/Common/DataModel/vtkPolyhedron.cxx b/Common/DataModel/vtkPolyhedron.cxx index 082365c0106..5553c974622 100644 --- a/Common/DataModel/vtkPolyhedron.cxx +++ b/Common/DataModel/vtkPolyhedron.cxx @@ -2289,9 +2289,9 @@ void vtkPolyhedron::Clip(double value, vtkDataArray* pointScalars, std::function<bool(double, double)> c = [insideOut](double a, double b) { if (insideOut) - return std::less_equal<double>()(a, b); + return std::less_equal<>()(a, b); - return std::greater_equal<double>()(a, b); + return std::greater_equal<>()(a, b); }; bool all(true); diff --git a/Common/DataModel/vtkSphericalPointIterator.cxx b/Common/DataModel/vtkSphericalPointIterator.cxx index 9cc6e2d8273..8a2343522c8 100644 --- a/Common/DataModel/vtkSphericalPointIterator.cxx +++ b/Common/DataModel/vtkSphericalPointIterator.cxx @@ -154,7 +154,7 @@ struct vtkSphericalPointIterator::SphericalPointIterator } if (dir == vtkSphericalPointIterator::SORT_DESCENDING) { - std::sort(radialSort.begin(), radialSort.end(), std::greater<RadialTuple>()); + std::sort(radialSort.begin(), radialSort.end(), std::greater<>()); } else // ascending { diff --git a/Common/DataModel/vtkStaticCellLocator.cxx b/Common/DataModel/vtkStaticCellLocator.cxx index bad1b261de6..4296a1bdfb5 100644 --- a/Common/DataModel/vtkStaticCellLocator.cxx +++ b/Common/DataModel/vtkStaticCellLocator.cxx @@ -1013,7 +1013,7 @@ vtkIdType CellProcessor<T>::FindClosestPointWithinRadius(const double x[3], doub T numIds, j, cellId; using node = std::pair<double, vtkIdType>; - std::priority_queue<node, std::vector<node>, std::greater<node>> queue; + std::priority_queue<node, std::vector<node>, std::greater<>> queue; // first get ijk containing point vtkIdType binId = this->Binner->GetBinIndex(x); diff --git a/Filters/FlowPaths/vtkParticlePathFilter.h b/Filters/FlowPaths/vtkParticlePathFilter.h index d1ebed3c631..d21fbb49234 100644 --- a/Filters/FlowPaths/vtkParticlePathFilter.h +++ b/Filters/FlowPaths/vtkParticlePathFilter.h @@ -48,7 +48,7 @@ protected: private: vtkSmartPointer<vtkPointSet> Points; std::map<vtkIdType, std::vector<vtkIdType>> Paths; - std::priority_queue<vtkIdType, std::vector<vtkIdType>, std::greater<vtkIdType>> UnusedIndices; + std::priority_queue<vtkIdType, std::vector<vtkIdType>, std::greater<>> UnusedIndices; }; VTK_ABI_NAMESPACE_END diff --git a/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx b/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx index cdbdea29f94..afb83ae853b 100644 --- a/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx +++ b/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx @@ -449,7 +449,7 @@ bool vtkDIYKdTreeUtilities::GenerateGlobalCellIds(vtkPartitionedDataSet* parts, vtkIdType global_offset = 0; diy::mpi::communicator comm = vtkDIYUtilities::GetCommunicator(controller); - diy::mpi::scan(comm, total_local_cells, global_offset, std::plus<vtkIdType>()); + diy::mpi::scan(comm, total_local_cells, global_offset, std::plus<>()); // convert to exclusive scan since mpi_scan is inclusive. global_offset -= total_local_cells; @@ -460,7 +460,7 @@ bool vtkDIYKdTreeUtilities::GenerateGlobalCellIds(vtkPartitionedDataSet* parts, // need an Allreduce to get the offset for next time vtkIdType total_global_cells = 0; - diy::mpi::all_reduce(comm, total_local_cells, total_global_cells, std::plus<vtkIdType>()); + diy::mpi::all_reduce(comm, total_local_cells, total_global_cells, std::plus<>()); (*mb_offset) += total_global_cells; } diff --git a/Filters/ParallelDIY2/vtkExtractSubsetWithSeed.cxx b/Filters/ParallelDIY2/vtkExtractSubsetWithSeed.cxx index 44f37aec3ea..e1f10abcca2 100644 --- a/Filters/ParallelDIY2/vtkExtractSubsetWithSeed.cxx +++ b/Filters/ParallelDIY2/vtkExtractSubsetWithSeed.cxx @@ -588,7 +588,7 @@ int vtkExtractSubsetWithSeed::RequestData( cp.collectives()->clear(); const int has_seeds = static_cast<int>(!next_seeds.empty()); - cp.all_reduce(has_seeds, std::logical_or<int>()); + cp.all_reduce(has_seeds, std::logical_or<>()); }); vtkLogF(TRACE, "r=%d, exchange", round); master.exchange(); diff --git a/IO/ADIOS2/Testing/Cxx/TestIOADIOS2VTX_VTI3DRendering.cxx b/IO/ADIOS2/Testing/Cxx/TestIOADIOS2VTX_VTI3DRendering.cxx index 6be7c335b99..3b7ee24ed98 100644 --- a/IO/ADIOS2/Testing/Cxx/TestIOADIOS2VTX_VTI3DRendering.cxx +++ b/IO/ADIOS2/Testing/Cxx/TestIOADIOS2VTX_VTI3DRendering.cxx @@ -77,7 +77,7 @@ int MPIGetSize() std::size_t TotalElements(const std::vector<std::size_t>& dimensions) noexcept { - return std::accumulate(dimensions.begin(), dimensions.end(), 1, std::multiplies<std::size_t>()); + return std::accumulate(dimensions.begin(), dimensions.end(), 1, std::multiplies<>()); } void WriteBPFile3DVars(const std::string& fileName, const adios2::Dims& shape, diff --git a/IO/ADIOS2/VTX/common/VTXHelper.cxx b/IO/ADIOS2/VTX/common/VTXHelper.cxx index befb57c70af..8716972680a 100644 --- a/IO/ADIOS2/VTX/common/VTXHelper.cxx +++ b/IO/ADIOS2/VTX/common/VTXHelper.cxx @@ -284,7 +284,7 @@ std::string SetToCSV(const std::set<std::string>& input) noexcept std::size_t TotalElements(const std::vector<std::size_t>& dimensions) noexcept { - return std::accumulate(dimensions.begin(), dimensions.end(), 1, std::multiplies<std::size_t>()); + return std::accumulate(dimensions.begin(), dimensions.end(), 1, std::multiplies<>()); } adios2::Box<adios2::Dims> PartitionCart1D(const adios2::Dims& shape) diff --git a/IO/Cesium3DTiles/Testing/Cxx/TestCesium3DTilesWriter.cxx b/IO/Cesium3DTiles/Testing/Cxx/TestCesium3DTilesWriter.cxx index 4340b0aa41b..e174b6e4ae0 100644 --- a/IO/Cesium3DTiles/Testing/Cxx/TestCesium3DTilesWriter.cxx +++ b/IO/Cesium3DTiles/Testing/Cxx/TestCesium3DTilesWriter.cxx @@ -266,8 +266,8 @@ vtkSmartPointer<vtkMultiBlockDataSet> tiler(const std::vector<std::string>& inpu polyData->GetPointData()->SetScalars(rgb); } } - std::transform(fileOffset.begin(), fileOffset.end(), inputOffset.begin(), fileOffset.begin(), - std::plus<double>()); + std::transform( + fileOffset.begin(), fileOffset.end(), inputOffset.begin(), fileOffset.begin(), std::plus<>()); std::string textureBaseDirectory = SystemTools::GetFilenamePath(files[0]); vtkNew<vtkCesium3DTilesWriter> writer; diff --git a/Infovis/BoostGraphAlgorithms/vtkBoostBetweennessClustering.cxx b/Infovis/BoostGraphAlgorithms/vtkBoostBetweennessClustering.cxx index 8314cb11655..cf378c868e4 100644 --- a/Infovis/BoostGraphAlgorithms/vtkBoostBetweennessClustering.cxx +++ b/Infovis/BoostGraphAlgorithms/vtkBoostBetweennessClustering.cxx @@ -69,7 +69,7 @@ void betweenness_centrality_clustering(MutableGraph& g, Done done, return; // Function object that compares the centrality of edges - indirect_cmp<EdgeCentralityMap, std::less<centrality_type>> cmp(edge_centrality); + indirect_cmp<EdgeCentralityMap, std::less<>> cmp(edge_centrality); bool is_done; do diff --git a/Infovis/Core/vtkAdjacencyMatrixToEdgeTable.cxx b/Infovis/Core/vtkAdjacencyMatrixToEdgeTable.cxx index 886d21235e2..72569761023 100644 --- a/Infovis/Core/vtkAdjacencyMatrixToEdgeTable.cxx +++ b/Infovis/Core/vtkAdjacencyMatrixToEdgeTable.cxx @@ -118,7 +118,7 @@ int vtkAdjacencyMatrixToEdgeTable::RequestData( coordinates[source_dimension] = i; // Create a sorted list of source values ... - typedef std::multimap<double, vtkIdType, std::greater<double>> sorted_values_t; + typedef std::multimap<double, vtkIdType, std::greater<>> sorted_values_t; sorted_values_t sorted_values; for (vtkIdType j = input_extents[target_dimension].GetBegin(); j != input_extents[target_dimension].GetEnd(); ++j) diff --git a/Infovis/Core/vtkDotProductSimilarity.cxx b/Infovis/Core/vtkDotProductSimilarity.cxx index ce19935fc69..a93f4b14973 100644 --- a/Infovis/Core/vtkDotProductSimilarity.cxx +++ b/Infovis/Core/vtkDotProductSimilarity.cxx @@ -30,9 +30,9 @@ VTK_ABI_NAMESPACE_BEGIN template <typename KeyT, typename ValueT> -class threshold_multimap : public std::multimap<KeyT, ValueT, std::less<KeyT>> +class threshold_multimap : public std::multimap<KeyT, ValueT, std::less<>> { - typedef std::multimap<KeyT, ValueT, std::less<KeyT>> container_t; + typedef std::multimap<KeyT, ValueT, std::less<>> container_t; public: threshold_multimap(KeyT minimum_threshold, size_t minimum_count, size_t maximum_count) -- GitLab