Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10033 closed Bugs (fixed)

scale_down on rectangle does not compile

Reported by: Jakob Schou Jensen <jakob.schou.jensen@…> Owned by: Andrii Sydorchuk
Milestone: Boost 1.56.0 Component: polygon
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

I get a compile error when calling scale_down on a rectangle: eg:

rectangle_data<int> r;
scale_down( r, 2 );
/Users/schou/frameworks/boost_1_55_0/boost/polygon/rectangle_concept.hpp:984:25: error: no matching function for
      call to 'scale_down'
    vertical(rectangle, scale_down(vertical(rectangle), factor));
                        ^~~~~~~~~~
/Users/schou/frameworks/boost_1_55_0/boost/polygon/interval_concept.hpp:386:10: note: candidate function [with
      IntervalType = boost::polygon::interval_data<int>] not viable: expects an l-value for 1st argument
>::type& scale_down(
         ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/point_concept.hpp:395:3: note: candidate template ignored:
      disabled by 'enable_if' [with PointType = boost::polygon::interval_data<int>, CType = unsigned long long]
  typename gtl_and<
  ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/rectangle_concept.hpp:979:22: note: candidate template
      ignored: disabled by 'enable_if' [with rectangle_type = boost::polygon::interval_data<int>]
  typename enable_if<typename gtl_and<y_r_scale_down, typename is_mutable_rectangle_concept<typename geo...
                     ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/segment_concept.hpp:437:3: note: candidate template ignored:
      disabled by 'enable_if' [with Segment = boost::polygon::interval_data<int>]
  typename gtl_and<
  ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/polygon_traits.hpp:735:5: note: candidate template ignored:
      disabled by 'enable_if' [with polygon_type = boost::polygon::interval_data<int>]
    typename gtl_and< typename is_any_mutable_polygon_without_holes_type<polygon_type>::type,
    ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/polygon_traits.hpp:870:5: note: candidate template ignored:
      disabled by 'enable_if' [with polygon_type = boost::polygon::interval_data<int>]
    typename gtl_and< typename is_any_mutable_polygon_without_holes_type<polygon_type>::type,
    ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/polygon_traits.hpp:889:23: note: candidate template ignored:
      disabled by 'enable_if' [with T = boost::polygon::interval_data<int>]
  typename enable_if< typename is_any_mutable_polygon_with_holes_type<T>::type, T>::type &
                      ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/polygon_90_set_concept.hpp:437:23: note: candidate template
      ignored: disabled by 'enable_if' [with polygon_set_type = boost::polygon::interval_data<int>]
  typename enable_if< typename is_mutable_polygon_90_set_type<polygon_set_type>::type,
                      ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/polygon_45_set_concept.hpp:248:23: note: candidate template
      ignored: disabled by 'enable_if' [with polygon_set_type = boost::polygon::interval_data<int>]
  typename enable_if< typename is_mutable_polygon_45_set_type<polygon_set_type>::type,
                      ^
/Users/schou/frameworks/boost_1_55_0/boost/polygon/polygon_set_concept.hpp:237:23: note: candidate template
      ignored: disabled by 'enable_if' [with polygon_set_type = boost::polygon::interval_data<int>]
  typename enable_if< typename is_mutable_polygon_set_type<polygon_set_type>::type,
                      ^
2 errors generated.

I am compiling on mac osx maverics.

Attachments (1)

10033.patch (1.6 KB ) - added by Andrii Sydorchuk 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Andrii Sydorchuk, 8 years ago

Owner: changed from Lucanus Simonson to Andrii Sydorchuk

comment:2 by Andrii Sydorchuk, 8 years ago

Jakob, thank you for the report. Can you also provide the compiler you are using and the command prompt?

comment:3 by Jakob Schou Jensen <jakob.schou.jensen@…>, 8 years ago

The compiler is:

   > clang++ --version
   Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
   Target: x86_64-apple-darwin13.1.0
   Thread model: posix

I compile this main.cpp file:

   #include <boost/polygon/polygon.hpp>
   using namespace boost::polygon;                                                                              

   int main() {
     rectangle_data<int> r;                                                                                     
     scale_down( r, 2 );                                                                                        

     return 0;                                                                                                  
   }

With this command line:

   > clang++ -I <path to boost>/boost_1_55_0/ main.cpp

comment:4 by Andrii Sydorchuk, 8 years ago

I've fixed scale_up and scale_down methods for rectangle concept. Please find the patch attached or use the latest master branch of Polygon repo on github: https://github.com/boostorg/polygon.

by Andrii Sydorchuk, 8 years ago

Attachment: 10033.patch added

comment:5 by Andrii Sydorchuk, 8 years ago

Milestone: To Be DeterminedBoost 1.56.0
Resolution: fixed
Status: newclosed

comment:6 by Jakob Schou Jensen <jakob.schou.jensen@…>, 8 years ago

Thanks!

Note: See TracTickets for help on using tickets.