Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 642 invoked from network); 6 Jun 2008 22:35:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2008 22:35:27 -0000 Received: (qmail 73770 invoked by uid 500); 6 Jun 2008 22:35:30 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 73751 invoked by uid 500); 6 Jun 2008 22:35:30 -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 73740 invoked by uid 99); 6 Jun 2008 22:35:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2008 15:35:30 -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; Fri, 06 Jun 2008 22:34:34 +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 m56MYter013592 for ; Fri, 6 Jun 2008 22:34:55 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: Experiment with variadic templates Date: Fri, 6 Jun 2008 16:34:51 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Experiment with variadic templates Thread-Index: AcjIJYsWZb3AytBMRI69qWJVshp2dw== From: "Eric Lemings" To: X-Virus-Checked: Checked by ClamAV on apache.org =20 Consider the following little program: ------------------------------------------------------------------------ template struct integer { typedef IntType value_type; static const value_type value =3D IntVal; }; =20 template struct tuple { tuple (); tuple (const tuple&); tuple& operator=3D (const tuple&); =20 }; =20 #include =20 template struct tuple_size : integer { }; =20 #include =20 int main () { typedef tuple < > tuple0; std::cout << tuple_size< tuple0 >::value << std::endl; =20 typedef tuple < int > tuple1; std::cout << tuple_size< tuple1 >::value << std::endl; =20 return 0; } ------------------------------------------------------------------------ Compiling with gcc-4.3 using the -std=3Dgnu++0x option (gcc-4.3.1 was just released BTW), I get the following output: 1 1 The first line should print '0', shouldn't it? Or no? Brad.