cgal/Cartesian_kernel/include/CGAL/Cartesian
Laurent Rineau 6b51b12ab5 Fix the case when FT is mpq_class
If x and w are mpq_class objects, then the type of x/w is not mpq_class,
but only a proxy type that is implicitly convertible to
mpq_class. With the type deduction, CGAL::make_array(x/w, y/w,
z/w) will not create an array<mpq_class> but an array of the proxy type.

That creates the following compilation error, in a ternary operator:

- with clang:
include/CGAL/Cartesian/Vector_3.h:78:25: error: incompatible operand types ('array<__gmp_expr<[...], struct __gmp_binary_expr<class __gmp_expr<mpq_t, mpq_t>, class __gmp_expr<mpq_t, mpq_t>, struct __gmp_binary_divides>>, [...]>' and 'array<__gmp_expr<[...], __mpq_struct [1]>, [...]>')
    : base( w != FT_(1) ? CGAL::make_array(x/w, y/w, z/w)
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- with g++:
include/CGAL/Cartesian/Vector_3.h:78:25: error: no match for ternary 'operator?:' (operand types are 'bool', 'std::array<__gmp_expr<__mpq_struct [1], __gmp_binary_expr<__gmp_expr<__mpq_struct [1], __mpq_struct [1]>, __gmp_expr<__mpq_struct [1], __mpq_struct [1]>, __gmp_binary_divides> >, 3ul>', and 'std::array<__gmp_expr<__mpq_struct [1], __mpq_struct [1]>, 3ul>')
     : base( w != FT_(1) ? CGAL::make_array(x/w, y/w, z/w)
                         ^

The fix is to specify the template argument of CGAL::make_array.
2013-10-04 16:42:13 +02:00
..
Aff_transformation_2.h
Aff_transformation_3.h
Aff_transformation_rep_2.h
Aff_transformation_rep_3.h
Cartesian_base.h
Circle_2.h
Circle_3.h
Data_accessor_2.h
Direction_2.h
Direction_3.h
Iso_cuboid_3.h
Iso_rectangle_2.h
Line_2.h
Line_3.h
Plane_3.h
Point_2.h
Point_3.h
Ray_2.h
Ray_3.h
Rotation_rep_2.h
Scaling_rep_2.h
Scaling_rep_3.h
Segment_2.h
Segment_3.h
Sphere_3.h
Tetrahedron_3.h
Translation_rep_2.h
Translation_rep_3.h
Triangle_2.h
Triangle_3.h
Vector_2.h
Vector_3.h
basic_constructions_2.h
basic_constructions_3.h
ft_constructions_2.h
ft_constructions_3.h
function_objects.h
line_constructions_2.h
plane_constructions_3.h
point_constructions_2.h
point_constructions_3.h
predicates_on_directions_2.h
predicates_on_planes_3.h
predicates_on_points_2.h
predicates_on_points_3.h
solve_3.h