Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-05-10 03:47:07


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave,

Sorry for my ignorance, but ..

On Friday 10 May 2002 10:23, David Abrahams wrote:
> You're testing assignability, which is a different question. Try:
>
> void f(A<B>);
> int main()
> {
> f(A<C>());
> }

assign.cpp(9): error: no suitable user-defined conversion from "const A<C>" to
"B" exists
      A( A<T1> const& rhs ) : T( rhs ) {}
                                 ^
detected during instantiation of "A<T>::A(const A<T1> &) [with T=B, T1=C]"

compilation aborted for assign.cpp (code 2)

I think the compiler is right in rejecting this. What did I miss ?

Thomas

- --
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE824kP0ds/gS3XsBoRAlD6AJ46QeugYNF9QPWO1VAOPr5koAl10wCcD65u
BHHgruUePBYGlcNMifiBMoU=
=v9ju
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk