Proposal: Allow std::apply and replace base::apply with it

閲覧: 23 回
最初の未読メッセージにスキップ

Peter Kasting

未読、
2022/09/09 11:52:332022/09/09
To: cxx
We currently have one non-test use of base::apply, a backport of C++17's std::apply.

There's nothing special about the base:: implementation (no extra CHECKs or anything).  I propose to eliminate it and call std::apply in the lone caller, and move std::apply to the "allowed" section of our docs.

(Incidentally, I looked at std::invoke too, which has a base::invoke counterpart.  But base::invoke is constexpr, which std::invoke is not in C++17 [it is in C++20], so I think the right thing to do there is to leave it TBD until we have C++20 and then convert.)

PK

K. Moon

未読、
2022/09/09 12:08:252022/09/09
To: Peter Kasting、cxx
SGTM

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCQ0qSCKDuE7WkcibcgLYG8kV1XW9pKcADBmd9v4Dt6%2Bg%40mail.gmail.com.

dan...@chromium.org

未読、
2022/09/09 12:32:252022/09/09
To: Peter Kasting、cxx
On Fri, Sep 9, 2022 at 11:52 AM 'Peter Kasting' via cxx <c...@chromium.org> wrote:
We currently have one non-test use of base::apply, a backport of C++17's std::apply.

There's nothing special about the base:: implementation (no extra CHECKs or anything).  I propose to eliminate it and call std::apply in the lone caller, and move std::apply to the "allowed" section of our docs.

LGTM
 

(Incidentally, I looked at std::invoke too, which has a base::invoke counterpart.  But base::invoke is constexpr, which std::invoke is not in C++17 [it is in C++20], so I think the right thing to do there is to leave it TBD until we have C++20 and then convert.)

Sounds like it should live in cxx20_backports.h then

Daniel Cheng

未読、
2022/09/09 12:44:082022/09/09
To: dan...@chromium.org、Peter Kasting、cxx

Peter Kasting

未読、
2022/09/09 13:59:582022/09/09
To: cxx
全員に返信
投稿者に返信
転送
新着メール 0 件