Subject: CGAL users discussion list
List archive
- From: "Ophir Setter" <>
- To: ,
- Subject: Re: (Strange) compile error concerning namespaces and Voronoi_diagram_2
- Date: Sat, 15 Dec 2007 18:39:41 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=Cp6rycftGrhGCln7HTQuUofLOWVmYMJd6uu6j8s+LN7yJR83J9GvLv+ZZ/a0H3jL9+52r+e4KcFeYnzOHS7g28cesB512H17cIRWXv1IpYNA5Jz9gwcpkNqB2PNI12b3nsx6F8T7AMA3D6HsMlDLo+45JtpRIMB+wg4Jp4z8CRk=
Found the problem.
CGAL/Voronoi_diagram_2/short_names_2.h:24
#define Voronoi_diagram_2 Vd2
So you can really create even a regular class with the name of Voronoi_diagram_2...
namespace_bug.cpp:33: error: 'Vd2' in namespace '::' does not name a type
make: *** [namespace_bug.o] Error 1
On Dec 15, 2007 6:21 PM, Ophir Setter <> wrote:
Hello,
I've tried to define another Voronoi_diagram_2 class. Since there is one already I've created a namespace and put my class inside it. I get strange error when trying to instantiate both of the classes.
The attached file generate the error. Pay attention to the fact that this DOES NOT happen with std::list - the reason should be somewhere inside the CGAL code.
namespace_bug.cpp:39: error: expected initializer before '<' token
make: *** [namespace_bug.o] Error 1
Ophir
class Voronoi_diagram_2 { }; namespace std { namespace A { template <typename T> class list { }; } } #include <list> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/Voronoi_diagram_2.h> #include <CGAL/Delaunay_triangulation_adaptation_traits_2.h> #include <CGAL/Delaunay_triangulation_adaptation_policies_2.h> typedef std::list<int> lint; typedef std::A::list<int> sint; typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Delaunay_triangulation_2<K> DT; typedef CGAL::Delaunay_triangulation_adaptation_traits_2<DT> AT; typedef CGAL::Delaunay_triangulation_caching_degeneracy_removal_policy_2<DT> AP; typedef CGAL::Voronoi_diagram_2<DT,AT,AP> VD; typedef ::Voronoi_diagram_2 AVD; int main () { VD vd; return 0; }
- (Strange) compile error concerning namespaces and Voronoi_diagram_2, Ophir Setter, 12/15/2007
- Re: (Strange) compile error concerning namespaces and Voronoi_diagram_2, Ophir Setter, 12/15/2007
Archive powered by MHonArc 2.6.16.