|author||Anqi Dong <firstname.lastname@example.org>||Tue Nov 22 23:39:02 2022 +0000|
|committer||CQ Bot Account <email@example.com>||Tue Nov 22 23:39:02 2022 +0000|
pw_containers: Make Pair in FlatMap support CTAD Adding an explicit deduction guide for Pair does a few things: * Some cases are not covered by implicit deduction guides, for the same reason as for std::pair. For more information, see https://en.cppreference.com/w/cpp/utility/pair/deduction_guides * CTAD can be sketchy in some cases, and so some projects might opt to enable something like -Wctad-maybe-unsupported. Adding an explicit deduction guide is a signal to the compiler that the type is "opting in" to CTAD. Unfortunately, the aggregate initialization with no types does not work in all circumstances (for example, it can be tricky to get all the deductions to line up when using std::apply and a lambda), and the CTAD option exists as a less verbose option than one where the template parameters _also_ need to be stated explicitly. Note that the Google style guide doesn't love CTAD in general: https://google.github.io/styleguide/cppguide.html#CTAD (Note: CTAD = class template argument deduction) Change-Id: Ib4555e8d3655f2a91e8c487641df1b973453723e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/120731 Reviewed-by: Wyatt Hepler <firstname.lastname@example.org> Commit-Queue: Anqi Dong <email@example.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.