Boost logo

Boost :

Subject: Re: [boost] [Review Request] Inclusion of the Boost.Polygon Voronoi Library
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2012-05-20 16:48:46


>Making this data field as a template parameter, would add additional complexity to those data structures.
>Also it would imply circular dependency as each of the Voronoi structures needs to know the type of the others two (and they could have different type of data associated with them).
>Plus it wouldn't solve the issue with memory overhead if this member is not required.
>Those are the reasons I consider the mutable void* data member enclosed into precompiler directives to be a better design.

Provided that you make the type of the other two template parameters there is no problem with circular dependency. You must forward declare, of course.

If you make the template parameter for the extra data default to void and make the template parameters for the other two voronoi graph types default then you can make the three types template parameters of voronoi_diagram defaulting to their instantiation with void. This means that you pretty much have to propagate the template parameter through all the code, but it is zero cost if you instantiate with void and would eliminate the macro and error prone void* pointer semantics.

Regards,
Luke


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