--
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 post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CABiGVV-GYQ7d2Jggbi3Mmsfacxycuyu462VkzwripoAA%2BT_5OQ%40mail.gmail.com.
Chromium compiles without exception support, but there are still cases where explicitly marking a function as noexcept may be necessary to compile, or for performance reasons. Use noexcept for move constructors whenever possible (see "Notes" section on move constructors). Other usage should be rare.
--
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 post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCOGqB0onW4p3XyhfJB0fqkq1-burMP%3DyOO_KcqB6PckQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAHtyhaQibP%2BtiTQVq%2BKH3NU3oCuEXr2Tw054qZ%2BwD7Nqo1dW0w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF3XrKrUsz_vE-yEAamzD-JCX3Ka%3Dr2UTexzOKUKKeMUfpb4SQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CABiGVV8Ek98UadJJVtw0DGFY2ZuXg14r0q42e6MG97%2BM_tYwvQ%40mail.gmail.com.
Assuming that this works on all of our compilers, I have no objection to using "noexcept" (as with -fno-exceptions, we want to call std::terminate anyhow). I suspect getting copies instead of moves in std::vector is a very common pitfall (since vector only moves if there's no copy constructor or the type is nothrow move constructible).
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CACuR13e-_sdaGd-gfLzMOYJFHJjupqcQ4k_dfC3VbDCEbEyYCg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAHtyhaS331pYV%3DBnrH7hCW6_LgyZxsGekRVokrmiBy_vMZJMaw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CACuR13e3mGwAmN4FqHVb2LJK0d1psFd3XFkwBKMn%2BHGwBy2VyQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CABiGVV-OURQjf14EyPEy5UXXpw50-DZtTkvf5zxXOwZdMoJ2KA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF3XrKq0Yf70JENM8OG4vfdv8FAZ51v5C70uBB4unf%2BYpKwaJg%40mail.gmail.com.
Here is the proposed change:https://codereview.chromium.org/2782973002/I did not mention the problems with "noexcept = default" assignment operators. I can, but that seemed unusual enough and the section was already on the long side for the column format we have.
On Wed, Mar 29, 2017 at 3:37 PM, Brett Wilson <bre...@chromium.org> wrote:Here is the proposed change:https://codereview.chromium.org/2782973002/I did not mention the problems with "noexcept = default" assignment operators. I can, but that seemed unusual enough and the section was already on the long side for the column format we have.Does vector benefit from noexpect assignment operators, or is this intentionally only calling out constructors?
On Wed, Mar 29, 2017 at 3:40 PM, <dan...@chromium.org> wrote:On Wed, Mar 29, 2017 at 3:37 PM, Brett Wilson <bre...@chromium.org> wrote:Here is the proposed change:https://codereview.chromium.org/2782973002/I did not mention the problems with "noexcept = default" assignment operators. I can, but that seemed unusual enough and the section was already on the long side for the column format we have.Does vector benefit from noexpect assignment operators, or is this intentionally only calling out constructors?My understanding is that it's only construction (using std::move_if_noexcept).
--
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 post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CABiGVV_82VwjXfKVHsq675ojD3XHdwt1-f5mc-kSWNMoCYuqfQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CACWgwAbNtLwYm%3D%3DTiRy6yskQD9G7_Mg0%2Bk2p66%3D6APn3cdwWCQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/de594284-cfed-47e8-b640-3bc6ac9d1a97%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/e9d5a093-7a93-4e64-a97e-5d282fc6a2e4%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/7f67a37a-13c4-4772-a2c3-35e2824adec3%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALB5StZeDYy4Eqk4scHSfXzKSRET5xKReKT4dsbRCNuT_94d8g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAPHsw36NQX%2BJCDQJpJ3k3bA23yCOPyf1p7Sv64EQoeikkOSk3A%40mail.gmail.com.
FWIW, from a "user of the compiler" perspective, I'd love it if "disable exceptions" also meant "the whole program is noexcept" since any syntax related to generating or handling exceptions is really just noise to me.
Currently the C++11 style guide says:Chromium compiles without exception support, but there are still cases where explicitly marking a function as noexcept may be necessary to compile, or for performance reasons. Usage should be rare.I would like to suggest this be changed to:
Chromium compiles without exception support, but there are still cases where explicitly marking a function as noexcept may be necessary to compile, or for performance reasons. Use noexcept for move constructors whenever possible (see "Notes" section on move constructors). Other usage should be rare.
Brett
--
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 post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/41c2c588-9cb3-4f77-80e5-cda040a6b493%40chromium.org.
I'm not against this, as long as it's demonstrated that this doesn't have a negative impact on binary size.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF3XrKoA8J6tusSr7n7s0imSMTjafK74PNB1a%3Df%2Bmnw7oaKN%3DA%40mail.gmail.com.