FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
math::PointerVecAccessTag Struct Reference

Tag dispatch for vector coordinates to be accessed with a static constPointer() function. More...

#include <mathtools/vec_traits.h>

Inheritance diagram for math::PointerVecAccessTag:
math::VecAccessTag

Detailed Description

Tag dispatch for vector coordinates to be accessed with a static constPointer() function.

"Pointer" access requires that coordinates of a vector object have to be layout contiguously in memory.

Example :

struct MyVector2D
{
double x;
double y;
};
namespace math {
template<> struct VecAccess<MyVector2D>
{
static double* pointer(MyVector2D& vec) // Optional: required only for mutating algorithms
{ return &vec.x; }
static const double* pointer(const MyVector2D& vec)
{ return &vec.x; }
};
}

The documentation for this struct was generated from the following file: