From 1353793348809205962
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109fba,9aa486e5a5fcf1c1
X-Google-Attributes: gid109fba,public
X-Google-Thread: f78e5,bfc25674b1a4166f
X-Google-Attributes: gidf78e5,public
From: Ron Natalie <ron@sensor.com>
Subject: Re: templated Copy-Constructor?
Date: 2000/04/29
Message-ID: <3909B2EF.F7B23A98@sensor.com>#1/1
X-Deja-AN: 616830220
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <39099e33$0$22977@businessnews.de.uu.net>
X-Accept-Language: en
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Content-Type: text/plain; charset=x-user-defined
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 956937843 mail2news:22647 mail2news mail2news.demon.co.uk
Organization: Sensor Systems
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Mime-Version: 1.0
Newsgroups: comp.lang.c++,comp.std.c++



Stephan Keil wrote:
> 

>   template<class U>
>   Blah(const Blah<U>&)
>   {
>    cout << "Blah" << endl;
>   }
>  };
> 
>  Blah<double> bd(Blah<int>());
>  Blah<int> bi(Blah<int>());
> 

You're not just defining a copy constructor above,
you're defining an constructor that takes an arbitrary type.
Is this what you want?  If you want to define a copy
constructor then :

	Blah(const Blah&) {
	  ...
	}

would have been sufficient.

But getting back to your question.  No, this template member should not
be called.  A non-templated member (even an implicitly generated one)
will be preferred over a templated one.

---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




