Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptr_func and unary_function need to be removed for compatibility with c++ > 14 #36

Closed
fbergmann opened this issue Aug 10, 2020 · 3 comments · Fixed by #128
Closed

ptr_func and unary_function need to be removed for compatibility with c++ > 14 #36

fbergmann opened this issue Aug 10, 2020 · 3 comments · Fixed by #128

Comments

@fbergmann
Copy link
Member

The conda build logs marked ptr_func as deprecated. So we should add detection of c++17, and if it is detected use a lambda instead. Here the warning:

2020-08-10T08:25:14.6208170Z   /tmp/pip-req-build-q_svt3q_/libsbml_source/src/sbml/packages/comp/util/SBMLUri.cpp:157:5: warning: 'ptr_fun<int, int>' is deprecated [-Wdeprecated-declarations]
2020-08-10T08:25:14.6210590Z       ptr_fun<int,int>(tolower)); // scheme is icase
2020-08-10T08:25:14.6211440Z       ^
2020-08-10T08:25:14.6212860Z   /usr/local/miniconda/conda-bld/python-libsbml_1597047524118/_build_env/bin/../include/c++/v1/functional:1107:1: note: 'ptr_fun<int, int>' has been explicitly marked deprecated here
2020-08-10T08:25:14.6213640Z   _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
2020-08-10T08:25:14.6214530Z   ^
2020-08-10T08:25:14.6215740Z   /usr/local/miniconda/conda-bld/python-libsbml_1597047524118/_build_env/bin/../include/c++/v1/__config:972:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
2020-08-10T08:25:14.6216480Z   #  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
2020-08-10T08:25:14.6216890Z                                         ^
2020-08-10T08:25:14.6218130Z   /usr/local/miniconda/conda-bld/python-libsbml_1597047524118/_build_env/bin/../include/c++/v1/__config:961:48: note: expanded from macro '_LIBCPP_DEPRECATED'
2020-08-10T08:25:14.6218880Z   #    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
2020-08-10T08:25:14.6219280Z                                                  ^
2020-08-10T08:25:14.6258400Z   /tmp/pip-req-build-q_svt3q_/libsbml_source/src/sbml/packages/comp/util/SBMLUri.cpp:198:6: warning: 'ptr_fun<int, int>' is deprecated [-Wdeprecated-declarations]
2020-08-10T08:25:14.6259640Z        ptr_fun<int,int>(tolower)); // host is icase
2020-08-10T08:25:14.6260290Z        ^
2020-08-10T08:25:14.6262420Z   /usr/local/miniconda/conda-bld/python-libsbml_1597047524118/_build_env/bin/../include/c++/v1/functional:1107:1: note: 'ptr_fun<int, int>' has been explicitly marked deprecated here
2020-08-10T08:25:14.6263460Z   _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
2020-08-10T08:25:14.6264090Z   ^
2020-08-10T08:25:14.6266030Z   /usr/local/miniconda/conda-bld/python-libsbml_1597047524118/_build_env/bin/../include/c++/v1/__config:972:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
2020-08-10T08:25:14.6266940Z   #  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
2020-08-10T08:25:14.6267440Z                                         ^
2020-08-10T08:25:14.6268660Z   /usr/local/miniconda/conda-bld/python-libsbml_1597047524118/_build_env/bin/../include/c++/v1/__config:961:48: note: expanded from macro '_LIBCPP_DEPRECATED'
2020-08-10T08:25:14.6269410Z   #    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
2020-08-10T08:25:14.6269890Z                                                  ^
2020-08-10T08:25:15.1972140Z   2 warnings generated.
@otronarp
Copy link

There is also a lot of use of std::unary_function and that one was also removed in c++17.

@otronarp
Copy link

There is also a lot of use of std::unary_function and that one was also removed in c++17.

The use of std::unary_function is actually worse since that's in the header files so it spill over on client code. Meaning that if you use libsbml you are stuck at using c++14.

@fbergmann fbergmann changed the title replacement for ptr_func needed ptr_func and unary_function need to be removed for compatibility with c++ > 14 Jan 26, 2021
@fbergmann
Copy link
Member Author

agreed, i'm doing some testing right now on what compilers it is actually needed, but it seems to compile fine even on older versions of g++ / msvc without it

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 a pull request may close this issue.

2 participants