Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-18 08:09:31


"Ralf W. Grosse-Kunstleve" <rwgk_at_[hidden]> writes:

> There are gcc 2.96 (Redhat 7.3) compilation error for
> boost/libs/python/test/opaque.cpp:
>
> http://cci.lbl.gov/~rwgk/tmp/rc_1_30_0_opaque_fail.txt
>
> More recent gcc's don't seems to suffer from this problem.
> I am not sure this is important enough to delay the release any further.
> David?
>
> Ralf

Hmm, looking at:

# define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \
namespace boost { namespace python { \
    template<> \
    inline type_info type_id(boost::type<Pointee>*) { \
        return type_info (typeid (Pointee *)); \
    } \
    template<> \
    inline type_info type_id( \
        boost::type<const volatile Pointee &>*) { \
        return type_info (typeid (Pointee *)); \
    } \
}}

it seems to me that these aren't actually legal specializations
(though I've never specialized functions before so I could be wrong).
Shouldn't that be:

    template <>
    inline type_info type_id<Pointee>(boost::type<Pointee>*) {
        return type_info(typeid(Pointee*));
    }

    template <>
    inline type_info type_id<const volatile Pointee&>(
        boost::type<const volatile Pointee&>*) {
          return type_info(typeid(Pointee*));
    }

??

In the end, I think I'd much rather see this done with traits that
are checked inside a single type_id<T> implementation rather than
doing it like this, but I think that would be too-radical a change.

It would be nice if Gottfried could try to get something working for
GCC 2.96 before we ship, since RedHat kindly put it on so many
systems.

Gottfried?

-- 
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