![]() |
Blitz Support : |
From: Dawson, Paul (UK Filton) (paul.dawson3_at_[hidden])
Date: 2005-03-09 08:47:05
Sorry if this question has come up before, but I've had a long search of the archive, and I can't seem to answer it.
I have a templated class Point<S> which inherits from TinyVector<S,3>.
When I do something like:
Point<S> myFunction() {
Point<S> p1;
Point<S> p2;
..
..
return p1 - p2;
}
I get an error to the effect that the result of p1 - p2 is not of type Point, but a blitz vector expression.
I can avoid this error by casting the return to a Point i.e. "return static_cast<Point>(p1 -p2);", but it seems to me that I might be losing the efficiency that comes from using vector expressions, and also making the code harder to understand.
If I do the same thing using tinyvectors explicitly, I don't have the same problem. I don't understand why my derived Point class does not have the same behaviour.
Many thanks, Paul.
---------------------------
Paul Dawson
paul.dawson3_at_[hidden]
0117 302 8311
---------------------------
Paul Dawson
paul.dawson3_at_[hidden]
0117 302 8311
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************