Boost logo

Geometry :

Subject: [geometry] Adapting a base class
From: Albert Yiamakis (vkicefire_at_[hidden])
Date: 2014-05-08 20:09:23


Hello,

Further to my prior post regarding adapting a model, I am now looking to
do so for an abstract base class. For what it's worth, it is this one:

https://github.com/LaurentGomila/SFML/blob/master/include/SFML/Graphics/Shape.hpp

As per my post in the Boost-users list, I found no other way of having
it model a range than hacking the Boost.Range headers to allow me usage
of enable_if with is_base_of.

The next step was to have it model a geometry. Having it model a
linestring is very simple, since traits::tag features the necessary
second template parameter that permits use of enable_if. However, I was
not able to have it model a ring instead, since traits::point_order and
traits::closure lack this.

If I could repeat my question from the other list: is there another
method that I should be employing to specialize traits for a base class,
so that they apply for all its derived? If not, then should every trait
feature a second template parameter?

Thanks,

Albert


Geometry list run by mateusz at loskot.net