Skip to content

rm std::ptr_fun for gcc12 compliance#14

Open
APN-Pucky wants to merge 1 commit intoAmadeusITGroup:masterfrom
APN-Pucky:gcc12
Open

rm std::ptr_fun for gcc12 compliance#14
APN-Pucky wants to merge 1 commit intoAmadeusITGroup:masterfrom
APN-Pucky:gcc12

Conversation

@APN-Pucky
Copy link

This fixes following error (cf. https://stackoverflow.com/a/217605):

src/utils/utils.h: In function ‘std::string& ltrim(std::string&)’:
src/utils/utils.h:205:87: error: ‘std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]’ is deprecated: use 'std::function' instead [-Werror=deprecated-declarations]
  205 | s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
      |                                                               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

[...]

/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_function.h:1126:5: note: declared here
 1126 |     ptr_fun(_Result (*__x)(_Arg))
      |     ^~~~~~~
src/utils/utils.h: In function ‘std::string& rtrim(std::string&)’:
src/utils/utils.h:211:78: error: ‘std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]’ is deprecated: use 'std::function' instead [-Werror=deprecated-declarations]
  211 |   s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant