Skip to content

Commit

Permalink
COMP: Avoid re-init of ostringstream in ThresholdImageFilterTest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thewtex committed Nov 11, 2024
1 parent 70df21d commit bb41af6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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());

Expand All @@ -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());

Expand Down

0 comments on commit bb41af6

Please sign in to comment.