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>
Converts between RWMathVec types with different datatypes.
Definition mathvec.h:1368
- Example
#include <rw/math/mathvec.h>
int main() {
s = sin(s);
}
A templatized vector class.
Definition mathvec.h:667
RWConvertMathVec(const RWMathVec< From > &v)
Definition mathvec.h:1375
◆ RWConvertMathVec()
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.
◆ operator RWMathVec< To >()
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.