From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7096 invoked by alias); 30 Jan 2003 11:22:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 7088 invoked from network); 30 Jan 2003 11:22:57 -0000 Received: from unknown (HELO uniton.integrable-solutions.net) (62.212.99.186) by 172.16.49.205 with SMTP; 30 Jan 2003 11:22:57 -0000 Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id h0UBM4jj009498; Thu, 30 Jan 2003 12:22:04 +0100 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.3/8.12.3/Submit) id h0UBM3xk009497; Thu, 30 Jan 2003 12:22:03 +0100 X-Authentication-Warning: uniton.integrable-solutions.net: gdr set sender to gdr@integrable-solutions.net using -f To: Alexandre Oliva Cc: martin@xemacs.org, gcc@gcc.gnu.org, Nathan Sidwell Subject: Re: C++ template parameter constraints References: <15928.36654.134741.187229@gargle.gargle.HOWL> From: Gabriel Dos Reis In-Reply-To: Organization: Integrable Solutions Date: Thu, 30 Jan 2003 17:59:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-01/txt/msg01643.txt.bz2 Alexandre Oliva writes: | On Jan 30, 2003, Martin Buchholz wrote: | | > http://m17n.org/martin/writings/template-parameter-constraints.html | | > (feedback desired) | | /me thinks the syntax for satisfying might be something like Modula3's | `T1 < T2' constraint, used to indicate that type T1 must be the same | or derived from T2. We could use something like: | | template ::satisfied> declaration; This has been hashed several times (on the C++ committee reflectors, at ACCU Spring conferences, with Bjarne Stroustrup, Jeremy Siek, Fergus Henderson and many others)... The above doesn't scale to constraints on seperately declared template-parameters. The last syntaxes Bjarne Stroustrup discussed were about template [predicate::holds] declaration; Note where the constraints goes (in the square brackets just after the template-parameters declaration). The above does not conflict with current grammar, allows for separately declared template-parameters and works smoothly with other template meta-programming features. [...] | Comments? I'll make more once I'm finished with 3.2.2 issues :-) -- Gaby