Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-04-09 08:57:52

David Abrahams wrote:
> The following program fails to compile on every version of GCC I can
> find:
> foo.cpp:21: instantiated from `boost::is_convertible<foo<const
> int*>, foo<int*> >' foo.cpp:21: instantiated from here foo.cpp:15:
> invalid conversion from `const int* const' to `int*'
> All other compilers I can find accept it. It looks as though
> is_convertible is looking beyond the declarations of functions into
> their definitions. Commenting out the implementation of foo's
> templated constructor makes it compile!

Just a quick guess: The template cannot be used as a copy ctor, at least
this is what the standard says. It seems to me that the GCC is
generating a copy ctor and than using it instead of the template ctor.
Maybe it is even right to do so :) I currently don't have time to
play with it, but maybe it helps you to find out some more...

Regards, Daniel

Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web:

Boost list run by bdawes at, gregod at, cpdaniel at, john at