|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-04-09 08:43:42
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!
---- #include <boost/type_traits/is_convertible.hpp> template <class T> struct foo { foo(T); template <class U> foo(foo<U> const& other) : p(other.p) {} T p; }; int main() { return boost::is_convertible<foo<int const*>, foo<int*> >::value; } -- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk