From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15562 invoked by alias); 9 Apr 2010 13:57:53 -0000 Received: (qmail 15551 invoked by uid 22791); 9 Apr 2010 13:57:52 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from bonnie-vm4.ifh.de (HELO smtp.ifh.de) (141.34.50.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Apr 2010 13:57:48 +0000 Received: from pub1.ifh.de (pub1.ifh.de [141.34.15.191]) by smtp.ifh.de (Postfix) with ESMTP id 0CA4C388196 for ; Fri, 9 Apr 2010 15:57:44 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.ifh.de 0CA4C388196 Received: by pub1.ifh.de (Postfix, from userid 15741) id DB140200068; Fri, 9 Apr 2010 15:57:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by pub1.ifh.de (Postfix) with ESMTP id CF7321F00EF for ; Fri, 9 Apr 2010 15:57:44 +0200 (CEST) Date: Fri, 09 Apr 2010 13:57:00 -0000 From: Frank Winter To: gcc-help@gcc.gnu.org Subject: Re: Avoid typename repetition in template specialization Message-ID: User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00068.txt.bz2 Dear all, Thanks John and Axel! But, as I have a lot of these constructs typedef is exactly the problem: typedef PScalar< PColorMatrix< RComplex, Nc> > T1; typedef PSpinVector< PColorVector< RComplex, Nc>, Ns > T2; typedef OpMultiply Op; template<> inline BinaryReturn< T1 , T2 , Op >::Type_t operator*(const T1& l, const T2& r ) { BinaryReturn< T1 , T2 , Op >::Type_t d; // code return d; } now, this conflicts: typedef PSpinVector< PColorVector< RComplex, Nc>, Ns > T1; typedef PSpinVector< PColorVector< RComplex, Nc>, Ns > T2; typedef OpMultiply Op; template<> inline BinaryReturn< T1 , T2 , Op >::Type_t operator+(const T1& l, const T2& r ) { BinaryReturn< T1 , T2 , Op >::Type_t d; // code return d; } If there would be a way to undefine a typename in the actual namespace this would help a lot in this case. Is there functionality for this or is there a workaround for my case that occurs to you? Best regards, Frank Winter