
27 Aug
2019
27 Aug
'19
6:39 a.m.
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.