Boost logo

Boost Users :

Subject: Re: [Boost-users] Weird compilation error when using boost::geometry
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2017-11-15 11:28:18


Hi Jeremy,

Jeremy Murphy wrote:
> is there any other way around/through this? I am working with a point
> geometry with the same issue: the template type for dimensions is
> 'int' and it would be a lot of hassle to change it.
>

The type in trait specialization has to be specified correctly. So
assuming that you don't want to change the geometry template you should
change the specialization, like this:

 Â Â Â  template<typename T, *int*tDimension = 2>
 Â Â Â  class Point {};

 Â Â Â  // ...

 Â Â Â  template<typename Type, *int*tDimension>
 Â Â Â  struct tag<Point<Type, tDimension>> {
 Â Â Â      typedef point_tag type;
 Â Â Â  };

Adam

>
> On 4 October 2015 at 04:16, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]
> <mailto:adam.wulkiewicz_at_[hidden]>> wrote:
>
> Hi,
>
> 2015-09-19 8:08 GMT+02:00 é‚“å°§ <torshie_at_[hidden]
> <mailto:torshie_at_[hidden]>>:
>
>
>
> template<typename T, *int* tDimension = 2>
>
> class Point {
>
>
> <snip>
>
>
> template<typename Type, *std::size_t* tDimension>
>
> struct tag<::raptor::Point<Type, tDimension>> {
>
> typedef point_tag type;
>
> };
>
>
>
> Different integral types are used for tDimension in Point class
> and traits specializations, after changing e.g. int to std::size_t
> in Point class the code compiles.
>
> Regards,
> Adam
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden] <mailto:Boost-users_at_[hidden]>
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
> <http://lists.boost.org/mailman/listinfo.cgi/boost-users>
>
>



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