Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 93001 invoked from network); 31 May 2008 21:42:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 May 2008 21:42:08 -0000 Received: (qmail 4867 invoked by uid 500); 31 May 2008 21:42:11 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 4846 invoked by uid 500); 31 May 2008 21:42: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 4835 invoked by uid 99); 31 May 2008 21:42:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 May 2008 14:42:11 -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 66.249.82.234 as permitted sender) Received: from [66.249.82.234] (HELO wx-out-0506.google.com) (66.249.82.234) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 May 2008 21:41:22 +0000 Received: by wx-out-0506.google.com with SMTP id i30so314705wxd.2 for ; Sat, 31 May 2008 14:41:39 -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:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=dp5eDpQ73g0v0QUQ/iqyUroC2oPN/BLSidLtM2t8aAY=; b=KWiGmpxIlBaGsgQ734KLLGG8HmKeqGzVeUbuWAXaX+JMKWMzEXaHvi17ulVtpUa4od8+mLMFvRaOZQPYpGuUcUaJdp1602ySS5ZZqEKPfI96WrBarFBNMI7lQ/U/FVkxaeVOMB4BjlxlnQrkkpTE+eED153zplFkTkdQIQvlDlM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=j/rBokKi1q2UY6xFoVdufA0tvWWMrUGa9aUWh2LVIt9MD5WmrOKVpvFMGR83SEIVZ5+RuG7zrLIKM8QFVZygABsxL1q+HU8AHw/RZh4pyX/wbuGUkmCU2oHNaM4bsu/ECsVzajY8KfPyATYb/ZgJcHk+i5hNxzfolSt0iFpSm7Q= Received: by 10.90.54.17 with SMTP id c17mr8408214aga.74.1212270098992; Sat, 31 May 2008 14:41:38 -0700 (PDT) Received: from localhost.localdomain ( [71.229.200.170]) by mx.google.com with ESMTPS id n63sm6210605pyh.8.2008.05.31.14.41.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 31 May 2008 14:41:38 -0700 (PDT) Message-ID: <4841C60F.5010408@roguewave.com> Date: Sat, 31 May 2008 15:41:35 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: type_traits progress References: <483B79A1.4070808@roguewave.com> <483C67BA.6070209@roguewave.com> <48401E00.2090709@roguewave.com> <48406BE1.4070902@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 Eric Lemings wrote: > > >> -----Original Message----- >> From: Martin Sebor [mailto:sebor@roguewave.com] >> Sent: Friday, May 30, 2008 3:05 PM >> To: dev@stdcxx.apache.org >> Subject: Re: type_traits progress >> >> Travis Vitek wrote: >>> >>> >>> Eric Lemings wrote: >>>>> Travis Vitek wrote: >>>>> >>>> ... >>>>> As an example, the array traits above are all closely related >>>>> and their >>>>> implementations are similar. There are five traits, and >> those traits >>>>> span three sections of the standard. >>>>> >>>>> I'm open to doing some type of grouping, we just need to >>>>> understand how >>>>> we want to group them and then how we want to name the files. >>>> The term you're looking for is cohesion. :) I kinda like this >>>> organization. Couple things though. >>>> >>>> Why put __rw_decay, a single helper trait in its own header? >>> Well decay deals with conversion from array to pointer and >> function to >>> function pointer conversions. I can't necessarily put it into both >>> _meta_array.h and _meta_func.h, so I figured it would be >> best to put it >>> into a file by itself. >> FWIW, I see no problem with bundling groups of traits together >> even if some of them are unlikely to be used in the rest of the >> lib, just as long as their implementation isn't too big (i.e., >> doesn't bloat translation units and unnecessarily increase >> compilation time). > > Well when it comes to metaprogramming, there's almost always a > tradeoff in these two respects. Either the translation unit > size increases or compile times increase. They tend to go hand in hand. But you probably meant the size of the generated object code. > But you're right: > we should minimize both whenever possible. > > BTW, which of these two should be the preferred: comile-time > computations (metaprogramming) or runtime processing? I would > say compile-time even though that will signficantly impact us > developers but I think users would prefer this since they do > not build nearly as often. I'm sure you're right in the majority of cases. But as John Lakos writes in his Large-Scale C++ Software Design compilation time is exceedingly important for large code bases with millions of lines of code: http://www.amazon.com/dp/0201633620 The problem with metaprogramming is that many compilers weren't designed for the kind of involved computation that some of these algorithms require, so their performance really blows. It's a fun exercise to time the compilation of a non-trivial metaprogram (e.g., sorting a typelist) while watching its memory consumption. Martin