Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Compilation error (bug?): call of overloaded ‘fit_in_double(const CGAL::L azy_exact_nt<CGAL::Gmpq>&, double&)’ is amb iguous

Subject: CGAL users discussion list

List archive

[cgal-discuss] Compilation error (bug?): call of overloaded ‘fit_in_double(const CGAL::L azy_exact_nt<CGAL::Gmpq>&, double&)’ is amb iguous


Chronological Thread 
  • From: maag3377 <>
  • To:
  • Subject: [cgal-discuss] Compilation error (bug?): call of overloaded ‘fit_in_double(const CGAL::L azy_exact_nt<CGAL::Gmpq>&, double&)’ is amb iguous
  • Date: Wed, 12 Jan 2011 00:58:53 -0800 (PST)


Hi,

I believe this is related to the following report:

http://cgal-discuss.949826.n4.nabble.com/CGAL-Python-on-Mac-td3196194.html

I get strange compilation errors when compiling the following code with g++
-c -g cgal.cpp using CGAL 3.7:

//
-------------------------------------------------------------------------------------------------
// cgal.cpp
#include <CGAL/MP_Float.h>
#include <CGAL/Lazy_exact_nt.h>
#include <CGAL/Quotient.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Filtered_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/partition_2.h>
#include <CGAL/Partition_traits_2.h>

typedef
CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq
> > > Kernel;
typedef CGAL::Partition_traits_2<Kernel> Traits;
typedef Traits::Point_2 Point_2;
typedef Traits::Polygon_2 Polygon_2;

void make_polygon(Polygon_2& polygon)
{
polygon.push_back(Point_2(391, 374));
polygon.push_back(Point_2(240, 431));
polygon.push_back(Point_2(252, 340));
polygon.push_back(Point_2(374, 320));
polygon.push_back(Point_2(289, 214));
polygon.push_back(Point_2(134, 390));
polygon.push_back(Point_2( 68, 186));
polygon.push_back(Point_2(154, 259));
polygon.push_back(Point_2(161, 107));
polygon.push_back(Point_2(435, 108));
polygon.push_back(Point_2(208, 148));
polygon.push_back(Point_2(295, 160));
polygon.push_back(Point_2(421, 212));
polygon.push_back(Point_2(441, 303));
}

void partition() {

Polygon_2 polygon;

make_polygon(polygon);

std::list<Polygon_2> result;

Traits partition_traits;

CGAL::greene_approx_convex_partition_2(polygon.vertices_begin(),
polygon.vertices_end(),
std::back_inserter(result),
partition_traits);
}

//--------------------------------------------------------------------------------------------

I get the following errors:

In file included from
/usr/local/include/CGAL/internal/Static_filters/Static_filters.h:38,
from /usr/local/include/CGAL/Filtered_kernel.h:35,
from cgal.cpp:7:
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h: In member
function ‘CGAL::Orientation
CGAL::internal::Static_filters_predicates::Orientation_2<K_base>::operator()(const
typename K_base::Point_2&, const typename K_base::Point_2&, const typename
K_base::Point_2&) const [with K_base =
CGAL::Filtered_kernel_base<CGAL::Type_equality_wrapper<CGAL::Cartesian_base_no_ref_count<CGAL::Lazy_exact_nt<CGAL::Gmpq>,
CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >]’:
/usr/local/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h:436:
instantiated from ‘CGAL::Orientation CGAL::orientation_2(ForwardIterator,
ForwardIterator, const Traits&) [with ForwardIterator =
std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >, Traits =
CGAL::Partition_traits_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >]’
/usr/local/include/CGAL/Partition_2/partition_greene_approx_convex_2.h:815:
instantiated from ‘OutputIterator
CGAL::partition_greene_approx_convex_2(InputIterator, InputIterator,
OutputIterator, const Traits&) [with InputIterator =
std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >, OutputIterator =
std::back_insert_iterator<std::list<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > >,
std::allocator<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > > > > >, Traits =
CGAL::Partition_traits_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >]’
/usr/local/include/CGAL/partition_2.h:37: instantiated from
‘OutputIterator CGAL::greene_approx_convex_partition_2(InputIterator,
InputIterator, OutputIterator, const Traits&) [with InputIterator =
std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >, OutputIterator =
std::back_insert_iterator<std::list<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > >,
std::allocator<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > > > > >, Traits = Traits]’
cgal.cpp:48: instantiated from here
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h:69: error:
call of overloaded ‘fit_in_double(const CGAL::Lazy_exact_nt<CGAL::Gmpq>&,
double&)’ is ambiguous
/usr/local/include/CGAL/internal/Static_filters/tools.h:55: note: candidates
are: bool CGAL::internal::fit_in_double(const T&, double&) [with T =
CGAL::Lazy_exact_nt<CGAL::Gmpq>]
/usr/local/include/CGAL/internal/Static_filters/tools.h:64: note:

bool CGAL::internal::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&)
[with ET = CGAL::Gmpq]
/usr/local/include/CGAL/Lazy_exact_nt.h:1275: note: bool
CGAL::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&) [with ET =
CGAL::Gmpq]
/usr/local/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h:436:
instantiated from ‘CGAL::Orientation CGAL::orientation_2(ForwardIterator,
ForwardIterator, const Traits&) [with ForwardIterator =
std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >, Traits =
CGAL::Partition_traits_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >]’
/usr/local/include/CGAL/Partition_2/partition_greene_approx_convex_2.h:815:
instantiated from ‘OutputIterator
CGAL::partition_greene_approx_convex_2(InputIterator, InputIterator,
OutputIterator, const Traits&) [with InputIterator =
std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >, OutputIterator =
std::back_insert_iterator<std::list<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > >,
std::allocator<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > > > > >, Traits =
CGAL::Partition_traits_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >]’
/usr/local/include/CGAL/partition_2.h:37: instantiated from
‘OutputIterator CGAL::greene_approx_convex_partition_2(InputIterator,
InputIterator, OutputIterator, const Traits&) [with InputIterator =
std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > >, OutputIterator =
std::back_insert_iterator<std::list<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > >,
std::allocator<CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true>,
std::list<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq>
>, true> > > > > > > >, Traits = Traits]’
cgal.cpp:48: instantiated from here
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h:69: error:
call of overloaded ‘fit_in_double(const CGAL::Lazy_exact_nt<CGAL::Gmpq>&,
double&)’ is ambiguous
/usr/local/include/CGAL/internal/Static_filters/tools.h:55: note: candidates
are: bool CGAL::internal::fit_in_double(const T&, double&) [with T =
CGAL::Lazy_exact_nt<CGAL::Gmpq>]
/usr/local/include/CGAL/internal/Static_filters/tools.h:64: note:

bool CGAL::internal::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&)
[with ET = CGAL::Gmpq]
/usr/local/include/CGAL/Lazy_exact_nt.h:1275: note: bool
CGAL::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&) [with ET =
CGAL::Gmpq]
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h:69: error:
call of overloaded ‘fit_in_double(const CGAL::Lazy_exact_nt<CGAL::Gmpq>&,
double&)’ is ambiguous
/usr/local/include/CGAL/internal/Static_filters/tools.h:55: note: candidates
are: bool CGAL::internal::fit_in_double(const T&, double&) [with T =
CGAL::Lazy_exact_nt<CGAL::Gmpq>]
/usr/local/include/CGAL/internal/Static_filters/tools.h:64: note:

bool CGAL::internal::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&)
[with ET = CGAL::Gmpq]
/usr/local/include/CGAL/Lazy_exact_nt.h:1275: note: bool
CGAL::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&) [with ET =
CGAL::Gmpq]
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h:69: error:
call of overloaded ‘fit_in_double(const CGAL::Lazy_exact_nt<CGAL::Gmpq>&,
double&)’ is ambiguous
/usr/local/include/CGAL/internal/Static_filters/tools.h:55: note: candidates
are: bool CGAL::internal::fit_in_double(const T&, double&) [with T =
CGAL::Lazy_exact_nt<CGAL::Gmpq>]
/usr/local/include/CGAL/internal/Static_filters/tools.h:64: note:

bool CGAL::internal::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&)
[with ET = CGAL::Gmpq]
/usr/local/include/CGAL/Lazy_exact_nt.h:1275: note: bool
CGAL::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&) [with ET =
CGAL::Gmpq]
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h:69: error:
call of overloaded ‘fit_in_double(const CGAL::Lazy_exact_nt<CGAL::Gmpq>&,
double&)’ is ambiguous
/usr/local/include/CGAL/internal/Static_filters/tools.h:55: note: candidates
are: bool CGAL::internal::fit_in_double(const T&, double&) [with T =
CGAL::Lazy_exact_nt<CGAL::Gmpq>]
/usr/local/include/CGAL/internal/Static_filters/tools.h:64: note:

bool CGAL::internal::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&)
[with ET = CGAL::Gmpq]
/usr/local/include/CGAL/Lazy_exact_nt.h:1275: note: bool
CGAL::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&) [with ET =
CGAL::Gmpq]
/usr/local/include/CGAL/internal/Static_filters/Orientation_2.h:69: error:
call of overloaded ‘fit_in_double(const CGAL::Lazy_exact_nt<CGAL::Gmpq>&,
double&)’ is ambiguous
/usr/local/include/CGAL/internal/Static_filters/tools.h:55: note: candidates
are: bool CGAL::internal::fit_in_double(const T&, double&) [with T =
CGAL::Lazy_exact_nt<CGAL::Gmpq>]
/usr/local/include/CGAL/internal/Static_filters/tools.h:64: note:

bool CGAL::internal::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&)
[with ET = CGAL::Gmpq]
/usr/local/include/CGAL/Lazy_exact_nt.h:1275: note: bool
CGAL::fit_in_double(const CGAL::Lazy_exact_nt<ET>&, double&) [with ET =
CGAL::Gmpq]

There is an ambiguous call to fit_in_double() which is defined in
CGAL/internal/Static_filters/tools.h.

Looking in that file, the declaration in the end of the file

inline bool fit_in_double(const Lazy_exact_nt<ET>&, double&);

seems to clash with the definition

inline bool fit_in_double(const T&, double&) { return false; }

further up in the file.

When I uncomment the declaration and rebuild CGAL everything compiles fine.

What is your idea on this?

Regards,

Magnus


--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Compilation-error-bug-call-of-overloaded-fit-in-double-const-CGAL-Lazy-exact-nt-CGAL-Gmpq-double-is-s-tp3213552p3213552.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page