Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenMesh
OpenMesh
Commits
0441ba5f
Commit
0441ba5f
authored
Apr 18, 2018
by
Jan Möbius
Browse files
Work around ptr_fun deprecation (Thanks to Andreas Fabri for the patch)
parent
d563cdac
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenMesh/Core/IO/reader/BaseReader.hh
View file @
0441ba5f
...
...
@@ -156,7 +156,16 @@ protected:
* @return trimmed string
*/
static
inline
std
::
string
&
left_trim
(
std
::
string
&
_string
)
{
_string
.
erase
(
_string
.
begin
(),
std
::
find_if
(
_string
.
begin
(),
_string
.
end
(),
std
::
not1
(
std
::
ptr_fun
<
int
,
int
>
(
std
::
isspace
))));
// Find out if the compiler supports CXX11
#if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L )
// as with CXX11 we can use lambda expressions
_string
.
erase
(
_string
.
begin
(),
std
::
find_if
(
_string
.
begin
(),
_string
.
end
(),
[](
int
i
)
->
int
{
return
!
std
::
isspace
(
i
);
}));
#else
// we do what we did before
_string
.
erase
(
_string
.
begin
(),
std
::
find_if
(
_string
.
begin
(),
_string
.
end
(),
std
::
not1
(
std
::
ptr_fun
<
int
,
int
>
(
std
::
isspace
))));
#endif
return
_string
;
}
...
...
@@ -168,7 +177,19 @@ static inline std::string &left_trim(std::string &_string) {
* @return trimmed string
*/
static
inline
std
::
string
&
right_trim
(
std
::
string
&
_string
)
{
_string
.
erase
(
std
::
find_if
(
_string
.
rbegin
(),
_string
.
rend
(),
std
::
not1
(
std
::
ptr_fun
<
int
,
int
>
(
std
::
isspace
))).
base
(),
_string
.
end
());
#error "Apply the same fix here"
// Find out if the compiler supports CXX11
#if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L )
// as with CXX11 we can use lambda expressions
_string
.
erase
(
std
::
find_if
(
_string
.
rbegin
(),
_string
.
rend
(),
[](
int
i
)
->
int
{
return
!
std
::
isspace
(
i
);
}
).
base
(),
_string
.
end
());
#else
// we do what we did before
_string
.
erase
(
std
::
find_if
(
_string
.
rbegin
(),
_string
.
rend
(),
std
::
not1
(
std
::
ptr_fun
<
int
,
int
>
(
std
::
isspace
))).
base
(),
_string
.
end
());
#endif
return
_string
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment