Converts between RWMathVec types with different datatypes.
More...
#include <rw/math/mathvec.h>
template<class From, class To>
struct RWConvertMathVec< From, To >
Class RWConvertMathVec converts between RWMathVec types with different datatypes.
- Synopsis
template <class From, class To>
- Example
#include <rw/math/mathvec.h>
int main()
{
s = sin(s);
}
template<class From, class To>
Constructs a new vector of type RWMathVec that can be used anywhere as a type RWMathVec. Note that a temporary array is created every time this constructor is invoked, but the conversion operator below can be used repeatedly without creating additional temporaries.
template<class From, class To>
Automatic conversion operator that enables class RWConvertMathVec to be used as an RWMathVec. While the actual conversion takes place in the constructor, this operator provides a reference to that converted vector.