<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I put the example in. Let's review it (when posted) and decide in January whether to keep it.<div><br></div><div>-Jim<br><div><br><div><div>On Dec 11, 2012, at 12:50 PM, Rajan Bhakta wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><font size="2" face="sans-serif">I know you said that this one argument
example is not needed, however I think examples are usually very useful
when reading any spec, and having even this simple case in the message
below would be useful. I agree we shouldn't go further than the one argument
example though.</font>
<br>
<br><font size="2" face="sans-serif">Regards,<br>
<br>
Rajan Bhakta<br>
z/OS XL C/C++ Compiler Technical Architect<br>
ISO C Standards Representative for Canada<br>
C Compiler Development<br>
Contact: <a href="mailto:rbhakta@ca.ibm.com">rbhakta@ca.ibm.com</a>, Rajan Bhakta/Toronto/IBM<br>
Telephone: (905) 413-3995</font>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">From:</font>
</td><td><font size="1" face="sans-serif">Jim Thomas <<a href="mailto:jaswthomas@sbcglobal.net">jaswthomas@sbcglobal.net</a>></font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">To:</font>
</td><td><font size="1" face="sans-serif">CFP <<a href="mailto:cfp-interest@ucbtest.org">cfp-interest@ucbtest.org</a>>,
</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Date:</font>
</td><td><font size="1" face="sans-serif">12/11/2012 02:07 PM</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Subject:</font>
</td><td><font size="1" face="sans-serif">[Cfp-interest] type-generic cbrt for
decimal</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Sent by:</font>
</td><td><font size="1" face="sans-serif"><a href="mailto:cfp-interest-bounces@oakapple.net">cfp-interest-bounces@oakapple.net</a></font></td></tr></tbody></table>
<br>
<hr noshade="">
<br>
<br>
<br><font size="3">Regarding </font>
<br><p><font size="3"><b><i>ISSUE 7: We intend to add an example showing how
generic selection can be used to define cbrt for tgmath to handle decimal
as well as generic FP types.</i></b></font>
</p><p><font size="3">in Part 2, I'm wondering if providing the example is really
desirable. </font>
</p><p><font size="3">An implementation that supports Parts 1 and 2 might implement
the cbrt type-generic macro as:</font>
</p><p><font size="3">#ifdef __STDC_WANT_IEC_00000_EXT2</font>
</p><p><font size="3">#define cbrt(X) _Generic((X),
\<br>
_Decimal128:
cbrtd128(X), \<br>
_Decimal64:
cbrtd64(X), \<br>
_Decimal32:
cbrtd32(X), \<br>
long
double: cbrtl(X), \<br>
default:
_Roundwise_cbrt(X), \<br>
float:
cbrtf(X)
\<br>
)</font>
<br><font size="3">#else</font>
<br><font size="3">#define cbrt(X) _Generic((X),
\<br>
long
double: cbrtl(X), \<br>
default:
_Roundwise_cbrt(X), \<br>
float:
cbrtf(X)
\<br>
)</font>
<br><font size="3">#endif<br>
<br>
where _Roundwise_cbrt() is equivalent to cbrt() invoked without macro-replacement
suppression.</font>
<br>
<br><font size="3">However, implementing a 2 or 3 argument function using
_Generic, which is already prohibitively cumbersome with just C11, would
become even worse with decimal types. It's difficult to imagine an implementation
would do it, even without decimal types.</font>
<br>
<br><font size="3">If the example is just for programmers writing type-generic
macros for their own 1-argument functions, then this straightforward example
isn't really needed.</font>
<br>
<br><font size="3">Your thoughts?</font>
<br>
<br><font size="3">-Jim</font>
<br>
<br><tt><font size="2">_______________________________________________<br>
Cfp-interest mailing list<br>
<a href="mailto:Cfp-interest@oakapple.net">Cfp-interest@oakapple.net</a><br>
</font></tt><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest"><tt><font size="2">http://mailman.oakapple.net/mailman/listinfo/cfp-interest</font></tt></a><tt><font size="2"><br>
</font></tt>
<br>
<br></p></blockquote></div><br></div></div></body></html>