Boost logo

Boost :

Subject: Re: [boost] [Review Request] Inclusion of the Boost.Polygon Voronoi Library
From: Andrii Sydorchuk (sydorchuk.andriy_at_[hidden])
Date: 2012-05-21 06:45:35


On Mon, May 21, 2012 at 2:38 AM, Steven Watanabe <watanabesj_at_[hidden]>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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk