Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 7772 invoked from network); 2 Jun 2008 20:38:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jun 2008 20:38:47 -0000 Received: (qmail 94624 invoked by uid 500); 2 Jun 2008 20:38:45 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 94613 invoked by uid 500); 2 Jun 2008 20:38:45 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 94597 invoked by uid 99); 2 Jun 2008 20:38:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 13:38:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 20:37:50 +0000 Received: from exchmail01.Blue.Roguewave.Com (exchmail01.blue.roguewave.com [10.22.129.22]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m52KcA2A021250 for ; Mon, 2 Jun 2008 20:38:10 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: type_traits progress Date: Mon, 2 Jun 2008 14:38:12 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: type_traits progress Thread-Index: AcjE7X1hoRL2JTbrRAa1YDn5VH8b+QAAq/kA References: <483B79A1.4070808@roguewave.com> <483C67BA.6070209@roguewave.com> <48401E00.2090709@roguewave.com> <48409378.3010407@roguewave.com> <48445493.4080400@roguewave.com> From: "Eric Lemings" To: X-Virus-Checked: Checked by ClamAV on apache.org =20 > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com]=20 > Sent: Monday, June 02, 2008 2:14 PM > To: dev@stdcxx.apache.org > Subject: Re: type_traits progress >=20 > Eric Lemings wrote: > > =20 > >=20 > >> -----Original Message----- > >> From: Travis Vitek [mailto:Travis.Vitek@roguewave.com]=20 > >> Sent: Friday, May 30, 2008 6:28 PM > >> To: dev@stdcxx.apache.org > >> Subject: RE: type_traits progress > >> > >> =20 > >> > >> Martin Sebor wrote: > >>> Travis Vitek wrote: > >>> [...] > >>>>> Right. That could be another wrinkle. Our traits won't > >>>>> work with generic code that takes integral_constant > >>>>> by reference. > >>>> I don't really see the motivation, but it is obvious that=20 > >>>> the committee thought it was important for the standard > >>>> traits to do so, so we should probably follow suit in our > >>>> internal implementation. > >> Can you think of a reason why this 'feature' would be important? > >> > >>>> If we did decide to do this then we would probably want=20 > >> our own write > >>>> __rw_integral_constant and use that internally to avoid namespace > >>>> pollution? Then I'd assume we'd want something like the following > >>>> example for is_const... > >>> Yes, I think this is close to what we want. The only=20 > thing that bugs > >>> me about it is... > >>> > >>>> template > >>>> struct __rw_integral_constant > >>>> { > >>>> static const T value =3D v; > >>>> typedef T value_type; > >>>> typedef integral_constant type; > >>> ...this backward dependency on integral_constant, but I=20 > don't see how > >>> to break it without template typedefs. I don't think there's=20 > >> a compiler > >>> out there that supports them yet. > >> Actually, this was originally a typo on my part, but I do see=20 > >> where this > >> is going. I haven't read about template typedefs, but it seems that > >> there would be a serious problem caused by the cyclic dependency. > >=20 > > Yeah it looks like a typo to me too. Should it be: > >=20 > > typedef __rw_integral_constant type; > >=20 > > In all cases I've seen, `type' refers to type of self for identity > > properties. This typedef would not hold up the identity property. >=20 > IIUC, for every specialization X of integral_constant, this > must hold: >=20 > is_same::value =3D=3D true >=20 > With integral_constant derived from __rw_integral_constant > the condition would fail. Not if it defined its own `type'. template struct integral_constant: __rw_integral_constant { typedef integral_constant type; }; That's the way I usually see it done. Brad.