--
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/CAAHOzFDsJMQWbQO-iYWz4tooXzcY%2BFK34Eajsavg5KwAPmNq7g%40mail.gmail.com.
Makes sense to me. Do we know whether there are any API differences? (They would hopefully be minor but it wouldn't surprise me if base::Optional has grown non-standard bits at some point.)
--On Wed, Apr 14, 2021 at 1:44 PM 'Peter Kasting' via cxx <c...@chromium.org> wrote:I propose that we allow absl::optional via the following steps:--(1) In base/optional.h, #include "third_party/abseil-cpp/absl/types/optional.h", and make base::Optional and base::nullopt_t aliases to the absl equivalents.(2) Remove base/optional_unittest.*.(3) Send a message to chromium-dev@ saying that absl::optional is legal and preferred.(4) Write an LSC proposal for the remaining steps below.(5) Rewrite all uses of base::Optional to absl::optional, and base::nullopt_t to absl::nullopt_t.(6) Rewrite all #includes of base/optional.h to third_party/abseil-cpp/absl/types/optional.h.(7) Remove base/optional.h.I volunteer to do these steps if this meets with general approval.PK
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/CAAHOzFDsJMQWbQO-iYWz4tooXzcY%2BFK34Eajsavg5KwAPmNq7g%40mail.gmail.com.
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/CACuR13c24gppNVPM5GVTkk7P22MXFh98ivmAjCyH1fyZiULpyA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAHtyhaSjY6ZmGqyziGFEuSt7m2K%2Bw6JG9z84%3DU%2Bu%2Be8SDYqEow%40mail.gmail.com.
Two questions:- making sure we don't backslide on our stricter enforcement of validity? std::optional::operator* does not runtime enforce validity (instead, it's UB to use this when there's no contained value), while absl::optional::operator* and std::optional::operator* currently do
2021年4月14日(水) 11:18 Daniel Cheng <dch...@chromium.org>:Two questions:- making sure we don't backslide on our stricter enforcement of validity? std::optional::operator* does not runtime enforce validity (instead, it's UB to use this when there's no contained value), while absl::optional::operator* and std::optional::operator* currently doSorry for the typo. absl::optional and *base::Optional* do, but not std::optional.
- making sure we don't backslide on our stricter enforcement of validity? std::optional::operator* does not runtime enforce validity (instead, it's UB to use this when there's no contained value), while absl::optional::operator* and std::optional::operator* currently do
- is it possible for there to be any binary size effects from this? It looks like absl uses abort() to terminate execution when accessing an unpopulated optional using value().
On Wed, Apr 14, 2021 at 11:18 AM Daniel Cheng <dch...@chromium.org> wrote:- making sure we don't backslide on our stricter enforcement of validity? std::optional::operator* does not runtime enforce validity (instead, it's UB to use this when there's no contained value), while absl::optional::operator* and std::optional::operator* currently doWe could prevent a fallback to the std:: version once C++17 becomes available via #define ABSL_OPTION_USE_STD_OPTIONAL 0. That would be harmless to do now.I don't think we need to maintain our own unittests beyond absl's, but if consensus is the other way I'm happy to keep them around.
--
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/CAHtyhaQdsEQTpCR1yXQtT44ygEnoN0SRtjuPU1W2x2esSa%2B9MA%40mail.gmail.com.
--
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/CAAHOzFAwJnrMFg_zK0X0c%2BE7rB2UNAuCC-Z3JF5eaks7PE3vbA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CACwGi-5QZRRpaAuS3h2rDpyZJWqF5TjLiFn0N6OsE9B7boKVXw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF3XrKqEFn8A6wMpOUW2B9N1QfkZM4Bx2YSHrJKhs6ms_jU%3DoQ%40mail.gmail.com.
Regarding the rewrite, I would propose the following course of action:1) have typedefs in base/optional.h that point to absl::optional and friends. This will flush out dependency issues in GN, which can be fixed in the same CL (i.e. targets that depend on base::Optional (directly or transitively) should have deps += [ "//base" ]);2) apply rewrites to components (maybe a CL per component), fixing other issues I mentioned in the previous email;3) update the rest: the Oilpan plugin and gdbscripts.
1) have typedefs in base/optional.h that point to absl::optional and friends. This will flush out dependency issues in GN, which can be fixed in the same CL (i.e. targets that depend on base::Optional (directly or transitively) should have deps += [ "//base" ]);
Would you be willing to manually split your giant CL into smaller chunks and send them to me for review? I can start reviewing and landing once the LSC proposal gets approval.
--
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/CAAHOzFAeTynfrobNfif2Wb8iaKEQgAAmxTw%3DkLCQTgtYBS4ZOA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAOuvq20f209VV-gQG-j0%2BqMXnrZ-Ej%3DiX4KePz%2BPHkuOyVz9qA%40mail.gmail.com.