|
Boost : |
From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-06-22 16:13:30
>From: "Daniel Frey" <d.frey_at_[hidden]>
> On Sun, 22 Jun 2003 22:01:19 +0200, Terje Slettebø wrote:
> >
> > Another thing, are the ADD_OPERATOR macro in your code necessary? It
> > compiles fine without it on Intel C++ 7.1.
>
> The GCC doesn't work without the operators, as it doesn't implicitly tries
> to satisfy float*pi_t by casting pi_t to float to use float*float. I
> think this is OK as the language can go for two ways:
>
> a) define float*float and use a promotion/conversion for, say, float*int.
> b) define several operators float*float, float*int, ...
>
> if it's b), the compiler cannot cast pi_t to float as it doesn't know
> whether to select float*float or float*int, thus it fails. Maybe a
> question for the language lawyers over at csc++ to find out what's
> correct.
It's an odd thing, anyway. Both g++ 3.2 and MSVC 7.1 complains that there's
no matching operator*.
> >> Also, I'm not sure whether it's standard compliant code.
> >
> > I think it is. It specialises a member. What could be the problem with
> > this? As you say, errors are caught at link time.
>
> I think that you have to declare the specialization in the class'
> definition, not just outside. But I may be wrong here and I haven't
> checked it.
I don't think so. I tried that, and it gave the error: "error: explicit
specialization is not allowed in the current scope"
Regards,
Terje
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk