Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-05 14:19:54


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

> The MIPSpro problems are due to a hickup in is_base_and_derived.hpp.
> Here is the relevant *preprocessed* piece of code:
>
> template <typename B, typename D>
> struct bd_helper
> {
> template <typename T>
> static type_traits::yes_type check(D const volatile *, T);
> static type_traits::no_type check(B const volatile *, int);
> };
>
> template<typename B, typename D>
> struct is_base_and_derived_impl2
> {
> struct Host
> {
> operator B const volatile *() const;
> operator D const volatile *();
> };
>
> static const bool value = sizeof(bd_helper<B,D>:: check(Host(), 0)) ==
> sizeof(type_traits::yes_type);
>
> };
>
> And here is the error:
>
> cc-1108 CC: ERROR File =
> /u1/rwgrosse/rc_1_30_0/boost/boost/type_traits/is_base_and_derived.hpp, Line =
> 106
> The indicated expression must have pointer-to-function type.
>
> static const bool value = sizeof(bd_helper<B,D> ::check(Host(), 0)) ==
> sizeof(type_traits::yes_type);
> ^
>
> Findings:
>
> - Replacing "sizeof(bd_helper<B,D> ::check(Host(), 0))" by "sizeof(int)"
> leads to successful compilation.
>
> - Removing the space before ::check doesn't make a difference.
>
> MIPSpro is based on EDG 238. Are there known issues with "operator T"?
> Ideas for a workaround are highly appreciated.

Try introducing an intermediat typedef:

template<typename B, typename D>
struct is_base_and_derived_impl2
{
    struct Host
    {
        operator B const volatile *() const;
        operator D const volatile *();
    };
    typedef bd_helper<B,D> bdhelper_t;

    static const bool value = sizeof(bd_helper_t::check(Host(), 0)) ==
sizeof(type_traits::yes_type);

};

> Thanks,
> Ralf
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

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