Boost logo

Boost Users :

From: Bjorn Reese (breese_at_[hidden])
Date: 2019-08-26 17:01:40


On 8/26/19 5:39 PM, Phil Endecott via Boost-users 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>>
{
};


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