public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Sieb <sieb@sscd.de>
To: gcc@gcc.gnu.org
Subject: Re: template question
Date: Wed, 04 Dec 2002 09:24:00 -0000	[thread overview]
Message-ID: <3DEE39F6.62778767@sscd.de> (raw)
In-Reply-To: <3DEE2694.FBF94866@physics.uoregon.edu>

Zoltan Nagy wrote:
> 
> Hi,
> 
> I tried to compile the small code below using the g++-3.2.1 but I got
> the following error message:
> 
> test.cc: In member function `void C<TTT>::ff() [with TTT = double]':
> test.cc:31:   instantiated from here
> test.cc:20: no matching function for call to `A<double>::f(B<const
> double&, double>&, double&)'
> 
> Is it a bug in the compiler or I do something wrong?
> 


Seems like T1 is ambiguous. 

  template<class T1, class T2>
  void f(const B<T1,T2>&, T1){}
                 ^^       ^^
                 ||       ||
 const double& from b.   double from function call
                      ||
                      \/
              What should T1 really be?

In b you define what becomes T1 as const double& while in the member function call
the second parameter is double. T1 cannot be both at the same time.

-- 
Regards,
	Alexander

  reply	other threads:[~2002-12-04 17:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-04  8:00 Zoltan Nagy
2002-12-04  9:24 ` Alexander Sieb [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-10-14 21:17 Satish
1998-10-29 19:35 ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DEE39F6.62778767@sscd.de \
    --to=sieb@sscd.de \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).