<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, 14 Jun 2018 at 19:57, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>It looks like some papers that deserve feature-test macros have slipped through the cracks. I've looked through the core language papers only (someone would need to do a similar exercise for the library papers); the following C++20 features seem to have a clear case for having feature test macros, but lack them:</div><div><div><br></div><div> * P0409R2 allow lambda-capture [=, this]: a [=] capture that captures this is deprecated in C++20, so detecting that the replacement is available seems useful. Maybe __cpp_capture_equals_this == 201707?</div><div> * P0734R0 concepts: it is reasonable to use concepts where available and fall back to other techniques otherwise, since concepts can provide a better experience for library users. __cpp_concepts == 201707 (but see below, I don't expect anyone to use this value)</div><div> * P0859R0 when are constexpr member functions defined? This is a DR, but there are cases where a library would wish to declare a function as constexpr only for implementations implementing this paper. I would suggest bumping __cpp_constexpr to 201711 for this.</div><div> * P0515R3 consistent comparison: particularly with non-type template parameters of class type, libraries may want to default operator<=> when possible and define traditional comparison operators otherwise. This needs both a language macro and a library macro.<br></div><div> * P0857R0 functionality gaps in constraints. __cpp_concepts == 201711</div><div> * P0905R1 symmetry for spaceship. Bump the feature test macro added for P0515R3?</div><div> * P0722R3 destroying operator delete (being discussed in another thread)</div><div><br></div><div>For these ones, I'm not sure whether there'd be a use case that we want to support (under the "if you want to be portable, don't use the feature" argument):</div><div><br></div><div> * P0683R1 default member initializers for bit-fields</div><div> * P0306R4 __VA_OPT__ </div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"> * P0329R4 designated initialization</div> * P0428R2 template syntax for generic lambdas</div><div> * P0614R1 range-based for with initializer</div></div><div> * P0846R0 ADL and non-visible function templates</div><div> * P0692R1 access checking on specialization</div><div> * P0624R2 default constructible and assignable stateless lambdas</div><div> * P0315R4 lambdas in unevaluated contexts</div><div> * P0962R1 relaxing range-based for customization point rules</div><div> * P0969R0 structured bindings for accessible but non-public members</div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"> * P0962R1 relaxing structured binding customization point rules</div> * P0634R4 down with typename</div><div> * P0780R2 pack expansion in lambda init-capture</div><div> * P1064R0 virtual function calls in constant expressions</div><div> * P1008R1 prohibit aggregates with user-declared constructors</div><div> * P1120R0 consistency improvements for <=> and other operators</div><div><br></div><div>These papers got feature-test macros added when we merged SD-6 into the working paper and we will need updates in P0096 to match:</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> * P0840R2 [[no_unique_address]] attribute (__has_cpp_attribute == 201803)</span><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> * P0479R5 [[likely]] and [[unlikely]] attributes (__has_cpp_attribute == 201803)</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">These papers propose or imply the addition of feature test macros and we'll presumably need to update P0096 to match:</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> * P0732R0 __cpp_nontype_template_parameter_class == 201806</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> * P0892R2 __cpp_explicit_bool == 201806</span></div></div></blockquote><div><br></div><div>It's been suggested that __cpp_conditionally_explicit is a better name, because "explicit bool" could mean something other than "explicit(bool)" i.e. the parentheses are necessary to describe the feature.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> * P0542R5 contracts: [[expect]], [[ensures]], [[assert]]: __has_cpp_attribute == 201806?<br></div></div>
_______________________________________________<br>
Features mailing list<br>
<a href="mailto:Features@isocpp.open-std.org" target="_blank">Features@isocpp.open-std.org</a><br>
<a href="http://www.open-std.org/mailman/listinfo/features" rel="noreferrer" target="_blank">http://www.open-std.org/mailman/listinfo/features</a><br>
</blockquote></div></div>