Boost logo

Boost :

Subject: Re: [boost] [polygon] examplefile compilation failed
From: J Stark (boost_at_[hidden])
Date: 2014-07-08 15:04:47

Hello Boost Polygon Folk,

First off, I have to say, boost polygon is pretty great. Thanks for all the
hard work you've put into it.

I'm replying to a forum message here:

which notes that the example files don't compile. It was posted in 2009.

I'm noticing that the example here:
still doesn't compile properly on a mac using Apple LLVM version 5.0

I think the examples are extremely important, as template programming can be
confusing all by itself, and so having a working example to start with is
really a time saver.

Does this example work properly with other compilers making it hard to fix
for the universal/general case?

It seems that the original post from 2009 contains the fix that works;
"typedef int coordinate_type;" needs to be inserted in point_mutable_traits
like so:

  template <>
  struct point_mutable_traits<CPoint> {
    typedef int coordinate_type;
    static inline void set(CPoint& point, orientation_2d orient, int value)
      if(orient == HORIZONTAL)
        point.x = value;
        point.y = value;
    static inline CPoint construct(int x_value, int y_value) {
      CPoint retval;
      retval.x = x_value;
      retval.y = y_value;
      return retval;
} }

My question is if the documentation example here:

can be updated to include this fix, and save time for folks who are trying
to get that example to work, or if this solution isn't valid for some
combination of other more popular compilers?

Thanks again for all the hard work on the library, and very best of regards,


PS: please advise if I'm posting to the wrong forum, sending mail in the
wrong way, or in any way going at this the wrong way :) I have more
questions/concerns to follow up with :)

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at