Assert

i'm coding on visual c++ 2010. when i include <cassert> and i'm writing assert(lnor == 0) there 's a problem bumping at me "error C2678: binary '==' : no operator found which takes a left-hand operand of type 'vect' (or there is no acceptable conversion)"
Help me please)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void inter(point o, long double r, line l, v(point)& ans) {
	ans.clear();
	long double op = dist(o, l);
	if (mor(fabsl(op), r)) {
		return;
	}
	vect lnor = l.norm();
	assert(lnor == 0);
	vect vop = lnor / lnor.len() * -op;
	point p = o + vop;
	if (equal(fabsl(op), r)) {
		return void(ans.push_back(p));
	}
	vect ldir = l.direct();
	long double ap = cat(r, op);
	vect vpa = ldir / ldir.len() * ap;
	point a = p + vpa, b = p - vpa;
	ans.push_back(a);
	ans.push_back(b);
}
As the error message says, there is no operator== that can compare a vect with 0.
u're great, instead of "lnor" there should have been "lnor.len()" - function which returns the length of a vector)

again, thnx a lot
Topic archived. No new replies allowed.