On 9/11/07, <b class="gmail_sendername">Derek Parnell</b> <<a href="mailto:derek@nomail.afraid.org">derek@nomail.afraid.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In other words, if I have a struct with three members, each of a different<br>type, I need to code ...<br><br>struct S3(T, U, V)<br>{<br> T member1;<br> U member2;<br> V member3;<br>}<br><br>S3!(const(int), const(float), const(bool));
<br><br>and so on for 4, 5, 6, .... 23 member structs.<br><br>I'm sure I'm misunderstanding you, because this is really silly.<br></blockquote></div><br>I don't think you're misunderstanding. I think that's what Walter is saying.
<br><br>But here's another idea. If it were allowable that<br>(1) an alias template parameter could accept a type constructor, and<br>(2) "auto" were accepted as a do-nothing type constructor<br>then you would be able to do this:
<br><br> struct S(alias X)<br> {<br> X(int)* pi;<br> X(float)* pf;<br> X(double)* pd;<br> };<br> <br> S(const) k; // k's members are tail-const<br> S(auto) m; // m's members are mutable<br><br><br><br>