Subject: CGAL users discussion list
List archive
- From: "Laurent Rineau (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Why this can be compiled successfully?
- Date: Thu, 30 Jun 2011 17:08:34 +0200
- Organization: GeometryFactory
On jeudi 30 juin 2011 16:58:16 updog wrote:
> #include <iostream>
> #include <fstream>
> #include <CGAL/Cartesian.h>
> #include <CGAL/squared_distance_3.h>
> #include <CGAL/Point_3.h>
> typedef CGAL::Point_3< CGAL::Cartesian<double> > Point;
>
> using std::cout;
> using std::endl;
>
> int main() {
> Point p1, p2;
> double x = squared_distance(p1, p2);
> cout << x << endl;
> return 0;
> }
>
> Note that I forgot to place "CGAL::" before squared_distance(p1,p2), why
> this still can be compiled?
It is a feature of C++:
http://en.wikipedia.org/wiki/Argument-dependent_name_lookup
p1 and p2 are objects of types in the CGAL namespace, and name lookup for
squared_distance searches in that namespace too.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- [cgal-discuss] Why this can be compiled successfully?, updog, 06/30/2011
- Re: [cgal-discuss] Why this can be compiled successfully?, Laurent Rineau (GeometryFactory), 06/30/2011
Archive powered by MHonArc 2.6.16.