--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/3022d702-5586-4620-94e0-7ec2113f4d7fn%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/72ff36cb-c2f9-46d9-941b-b2ab1f3f4f38n%40chromium.org.
Roland Bock
Software Engineering Manager
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
The above terms reflect a potential business arrangement, are provided solely as a basis for further discussion, and are not intended to be and do not constitute a legally binding obligation. No legally binding obligations will be created, implied, or inferred until an agreement in final form is executed in writing by all parties involved.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHq1K7Rf-Ty-M7CgG8xs06qqtTk5PcezUZzArEViJ1u3uk%2BGcg%40mail.gmail.com.
Since communicating non-nullability in the type is nice, would that mean preferring T& up the call stack and assigning that as a *ABSL_DIE_IF_NULL(ptr) high up the stack, use pointers with annotation or just keep ptrs without annotation here?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAGFX3sEsNhL_Yy1yL7ba%3D-cxnKMCnpScxJQawsihZdNjyofuhg%40mail.gmail.com.
I like this idea, thanks for doing this. I will take a stab at introducing CHECK_DEREF during the bugbash next week.On Fri, Oct 21, 2022 at 12:20 AM Peter Boström <pb...@chromium.org> wrote:I put up base::raw_ref_from_ptr() as crrev.com/c/3969541, I'd like more opinions on whether it should be landed. I think it makes sense to use a from_ptr() when assigning directly to a raw_ref, and CHECK_DEREF(ptr) would make more sense when storing it in an intermediate T&.
On Fri, Oct 21, 2022 at 9:12 AM Jeroen Dhollander <jero...@google.com> wrote:I like this idea, thanks for doing this. I will take a stab at introducing CHECK_DEREF during the bugbash next week.On Fri, Oct 21, 2022 at 12:20 AM Peter Boström <pb...@chromium.org> wrote:I put up base::raw_ref_from_ptr() as crrev.com/c/3969541, I'd like more opinions on whether it should be landed. I think it makes sense to use a from_ptr() when assigning directly to a raw_ref, and CHECK_DEREF(ptr) would make more sense when storing it in an intermediate T&.Just for completeness, we could also do something likeALWAYS_INLINE explicit raw_ref(T* ptr) noexcept : inner_(ptr) { CHECK(ptr); }See crrev.com/c/3971161: I used the same pet example as Peter. The resulting code is even shorter, but of course not as explicit as Peter's suggestion.