Remove unused CGAL_CFG_NO_KOENIG_LOOKUP.

This commit is contained in:
Sylvain Pion 2007-05-07 18:12:21 +00:00
parent a866172e6f
commit 4606a1bdf1
4 changed files with 0 additions and 113 deletions

View File

@ -1,21 +0,0 @@
namespace A {
class Cls {};
bool
foo(const Cls&)
{ return true; }
} // namespace A
bool
foo(int)
{ return false; }
int
main()
{
A::Cls c;
foo( c ); // Koenig lookup finds A::foo(const Cls&)
return 0;
}

View File

@ -118,41 +118,6 @@ name and no scope resolution%
name lookup, but name lookup for a function call is supposed to search also name lookup, but name lookup for a function call is supposed to search also
the namespaces of the argument types for a matching function name. the namespaces of the argument types for a matching function name.
This is sometimes called Koenig-lookup.\ccIndexMainItem{Koenig lookup} This is sometimes called Koenig-lookup.\ccIndexMainItem{Koenig lookup}
\cgal\ checks for Koenig-lookup. If this is not available,
the flag \ccc{CGAL_CFG_NO_KOENIG_LOOKUP}%
\index{CGAL_CFG_NO_KOENIG_LOOKUP flag@{\tt CGAL\_CFG\_NO\_KOENIG\_LOOKUP} flag}
is set. As a workaround,
you can add matching function(s) with the same name in the using namespace;
most likely, this will be the global scope.
Here is an example:
\ccIncludeVerbatim{Developers_manual/kl.cpp}
While \verb+gcc+ doesn't have problems with correctly compiling the program
above, the MipsPro compiler on {\sc IRIX} (up till version 7.30) does not
implement Koenig lookup, so it fails:
{\small
\begin{verbatim}
bash-2.03$ CC -64 kl.cpp
cc-1387 CC: ERROR File = kl.cpp, Line = 19
No suitable conversion function from "A::Cls" to "int" exists.
foo( c );
^
1 error detected in the compilation of "kl.cpp".
\end{verbatim}
}
Workaround for missing Koenig lookup:\ccIndexSubitem{Koenig lookup}{workaround}
Define
\begin{verbatim}
bool
foo( const A::Cls& cls)
{ return A::foo( cls); }
\end{verbatim}
in global scope, too.
\subsection{Point of instantiation of a template} \subsection{Point of instantiation of a template}
Name lookup in a template is slightly more complicated. Name lookup in a template is slightly more complicated.

View File

@ -1,55 +0,0 @@
// Copyright (c) 1997 Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : various
// ---------------------------------------------------------------------
// A short test program to evaluate a C++ compiler.
// This program is used by install_cgal.
// The following documentation will be pasted in the generated configfile.
// ---------------------------------------------------------------------
//| This flag is set if the compiler doesn't support the operator Koenig
//| lookup. That is, it does not search in the namespace of the arguments for
//| the function.
namespace A {
struct S {};
void foo(const S &) {}
}
namespace B {
// using A::foo;
void bar()
{
A::S s;
foo(s);
}
}
int main()
{
B::bar();
return 0;
}

View File

@ -47,7 +47,6 @@ orientation(const Point_2<use_rat_leda_kernel>& p,
*/ */
} }
// #ifdef CGAL_CFG_NO_KOENIG_LOOKUP
template <class use_rat_leda_kernel> template <class use_rat_leda_kernel>
inline inline
bool bool
@ -67,7 +66,6 @@ collinear(const Point_2<use_rat_leda_kernel>& p,
(const use_rat_leda_kernel::Point_2_base&)r); (const use_rat_leda_kernel::Point_2_base&)r);
*/ */
} }
// #endif // CGAL_CFG_NO_KOENIG_LOOKUP
CGAL_END_NAMESPACE CGAL_END_NAMESPACE