From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15891 invoked by alias); 27 Aug 2004 06:58:25 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 15875 invoked from network); 27 Aug 2004 06:58:24 -0000 Received: from unknown (HELO hotmail.com) (64.4.35.21) by sourceware.org with SMTP; 27 Aug 2004 06:58:24 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 26 Aug 2004 23:58:24 -0700 Received: from 130.233.19.1 by by12fd.bay12.hotmail.msn.com with HTTP; Fri, 27 Aug 2004 06:58:23 GMT X-Originating-IP: [130.233.19.1] X-Originating-Email: [learning_c@hotmail.com] X-Sender: learning_c@hotmail.com From: "learning c++" To: gcc-help@gcc.gnu.org Bcc: Subject: template-id does not match any template declaration Date: Fri, 27 Aug 2004 09:16:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 27 Aug 2004 06:58:24.0146 (UTC) FILETIME=[3EE8EF20:01C48C03] X-SW-Source: 2004-08/txt/msg00248.txt.bz2 Hi, I am a novice for C++, and I compiled a program with C++ and there are an error, Pleaes help me. Thanks, #include template class pair { T value1, value2; public: pair (T first, T second) {value1=first; value2=second;} T module () {return 0;} }; template <> class pair { int value1, value2; public: pair (int first, int second) {value1=first; value2=second;} int module (); }; template <> int pair::module() { return value1%value2; } int main () { pair myints (100,75); pair myfloats (100.0,75.0); std::cout << myints.module() << '\n'; std::cout << myfloats.module() << '\n'; return 0; } Error: templatemodule1.cpp:22: error: template-id `module<>' for `int pair::module()' does not match any template declaration templatemodule1.cpp:22: error: syntax error before `{' token _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail