Subject: CGAL users discussion list
List archive
- From: Ahmed Essam <>
- To:
- Subject: Re: [cgal-discuss] result_of deprecation from c++20 workaround (PR #3846)
- Date: Fri, 28 Feb 2020 21:09:27 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:LThX5BMcTSfIFKJE5x0l6mtUPXoX/o7sNwtQ0KIMzox0I/T/rarrMEGX3/hxlliBBdydt6sYzbuG+Pm6ASQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vIxi6twHcu8oZjYd/NKo91gbCr2dVdehR2W5nKlWfkgrm6Myt5pBj6SNQu/wg985ET6r3erkzQKJbAjo7LW07/dXnuhbfQwSB4HscSXgWnQFTAwfZ9hH6X4z+vTX8u+FgxSSVJ8z2TbQzWTS/86dmTQLjhSkbOzIl9mzcl8p9h79Zrh28vRxy24HbYI+XO/R+cK3Tfs4US3RdUctKTSNNHpmxYpETA+YdP+tVqZT2qVsUrRu5AAmhHP/iyj9NhnDowKIxzusvERrd3AM6GtIFrXPZrMn1NKgMS++11rXIzTveb/NSwzvy8pbHfwsuofGJR71wcM7RxVMzGAPCi1WdsIroNC6b2OQKtmiU9etgVeS3hm4oqgFxvjivxto3hYXTmo0VzVXE+T18wIY0OdK4Ukl7YcWjEJteqyGWLZd5QsQnQ21wuSY6zKcGuZ+hcyQQxpQn3RjSYOGEfYiQ+h/vSvqdLDNiiH9meL+znQu+/Vajx+HmVsS4zFBHpTdfnNbWrHACzRnT59CHSvRj+keh3i6C1wXJ5eFFJUA4jKTaK5s8zrIpmJoesVjPEjX5mEXxi6+WeUEk9fay5+v7ZbXmo4eQN45yig7gLqQjgtKzDfg8PwQUXGWW+f6w2KD98UD6WrlHjuE6nrHcsJ/AJMQboqC5AxVS0oYm8xu/Ezem38oCknkdMFJFdg+Hj4zzN17UPv/1Fvi/g1G2nzdqw/DKJKHuApLILnTbirfuYa5961JAyAo01d1Q+51UBasFIP7qR0DxtcfYAQMkMwyv2ObqE85914MbWWKXGKCVKqLSsVmS5uIuOeaAfoEVuCyuY8Uj/OPk2H8lhUcGL+7uxooScHn+H/J8Ikzfb2CrmcYECW5NvwwwS6vhh1SGFDJSfH2vRLlv2zcgFYiGEYLHE4CxnKSajmD8BYxTfmkAC1aWEH6ueZ/DQOYJcCvVI8lvlXsPWrGlDoMgzhqzrxSp9rx8M+Do9z0E4JL/yMButaqUjgA37TUyDsKH0mjLQXszhXINXzZx3aZxpgt2xV6HlKR5mPdFDscA2/QcWQgzMdvQzvdxFsvpcgPHZNaADli8Efu8BjRkZ9I0ztNGTl1mEtDq2gzD0iOwH7EIk/qCCbQ796vd2z76IMMrmCWO77Uok1RzGpgHDmahnKMqr1GOVb6MqF2QkuORTYpZ3CPJ8z3en2+HvUUdTwspFKuYBTYQYUzZqdm/7UTHHef3VeYXdzBZwMvHEZNkL8XzhAwfFvjmMdXaJWm2njXoXEfa9va3dIPvPl4l8mDYAUkAnRoU+C/fZwc7Dyal5WnZCW43GA==
Thanks for the reply.
I was reading through the mailing list and found this by the author of the PR on Feb 26
> To get started you can try to fix that PR:
> https://github.com/CGAL/cgal/pull/4238
>
> And then that one where the goal was to remove the usage
> of the old boost::tr1::result_of and replace it by std::result_of:
> https://github.com/CGAL/cgal/pull/3846
>
> You'll get bonus points if you find a solution to handle the
> depreciation of std::result_of in c++20.
>
> Best,
>
> Sebastien.
> https://github.com/CGAL/cgal/pull/4238
>
> And then that one where the goal was to remove the usage
> of the old boost::tr1::result_of and replace it by std::result_of:
> https://github.com/CGAL/cgal/pull/3846
>
> You'll get bonus points if you find a solution to handle the
> depreciation of std::result_of in c++20.
>
> Best,
>
> Sebastien.
If backward compatibility is the case, this solution should work with c++11 and c++20.
But indeed I agree. It would be better all of `result_of` are replaced by `delctype(auto)`. It's simpler and cleaner.
Thanks,
Ahmed Essam.
On Fri, 28 Feb 2020, Ahmed Essam wrote:
> Hi all,
>
> I'm Ahmed Essam, and I'm interested in applying for GSoC with you this year.
>
> Regarding PR #3846 <https://github.com/CGAL/cgal/pull/3846>. As I
> understand it, the main blocker is the deprecation of `std::result_of` from
> C++20 in favor of `std::invoke_result`. I think there is a workaround that
> would work with both C++11 and C++20 when the removal happens. The main
> idea comes from this blogpost
> https://devblogs.microsoft.com/oldnewthing/20190710-00/?p=102678.
> We will use SFINAE to choose `std::invoke_of` if available, otherwise,
> choose `std::result_of`. I'm not sure is the mapping of the functionalities
> here covers all cases, but I think it's worth trying. Please find the code
> snippet below:
>
> https://gist.github.com/theartful/3dd554239743b4489b2356058f12a432
>
> If you think this might work, I can make a PR for it.
The PR you mention mostly solves the issue by using neither result_of nor
invoke_result. CGAL only started using result_of because decltype(auto)
didn't exist at the time.
I don't think sfinae code to detect result_of/invoke_of would help much,
we can use __cpp_lib_is_invocable. But we should first remove most uses of
result_of, and only then see if it makes sense to keep the few remaining
ones as is, with a version of result_of that forwards to invoke_result, or
if using decltype or some other constructs to remove result_of would be
better.
(of course this is just my opinion, others may see things differently)
--
Marc Glisse
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [cgal-discuss] result_of deprecation from c++20 workaround (PR #3846), Ahmed Essam, 02/28/2020
- Re: [cgal-discuss] result_of deprecation from c++20 workaround (PR #3846), Marc Glisse, 02/28/2020
- Re: [cgal-discuss] result_of deprecation from c++20 workaround (PR #3846), Ahmed Essam, 02/28/2020
- Re: [cgal-discuss] result_of deprecation from c++20 workaround (PR #3846), Marc Glisse, 02/28/2020
Archive powered by MHonArc 2.6.18.