fork(1) download
  1. #include <cassert>
  2. #include <iostream>
  3.  
  4. #include <boost/polygon/polygon.hpp>
  5.  
  6. using namespace boost::polygon::operators;
  7.  
  8. int main() {
  9. //lets construct a 10x10 rectangle shaped polygon
  10. typedef boost::polygon::polygon_data<float> Polygon;
  11. typedef boost::polygon::polygon_traits<Polygon>::point_type Point;
  12. Point pts[] = {
  13. boost::polygon::construct<Point>(0, 0),
  14. boost::polygon::construct<Point>(1, 0),
  15. boost::polygon::construct<Point>(1, 1),
  16. boost::polygon::construct<Point>(0, 1) };
  17.  
  18. Polygon poly;
  19. boost::polygon::set_points(poly, pts, pts+4);
  20.  
  21. std::cout << "Area: " << boost::polygon::area(poly) << std::endl;
  22.  
  23. poly += 1; // no match for += operator
  24.  
  25. std::cout << "Area: " << boost::polygon::area(poly) << std::endl;
  26.  
  27. return 0;
  28. }
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:23:10: error: no match for 'operator+=' (operand types are 'Polygon {aka boost::polygon::polygon_data<float>}' and 'int')
     poly += 1; // no match for += operator
          ^
In file included from /usr/include/boost/polygon/polygon_90_set_concept.hpp:550:0,
                 from /usr/include/boost/polygon/polygon.hpp:67,
                 from prog.cpp:4:
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:364:3: note: candidate: template<class coordinate_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and<boost::polygon::operators::y_ps90_pe, typename boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type, boost::polygon::polygon_90_set_data<coordinate_type> >::type& boost::polygon::operators::operator+=(boost::polygon::polygon_90_set_data<coordinate_type>&, const geometry_type_2&)
   operator+=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
   ^
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:364:3: note:   template argument deduction/substitution failed:
prog.cpp:23:10: note:   'Polygon {aka boost::polygon::polygon_data<float>}' is not derived from 'boost::polygon::polygon_90_set_data<coordinate_type>'
     poly += 1; // no match for += operator
          ^
In file included from /usr/include/boost/polygon/polygon_90_set_concept.hpp:550:0,
                 from /usr/include/boost/polygon/polygon.hpp:67,
                 from prog.cpp:4:
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:386:3: note: candidate: template<class geometry_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps90_pe2, typename boost::polygon::is_mutable_polygon_90_set_type<T>::type, typename boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&)
   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
   ^
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:386:3: note:   template argument deduction/substitution failed:
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp: In substitution of 'template<class geometry_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps90_pe2, typename boost::polygon::is_mutable_polygon_90_set_type<T>::type, typename boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = boost::polygon::polygon_data<float>; geometry_type_2 = int]':
prog.cpp:23:10:   required from here
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:386:3: error: no type named 'type' in 'struct boost::enable_if<mpl_::bool_<false>, boost::polygon::polygon_data<float> >'
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:447:3: note: candidate: template<class geometry_type_1, class coordinate_type_1> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps90_rpe, typename boost::polygon::is_mutable_polygon_90_set_type<T>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<PointType2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1)
   operator+=(geometry_type_1& lvalue, coordinate_type_1 rvalue) {
   ^
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:447:3: note:   template argument deduction/substitution failed:
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp: In substitution of 'template<class geometry_type_1, class coordinate_type_1> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps90_rpe, typename boost::polygon::is_mutable_polygon_90_set_type<T>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<PointType2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1) [with geometry_type_1 = boost::polygon::polygon_data<float>; coordinate_type_1 = int]':
prog.cpp:23:10:   required from here
/usr/include/boost/polygon/detail/polygon_90_set_view.hpp:447:3: error: no type named 'type' in 'struct boost::enable_if<mpl_::bool_<false>, boost::polygon::polygon_data<float> >'
In file included from /usr/include/boost/polygon/polygon_45_set_concept.hpp:440:0,
                 from /usr/include/boost/polygon/polygon.hpp:76,
                 from prog.cpp:4:
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp:274:3: note: candidate: template<class geometry_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and_4<boost::polygon::operators::y_ps45_pe, typename boost::polygon::is_mutable_polygon_45_set_type<T>::type, boost::polygon::gtl_yes, typename boost::polygon::is_polygon_45_or_90_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&)
   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
   ^
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp:274:3: note:   template argument deduction/substitution failed:
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp: In substitution of 'template<class geometry_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and_4<boost::polygon::operators::y_ps45_pe, typename boost::polygon::is_mutable_polygon_45_set_type<T>::type, boost::polygon::gtl_yes, typename boost::polygon::is_polygon_45_or_90_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = boost::polygon::polygon_data<float>; geometry_type_2 = int]':
prog.cpp:23:10:   required from here
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp:274:3: error: no type named 'type' in 'struct boost::enable_if<mpl_::bool_<false>, boost::polygon::polygon_data<float> >'
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp:337:3: note: candidate: template<class geometry_type_1, class coordinate_type_1> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps45_rpe, typename boost::polygon::is_mutable_polygon_45_set_type<T>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<PointType2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1)
   operator+=(geometry_type_1& lvalue, coordinate_type_1 rvalue) {
   ^
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp:337:3: note:   template argument deduction/substitution failed:
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp: In substitution of 'template<class geometry_type_1, class coordinate_type_1> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps45_rpe, typename boost::polygon::is_mutable_polygon_45_set_type<T>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<PointType2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1) [with geometry_type_1 = boost::polygon::polygon_data<float>; coordinate_type_1 = int]':
prog.cpp:23:10:   required from here
/usr/include/boost/polygon/detail/polygon_45_set_view.hpp:337:3: error: no type named 'type' in 'struct boost::enable_if<mpl_::bool_<false>, boost::polygon::polygon_data<float> >'
In file included from /usr/include/boost/polygon/polygon_set_data.hpp:1003:0,
                 from /usr/include/boost/polygon/polygon.hpp:81,
                 from prog.cpp:4:
/usr/include/boost/polygon/polygon_set_concept.hpp:387:3: note: candidate: template<class geometry_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and_4<boost::polygon::operators::yes_ps_ope, boost::polygon::gtl_yes, typename boost::polygon::is_mutable_polygon_set_type<T>::type, typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&)
   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
   ^
/usr/include/boost/polygon/polygon_set_concept.hpp:387:3: note:   template argument deduction/substitution failed:
/usr/include/boost/polygon/polygon_set_concept.hpp: In substitution of 'template<class geometry_type_1, class geometry_type_2> typename boost::enable_if<typename boost::polygon::gtl_and_4<boost::polygon::operators::yes_ps_ope, boost::polygon::gtl_yes, typename boost::polygon::is_mutable_polygon_set_type<T>::type, typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = boost::polygon::polygon_data<float>; geometry_type_2 = int]':
prog.cpp:23:10:   required from here
/usr/include/boost/polygon/polygon_set_concept.hpp:387:3: error: no type named 'type' in 'struct boost::enable_if<mpl_::bool_<false>, boost::polygon::polygon_data<float> >'
/usr/include/boost/polygon/polygon_set_concept.hpp:451:3: note: candidate: template<class geometry_type_1, class coordinate_type_1> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps_rpe, typename boost::polygon::is_mutable_polygon_set_type<T>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<PointType2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1)
   operator+=(geometry_type_1& lvalue, coordinate_type_1 rvalue) {
   ^
/usr/include/boost/polygon/polygon_set_concept.hpp:451:3: note:   template argument deduction/substitution failed:
/usr/include/boost/polygon/polygon_set_concept.hpp: In substitution of 'template<class geometry_type_1, class coordinate_type_1> typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps_rpe, typename boost::polygon::is_mutable_polygon_set_type<T>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<PointType2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1) [with geometry_type_1 = boost::polygon::polygon_data<float>; coordinate_type_1 = int]':
prog.cpp:23:10:   required from here
/usr/include/boost/polygon/polygon_set_concept.hpp:451:3: error: no type named 'type' in 'struct boost::enable_if<mpl_::bool_<false>, boost::polygon::polygon_data<float> >'
stdout
Standard output is empty