<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: rbhakta@ca.ibm.com, Rajan Bhakta/Toronto/IBM<br>
Telephone: (905) 413-3995</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Jim Thomas <jaswthomas@sbcglobal.net></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">CFP <cfp-interest@ucbtest.org>,
</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">12/11/2012 02:07 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">[Cfp-interest] type-generic cbrt for
decimal</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Sent by:</font>
<td><font size=1 face="sans-serif">cfp-interest-bounces@oakapple.net</font></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><font size=3>in Part 2, I'm wondering if providing the example is really
desirable. </font>
<p><font size=3>An implementation that supports Parts 1 and 2 might implement
the cbrt type-generic macro as:</font>
<p><font size=3>#ifdef __STDC_WANT_IEC_00000_EXT2</font>
<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>
Cfp-interest@oakapple.net<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>