Summary: | std::binder2nd deprecated warnings with C++11 | ||||||
---|---|---|---|---|---|---|---|
Product: | Eigen | Reporter: | Johannis Bauer <digitalriptide> | ||||
Component: | General | Assignee: | Nobody <eigen.nobody> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Compilation Problem | CC: | chtz, gael.guennebaud, jacob.benoit.1, jagerman, redpony, sendsbeak | ||||
Priority: | Normal | ||||||
Version: | 3.3 (current stable) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Bug Depends on: | |||||||
Bug Blocks: | 97, 558 | ||||||
Attachments: |
|
Description
Johannis Bauer
2014-09-03 22:27:27 UTC
These also arise when compiling with clang. Eventually, we'll need to replace these by custom functors anyways if we want to use vectorized comparisons (Bug 97) Created attachment 572 [details] Replacing binder1st/binder2nd usage by custom functors In the attached patch I replaced all usages of binder1st/binder2nd by custom functors which are then called with Array::Constant(...) as second object. Furthermore, operator< and operator> have the same return type (with swapped arguments now (the same for <=, >=). Probably the names can be chosen differently and some boiler-plate code can be hidden inside macros. The functors also don't provide packet-functionality, yet (Bug 97). Thank you for the patch, the introduction of an enum ComparisonName seems to be a bit overkill, and perhaps it would have been simpler to keep the std::* functors for now as the real fix here consists in using Constant instead of bind (as this is already the case for min/max and perhaps others) but this is preparing bug 97, so ok. Pushed here (after hiding boiler plate code into macros): https://bitbucket.org/eigen/eigen/commits/3b1a6b9870 The whole ComparisonName stuff is indeed not necessary for this, but as mentioned, this prepares resolving Bug 97. Just happened to see this push. Unfortunately, it doesn't fix all the deprecation warnings with C++11 and g++-5.1.0: /home/chris/neweig/eigen/Eigen/src/SparseCore/../plugins/MatrixCwiseUnaryOps.h:17:27: warning: ‘template<class _Operation> class std::binder1st’ is deprecated [-Wdeprecated-declarations] typedef CwiseUnaryOp<std::binder1st<std::equal_to<Scalar> >, const Derived> CwiseScalarEqualReturnType; Hm, right. Probably this requires unary functors after all. Fixed: https://bitbucket.org/eigen/eigen/commits/4930262d1c7a/ and manually backported: https://bitbucket.org/eigen/eigen/commits/2e22e990dedf/ I'm still getting these warnings in 3.2.5, but not on the devel branch. The 3.2 branch apparently also needs this change backported: https://bitbucket.org/eigen/eigen/commits/ff283951217/ to avoid: /home/jagerman/research/fracdist/eigen3/Eigen/src/Core/Functors.h:973:28: warning: ‘template<class _Operation> class std::binder2nd’ is deprecated [-Wdeprecated-declarations] struct functor_traits<std::binder2nd<T> > ^ -- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/872. |