Boost logo

Boost :

From: boost_at_[hidden]
Date: 2001-02-25 19:17:17


Never mind. After finding 3 MSVC template bugs today, I downloaded
the Intel 5.0 compiler, and I must say that so far I like what I see
very much!

It compiles quickly and correctly. It also confirms that the issue I
mentioned below is a MSVC bug - I don't need a confirmation.

If anyone in the Visual C++ team is reading this list - I say watch
out - you've got serious competition! My goal right now is to buy the
Intel compiler and hopefully never have to deal with MSVC again!

Paul Hollingsworth
http://PaulHollingsworth.com

--- In boost_at_y..., boost_at_P... wrote:
> Can someone just confirm that this is a compiler bug (I'm running
> MSVC sp4 I think), for my own sanity?
>
> If a local class called "B" is in the same scope, then B ends up
> being used instead of the template parameter "B" as defined in
> operators.hpp.
>
> I would have thought that the template name should override the non-
> local class definition though.
>
> I suppose I'll just clock it down to a few more hours wasted
> discovering another Microsoft compiler bug:
>
> #include <boost/operators.hpp>
>
> // Uncomment the following class definition to get
> // "error C2676: binary '*' : 'class point' does not define this
> // operator or a conversion to a type acceptable to the predefined
> operator"
>
> // struct B {};
>
> class point
> : boost::addable<point,
> boost::multipliable2<point, float> >
> {
> public:
> point operator+=(const point &rhs)
> {
> return *this;
> }
> point operator*=(float rhs)
> {
> return *this;
> }
> };
>
> int main()
> {
> point a;
> point b;
> a * 5.0f;
> return 0;
> }


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk