I agree with Matthias's rationale for having a feature-test macro. +1 for bumping the value of __cpp_range_based_for. (We've also bumped its value once before, when it was extended to handle non-common ranges, and the lifetime thing is *at least* as big a new feature as handling non-common ranges in for loops.)
–Arthur On Thu, Nov 17, 2022 at 4:41 AM Matthias Kretz via Core < [email protected]> wrote: > On Wednesday, 16 November 2022 22:54:51 CET Barry Revzin via Core wrote: > > We have > > > https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommenda > > tions#__cpp_range_based_for already so we might as well bump it. > > > > I'm not sure what you would actually do with the information tho - > there's > > not really any benefit to writing the loop two ways, just write it the > way > > that works. > > #if __cpp_range_based_for <= 201603 > #error "Your compiler is not supported." > #endif > > I believe it's a valid approach to require the simpler lifetime rules and > stop > thinking about temporaries when using range-based for. > > -- > ────────────────────────────────────────────────────────────────────────── > Dr. Matthias Kretz https://mattkretz.github.io > GSI Helmholtz Centre for Heavy Ion Research https://gsi.de > stdₓ::simd > ────────────────────────────────────────────────────────────────────────── > _______________________________________________ > Core mailing list > [email protected] > Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/core > Link to this post: http://lists.isocpp.org/core/2022/11/13578.php >
-- SG10 mailing list [email protected] https://lists.isocpp.org/mailman/listinfo.cgi/sg10
