From bb41af61b1d9d6fb07ed377ac360f23fb1e50cea Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 11 Nov 2024 09:20:36 -0500 Subject: [PATCH] COMP: Avoid re-init of ostringstream in ThresholdImageFilterTest This is to work around build failures on Intel macOS: > Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx:79:8: error: no viable overloaded '=' os = {}; ~~ ^ ~~ Also, it is more efficient to clear the std::ostringstream object using os.str(""); rather than reinitializing it. This avoids unnecessary reallocation and keeps the code cleaner. --- .../Thresholding/test/itkThresholdImageFilterTest.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx index 864d91c166e..3ca7935e07c 100644 --- a/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx @@ -76,7 +76,7 @@ itkThresholdImageFilterTest(int, char *[]) std::ostringstream os; os << "Filter: " << threshold.GetPointer(); itk::OutputWindowDisplayText(os.str().c_str()); - os = {}; + os.str(""); os << "Output #0: " << threshold->GetOutput(0); itk::OutputWindowDisplayText(os.str().c_str()); @@ -97,7 +97,7 @@ itkThresholdImageFilterTest(int, char *[]) std::ostringstream os; os << "Filter: " << threshold.GetPointer(); itk::OutputWindowDisplayText(os.str().c_str()); - os = {}; + os.str(""); os << "Output #0: " << threshold->GetOutput(0); itk::OutputWindowDisplayText(os.str().c_str()); @@ -120,7 +120,7 @@ itkThresholdImageFilterTest(int, char *[]) std::ostringstream os; os << "Filter: " << threshold.GetPointer(); itk::OutputWindowDisplayText(os.str().c_str()); - os = {}; + os.str(""); os << "Output #0: " << threshold->GetOutput(0); itk::OutputWindowDisplayText(os.str().c_str());