Boost logo

Boost Users :

From: Phil Endecott (spam_from_boost_users_at_[hidden])
Date: 2019-08-27 12:39:30


Hi Bjorn,

Bjorn Reese wrote:
>> Can anyone suggest how I can write my specialisations so that they
>> are unambiguous?
>
> By adding another level of indirection. Create your own trait template.
> Let both the generalization and your specialization redirect to
> polygon_traits.
>
> Something like this (warning untested code ahead)
>
> template <typename T, typename Enable = void>
> struct my_polygon_traits
> : public polygon_traits<T, Enable>
> {
> };
>
> template <std::size_t N>
> struct my_polygon_traits<std::array<Point, N>>
> : public polygon_traits<std::array<Point, N>>
> {
> };

Forgive me if I have misunderstood, but how can that cause
Boost.Polygon to see my specialisation when it looks up
polygon_traits<std::array<Point,3>> ?

Regards, Phil.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net