Boost logo

Boost :

From: boost_at_[hidden]
Date: 2001-02-25 13:55:16


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