Skip to content

Commit db53a83

Browse files
committed
Make our use of isspace more robust
We had some users of a modified libMesh who saw the existing code break here - their fault for bringing in a 3rd party header with `using namespace std` and thereby making `isspace` ambiguous, but the workaround is easy enough.
1 parent 8049421 commit db53a83

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/mesh/unv_io.C

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include <iomanip>
4242
#include <algorithm> // for std::sort
4343
#include <fstream>
44-
#include <ctype.h> // isspace
44+
#include <cctype> // isspace
4545
#include <sstream> // std::istringstream
4646
#include <unordered_map>
4747

@@ -156,7 +156,8 @@ void UNVIO::read_implementation (std::istream & in_stream)
156156
// UNV files always have some amount of leading
157157
// whitespace, let's not rely on exactly how much... This
158158
// command deletes it.
159-
current_line.erase(std::remove_if(current_line.begin(), current_line.end(), isspace),
159+
current_line.erase(std::remove_if(current_line.begin(), current_line.end(),
160+
[](unsigned char const c){return std::isspace(c);}),
160161
current_line.end());
161162

162163
// Parse the nodes section

0 commit comments

Comments
 (0)