From -42457612856105703
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109fba,6facdcb34a614bd2
X-Google-Attributes: gid109fba,public
X-Google-Thread: f78e5,c3f62c9962bf0ef,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-02-17 09:21:03 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: dheld@codelogicconsulting.com ("David B. Held")
Newsgroups: comp.std.c++,comp.lang.c++
Subject: Re: Problem re-using template argument in template member function in GCC 3.2?
Date: Mon, 17 Feb 2003 17:21:02 +0000 (UTC)
Organization: Posted via Supernews, http://www.supernews.com
Lines: 44
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <v4ss007tj63s8c@corp.supernews.com>
References: <gt8q4v8cftlpiv91ks2jtcrene9i5e1cai@4ax.com>
X-Trace: mail2news.demon.co.uk 1045502462 16373 10.0.0.1 (17 Feb 2003 17:21:02 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 17 Feb 2003 17:21:02 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 18kowu-0004Fw-00
	for mail2news@news.news.demon.net; Mon, 17 Feb 2003 17:21:01 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id EAA04730; Tue, 18 Feb 2003 04:20:56 +1100 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-Newsgroups: comp.std.c++,comp.lang.c++
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Spam-Status: No, hits=-5.7 required=5.0
	tests=NOSPAM_INC,PRIORITY_NO_NAME,QUOTED_EMAIL_TEXT,REFERENCES,
	      SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:17988 comp.lang.c++:203767

"Bob Kurtz" <bkurtz@NOSPAM.com> wrote in message
news:gt8q4v8cftlpiv91ks2jtcrene9i5e1cai@4ax.com...
> [...]
> template<class DictKeyType>
> vector<Statement*>
> StatementContainer::getStatementsWithKeyValueImplementation(const
> string & keyNameString, const DictKeyType & valueToCheckFor) const
> {
> // ... Stuff omitted ...
> const bool currentStatementHasKeyValue =
> pCurrentStatementDict->hasKeyWithValue<typename
DictKeyType>(keyNameString,
> valueToCheckFor);
> // ... More stuff omitted
> }

I don't think it's valid to use 'typename' in this instance, because
DictKeyType is not a dependent name.  Furthermore, I don't believe
it is necessary to specify the specialization parameter at all, since
hasKeyWithValue uses that type in a function argument.  That is,
the type of valueToCheckFor should induce argument type deduction
to automatically selet DictKeyType for you.  You should just be
able to write this:

pCurrentStatementDict->hasKeyWithValue(
    keyNameString, valueToCheckFor
);

If you can't, there's some serious problems going on.  Even if you had
to explicitly specify the temlate parameter, you would do so like this:

pCurrentStatementDict->hasKeyWithValue<DictKeyType>(
    keyNameString, valueToCheckFor
);

Dave


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



