C++17 feature proposal: Allow std::data, std::size, std::empty

瀏覽次數:85 次
跳到第一則未讀訊息

Daniel Cheng

未讀,
2022年1月6日 下午4:12:472022/1/6
收件者:cxx
We already have our own backported versions of std::data and std::size; let's remove them and replace them with the standard version. We don't have a std::empty, but allowing it alongside the other two makes sense to me.

Daniel

Jeremy Roman

未讀,
2022年1月6日 下午4:21:312022/1/6
收件者:Daniel Cheng、cxx
We do have base::empty. More generally I think anything from cxx17_backports.h should likely move to the genuine article. :)

On Thu, Jan 6, 2022 at 4:12 PM Daniel Cheng <dch...@chromium.org> wrote:
We already have our own backported versions of std::data and std::size; let's remove them and replace them with the standard version. We don't have a std::empty, but allowing it alongside the other two makes sense to me.

Daniel

--
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/CAF3XrKq8-MC9uPQQZ0w37tBsO0TjrS0%2BgL-VoUM%3DTsnQjaEXvg%40mail.gmail.com.

Avi Drissman

未讀,
2022年1月6日 下午4:26:132022/1/6
收件者:Jeremy Roman、Daniel Cheng、cxx
Strong concerns for the general statement about cxx17_backports. The items in that file should be addressed one at a time to ensure we don't backslide on undefined behavior (looking at base::clamp specifically).

+1 for migrating our versions to std for the specific functions std::data, std::size, std::empty.

Lei Zhang

未讀,
2022年1月6日 下午4:27:082022/1/6
收件者:Avi Drissman、Jeremy Roman、Daniel Cheng、cxx

Peter Kasting

未讀,
2022年1月6日 下午4:43:332022/1/6
收件者:Avi Drissman、Jeremy Roman、Daniel Cheng、cxx

Daniel Cheng

未讀,
2022年1月6日 下午4:47:072022/1/6
收件者:Avi Drissman、Jeremy Roman、cxx
Agreed: I saw the CHECK() in base::clamp() and that's why I specifically didn't broaden this proposal to include all of them. And if we exclude base::clamp(), then lumping in other random functions into this proposal seemed a bit too random.

Daniel

Peter Kasting

未讀,
2022年2月21日 晚上11:09:322022/2/21
收件者:Daniel Cheng、cxx
It looks like we had agreement to do the narrow change here, but this didn't land?

PK

On Thu, Jan 6, 2022 at 1:12 PM Daniel Cheng <dch...@chromium.org> wrote:
We already have our own backported versions of std::data and std::size; let's remove them and replace them with the standard version. We don't have a std::empty, but allowing it alongside the other two makes sense to me.

Daniel

--

Daniel Cheng

未讀,
2022年2月22日 凌晨1:39:272022/2/22
收件者:Peter Kasting、cxx
Let me create a bug here. I think I was planning on doing this in one atomic CL, but given the variants, it's probably better to stage this one out into multiple CLs. I'll send a CL to update the wording though.

Daniel

Daniel Cheng

未讀,
2022年3月7日 下午6:58:242022/3/7
收件者:Peter Kasting、cxx
This should be done now. I need to clean up a few header files, but it looks like the last change to delete base::{data,empty,size} isn't going to get reverted. Thanks to thestig@ for all the reviews!

Daniel

Lei Zhang

未讀,
2022年3月7日 下午6:59:312022/3/7
收件者:Daniel Cheng、Peter Kasting、cxx
回覆所有人
回覆作者
轉寄
0 則新訊息