<div dir="ltr">+1 for the feature test macro. What would the value of the macro be?<div><br></div><div>It&#39;s particularly important in this case because the availability of std::is_aggregate is dependent</div><div>on both the compiler version, because a builtin is required, and the STL version.<br></div><div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 8:14 PM, Agustín Bergé <span dir="ltr">&lt;<a href="mailto:agustinberge@gmail.com" target="_blank">agustinberge@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">LWG2911 gave us the new `is_aggregate` trait, but no feature-test macro.<br>
I would like to suggest `__cpp_lib_is_aggregate`. What follows is a<br>
motivational use case, courtesy of Jonathan Wakely:<br>
<br>
     #include &lt;vector&gt;<br>
     template&lt;typename T, typename... Args&gt;<br>
     T make(Args&amp;&amp;... args)<br>
     {<br>
     #if __cpp_lib_is_aggregate<br>
         if constexpr (std::is_aggregate_v&lt;T&gt;)<br>
             return { std::forward&lt;Args&gt;(args)... };<br>
         else<br>
     #endif<br>
             return T(std::forward&lt;Args&gt;(args)...)<wbr>;<br>
     }<br>
     struct Agg { int i; };<br>
     int main()<br>
     {<br>
         auto v = make&lt;std::vector&lt;int&gt;&gt;(1, 2);<br>
     #if __cpp_lib_is_aggregate<br>
         // make&lt;&gt; only supports aggregates if std::is_aggregate is<br>
available<br>
         auto a = make&lt;Agg&gt;(1);<br>
     #endif<br>
     }<br>
<br>
Regards,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Agustín K-ballo Bergé<br>
<a href="http://talesofcpp.fusionfenix.com" rel="noreferrer" target="_blank">http://talesofcpp.fusionfenix.<wbr>com</a><br>
______________________________<wbr>_________________<br>
Features mailing list<br>
<a href="mailto:Features@isocpp.open-std.org">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/<wbr>mailman/listinfo/features</a><br>
</font></span></blockquote></div><br></div>