Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 50312 invoked from network); 13 Jun 2008 08:32:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2008 08:32:08 -0000 Received: (qmail 86326 invoked by uid 500); 13 Jun 2008 08:32:11 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 86304 invoked by uid 500); 13 Jun 2008 08:32:11 -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 86292 invoked by uid 99); 13 Jun 2008 08:32:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jun 2008 01:32:10 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 72.14.220.155 as permitted sender) Received: from [72.14.220.155] (HELO fg-out-1718.google.com) (72.14.220.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jun 2008 08:31:21 +0000 Received: by fg-out-1718.google.com with SMTP id 16so2994295fgg.23 for ; Fri, 13 Jun 2008 01:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding:sender; bh=lsPHVpxLVt3/tcSiJ/xK4tC9u1inQR8yeD1I3Dmd0vg=; b=Xn0ntgoJPvAv3Kpfjoy4JGfU32+sqXia7TlbHirwfv5r/Tmh/EgSWYOGHpJlCy+Lgc JfAY6pGnnGt4k+0Kxj+yBOobZRxAtohvfXN4/D2ABYa1hnPX1F0Y0/2RmroeuYQHOXuW 2Gky8WM46ET/GN3P5cZ2pyJ/yIWltoSheIpVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding:sender; b=b/Fd1rVBSjAmzwLnAiuP8HPaAGkjXIRIqkI1cQmqwtb0yB8jALwXRfCYfGG0/Ldcct OOYmafCOPZCO8kWNGp0GicNebPdlW/6/x1kiaH7i5CZJam/nV0YLyioq3DUL5XeSA7E5 0aN7jceD5HtXyrxMpcnWrqX9eHfK0OpAOK1vs= Received: by 10.86.57.9 with SMTP id f9mr3539591fga.66.1213345898233; Fri, 13 Jun 2008 01:31:38 -0700 (PDT) Received: from ?194.254.174.206? ( [194.254.174.206]) by mx.google.com with ESMTPS id e20sm4991332fga.1.2008.06.13.01.31.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 13 Jun 2008 01:31:36 -0700 (PDT) Message-ID: <48523067.8040401@roguewave.com> Date: Fri, 13 Jun 2008 01:31:35 -0700 From: Martin Sebor User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: remove_reference References: <485220EE.8060702@roguewave.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org Travis Vitek wrote: > > >> Martin Sebor wrote: >> >> Eric Lemings wrote: >>> >>> >>>> -----Original Message----- >>>> From: Travis Vitek >>>> Sent: Thursday, June 12, 2008 4:18 PM >>>> To: Eric Lemings >>>> Subject: RE: remove_reference >>>> >>>> >>>> >>>>> Eric Lemings >>>>> >>> ... >>>>> I think you sorta missed my point. My point is that if >> the internal >>>>> type traits do not provide any real added value, why bother with >>>>> them? Say you have an internal class __rw_foo and a public class >>>>> foo which derives from __rw_foo but is virtual identical, why have >>>>> __rw_foo at all? Why not move everything in __rw_foo directly into >>>>> foo? >>>>> >>>> Sorry, I understood what you were getting at, I just didn't >>>> come right out and provide the answer you were looking for. >>>> Yes, we intend to use traits in the library implementation >>>> where we can take advantage of them for performance >>>> improvements. The example I provided above is just one of >>>> many situations that we may do so. >>> Performance improvements...such as taking advantage of >> built-in compiler >>> type traits? If that were the case, I could see the >> rationale for using >>> internal type traits as a proxy for such optimization. So I >> guess there >>> is SOME value after all. :) >> The original idea, IIRC, was to expose the implementation >> of the traits in the form of _RWSTD_XXX() macros to be used >> by the rest of our code, including the standard type traits >> template. Each macro would expand into either the compiler >> built-in for compilers that supported them or to our own >> __rw_xxx trait otherwise. The reason for this was to avoid >> paying a penalty in terms of increased compile times and >> keep the header free of unnecessary clutter >> when using the compiler-provided traits, as well as to avoid >> namespace pollution when using the traits. >> > > So I've managed to diverge from the original idea. This is almost funny > considering all of the discussion that we had about the need for > internal traits to inherit from __rw_integral_constant<>. Yes. We both forgot what we had discussed. We need to write these things down. > > Well, now that I've finally got the traits in subversion, I could go > back and 'fix' this to compile out the implementation types when the > necessary compiler support is not available. Something more like my > original implementation. > > #ifndef _RWSTD_IS_POD > > template > struct __rw_is_pod > { > enum { _C_value = _RWSTD_IS_TRIVIAL(_Type) > && _RWSTD_IS_STANDARD_LAYOUT(_Type) > }; > }; > > # define _RWSTD_IS_POD(T) _RW::__rw_is_pod::type > #endif FWIW, it might be worth waiting until it's been ported to other compilers besides MSVC to see if it still makes sense and/or if there is a better way to do it. Martin