Skip to Content.
Sympa Menu

cgal-discuss - (Strange) compile error concerning namespaces and Voronoi_diagram_2

Subject: CGAL users discussion list

List archive

(Strange) compile error concerning namespaces and Voronoi_diagram_2


Chronological Thread 
  • From: "Ophir Setter" <>
  • To: ,
  • Subject: (Strange) compile error concerning namespaces and Voronoi_diagram_2
  • Date: Sat, 15 Dec 2007 18:21:07 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=JYKeqJa1UbsXTslzQlxXKsGBuwWKJQMv5PkVRm8fHgqz3rCWCyBiewdWXbKRLPzwJfXBwqVhwY2SaGojhamYdk5fODL72etzX15TshJ6Hq3Nmx4dZTOLWUy7U1DjxUlucXt9fpv5BAj4eN9oRiNMs2gsl8C5+wyU2rs9pYXcDCo=

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
namespace CGAL
{
  namespace A
  {
    template <class T>
    class Voronoi_diagram_2
    {
    };
  }
}

namespace std
{
  namespace A
  {
    template <class 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 CGAL::A::Voronoi_diagram_2<int>     AVD;

int main ()
{
  
  VD vd;

  return 0;
}



Archive powered by MHonArc 2.6.16.

Top of Page