
On Mon, May 21, 2012 at 2:38 AM, Steven Watanabe <watanabesj@gmail.com>wrote:
One solution is to wrap/unwrap the void* around the algorithm, so that the implementation sees void*, but the user sees whatever his real type is. Not having looked at the interface in question at all, I don't know whether this technique is applicable, but it's something to think about.
The main point is that this void* data member is not used by the algorithm at all. And is only exposed to simplify data association with voronoi primitives.
From the user perspective the good practice would be to use data access functions instead of direct class methods to retrieve associated data:
template <typename T> UserDataType* data(const voronoi_edge<T>& edge) { return static_cast<UserDataType*>(edge.data()); } Regards, Andrii