Boost logo

Boost :

Subject: Re: [boost] Simple boost polygon boolean OR doesn't work: help needed
From: Praveen Vs (vs.praveen78_at_[hidden])
Date: 2012-02-09 00:12:04


Yes doing that worked. I use the stl 5.2.1

Thanks,

On Thu, Feb 9, 2012 at 10:28 AM, Simonson, Lucanus J
<lucanus.j.simonson_at_[hidden]> wrote:
> The error:
>
> 1>\boost\polygon\polygon_45_set_data.hpp(1458): error C2825: 'iT':
> must be a class or namespace when followed by '::'
> 1>          \boost\polygon\polygon_45_set_data.hpp(1524) : see
> reference to function template instantiation 'void boost::polygon::get_error_rects_shell<cT,const
> boost::polygon::point_data<T>*>(cT &,cT &,iT,iT)'
>
> My code:
>
>  template <typename cT, typename iT>
>  void get_error_rects_shell(cT& posE, cT& negE, iT beginr, iT endr) {
>    typedef typename iT::value_type Point;
>
> The problem is that the iterator is pointer type, and I should have used iterator_traits rather than trying to directly access the member typedef value_type.  Are you compiling with C++11 version of stl?  This should never work for pointer type, yet my tests pass.  It must be the case that every version of the stl that I've tested with implements vector iterator as class type while yours is using pointer type.  Even though I know better, it is hard to catch these kinds of mistakes when tests pass.
>
> The fix is to change iT::value_type to std::iterator_traits<iT>::value_type in line 1458, which you can apply locally.  Assuming that is your only error it should allow you to compile, but I would guess that selecting a different (older?) version of the stl would also work.
>
> Thanks,
> Luke
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

-- 
-praveen

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk