| Summary: | o3tl: replace depreciated unary_function and binary_function | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Daniel L Robertson <danlrobertson89> |
| Component: | LibreOffice | Assignee: | Daniel L Robertson <danlrobertson89> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | danlrobertson89, h3734236, robinson.libreoffice, thb |
| Priority: | medium | Keywords: | difficultyBeginner, easyHack, skillCpp, topicCleanup |
| Version: | unspecified | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | target:5.1.0 | ||
| Crash report or crash signature: | Regression By: | ||
|
Description
Daniel L Robertson
2015-06-30 15:26:01 UTC
I have begun to work on this, and have assigned this to myself. danlrobertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5a61d7f049a81d6e747d9d097f364ae45f58697b tdf#92459 replace unary_function in forms It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=1a5e176e626d70d19abe4ad6e3b5c8d54a7badd7 tdf#92459 Replace select1st for lambda expressions It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5916d5866c109b17471a9c8604635612a0aa69ae tdf#92459 replace deprecated o3tl features It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=717b23ef2765678a5598d652956edd77d2d62fc5 tdf#92459 replace deprecated o3tl features It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4ce10ff6ce725212efa91a017a61e1bd781008c1 tdf#92459 remove compat_functional from extensions It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. (In reply to Commit Notification from comment #6) > Daniel Robertson committed a patch related to this issue. > Looking at some of the changes, and the amount of select1st/select2nd still there - would perhaps retaining a generic version of those, and their usage instead of individual lambda functions, be somtimes easier to the eye of a casual code reader? select1st is a pretty descriptive name (if not nested deep inside a bind expression, of course). > would perhaps retaining a generic version of those, and their usage instead of individual lambda functions, be somtimes easier to the eye of a casual code reader? Honestly, I still consider myself to be a noobie with libreoffice, so I trust you. If you think it is better to keep select1st/2nd, I'm 100% okay with that. However, the main reasons why I started working on this was not entirely to improve readability, however in many cases it does. The main reason why I started, was to try to remove unary_function/binary_function from libreoffice (select1st/2nd are derived from unary_function), as they are deprecated since c++11. I also wanted to work on a very simple bug to get used to contributing to libreoffice. In addition, if select1st/2nd are removed, after #91112 is resolved o3tl/compat_functional can be completely removed. > the amount of select1st/select2nd still there. If I'm not mistaken, if the following get merged, select1st/2nd should be completely removed. https://gerrit.libreoffice.org/#/c/17586/ https://gerrit.libreoffice.org/#/c/17588/ https://gerrit.libreoffice.org/#/c/17589/ Again, constructive criticism is welcome :-) (In reply to Daniel L Robertson from comment #8) > > would perhaps retaining a generic version of those, and their usage instead of individual lambda functions, be somtimes easier to the eye of a casual code reader? > > Honestly, I still consider myself to be a noobie with libreoffice, so I > trust you. If you think it is better to keep select1st/2nd, I'm 100% okay > with that. > I think it's more self-documenting to have code like std::algo( in, out, select1st< type::subtype >() ); rather than std::algo( in, out, []( const ::std::pair<bla,fasl>& in ) { return in.first} ); A reader of the code will have much more to parse, and mentally typecheck, to figure out what the 2nd version is doing. That said - from the patches you did, quite a number of them IMO *did* become simpler with an overall lambda, than they were before with some nested function templates. > However, the main reasons why I started working on this was not > entirely to improve readability, however in many cases it does. The main > reason why I started, was to try to remove unary_function/binary_function > from libreoffice (select1st/2nd are derived from unary_function), as they > are deprecated since c++11. > Sure, this is much appreciated! Though the they don't *have* to be derived from unary/binary_function. > In addition, if select1st/2nd are removed, after #91112 is resolved > o3tl/compat_functional can be completely removed. > So how about moving some trimmed-down version of select1st/2nd then to o3tl/functional.hxx? It's not about compatibility then anymore, but for sharing some 20-odd cases of the same pattern. > Sure, this is much appreciated! Though the they don't *have* to be derived from > unary/binary_function. So simple, but I never thought of that. After I looked at select1st/2nd, I noticed they were only intended to be used for pair's, so I uploaded the following patch which does the same thing without being derived from unary_function and using std::pair's typedefs (first_type && second_type). https://gerrit.libreoffice.org/#/c/17625/ Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=647b5aecd4c3facc302df33386451dda732aab98 tdf#92459 remove compat_functional from canvas It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f6595f0b3389ffeefa10035d915a884b02d26c0e tdf#92459 remove o3tl/compat_functional.hxx It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ae6afadbc0c6ffcdbfd0db6bb3b0166295d5effd tdf#92459 o3tl: remove unary_function It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=87130a4e18347d055331ff53da3b1a79548ff24a tdf#92459 Cleanup unclear lambdas It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Daniel Robertson committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3babca3e849e1cb42225ca1c26e8f6156ad153e6 tdf#92459 basebmp: replace project2nd It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. With the last commit, this is resolved Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp TopicCleanup ) [NinjaEdit] |