From d0db66d6e55f2fba8cc5de0e28c20d51a7cd6b1b Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Tue, 9 Dec 2003 12:54:47 +0000 Subject: [PATCH] - Simpler implementation of CGAL_WRAP(). --- Packages/Configuration/changes.txt | 3 + .../include/CGAL/Matching_bug_wrapper.h | 71 ------------------- Packages/Configuration/include/CGAL/config.h | 7 +- 3 files changed, 8 insertions(+), 73 deletions(-) delete mode 100644 Packages/Configuration/include/CGAL/Matching_bug_wrapper.h diff --git a/Packages/Configuration/changes.txt b/Packages/Configuration/changes.txt index 28d0432a55b..6f4d44e3d56 100644 --- a/Packages/Configuration/changes.txt +++ b/Packages/Configuration/changes.txt @@ -1,3 +1,6 @@ +2.86 9/12/2003 +- Simpler implementation of CGAL_WRAP(). + 2.85 4/12/2003 - CGAL_CFG_NO_TEMPLATE_FRIEND_DISTINCTION is now gone. diff --git a/Packages/Configuration/include/CGAL/Matching_bug_wrapper.h b/Packages/Configuration/include/CGAL/Matching_bug_wrapper.h deleted file mode 100644 index bbdb0227b49..00000000000 --- a/Packages/Configuration/include/CGAL/Matching_bug_wrapper.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 1997-2003 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. -// -// $Source$ -// $Revision$ $Date$ -// $Name$ -// -// Author(s) : Michael Hoffmann - -#ifndef CGAL_MATCHING_BUG_WRAPPER_H -#define CGAL_MATCHING_BUG_WRAPPER_H - -CGAL_BEGIN_NAMESPACE - -namespace CGALi { - - // This class is used as a wrapper for template arguments which are - // a model for Kernel: it just replicates the type information. - // This is used to make compilers having MATCHING_BUG_4 accept - // overloaded functions with arguments of type K::some_type. - - template < class K > - struct Matching_bug_wrapper { - typedef typename K::Point_2 Point_2; - typedef typename K::Vector_2 Vector_2; - typedef typename K::Direction_2 Direction_2; - typedef typename K::Line_2 Line_2; - typedef typename K::Ray_2 Ray_2; - typedef typename K::Segment_2 Segment_2; - typedef typename K::Triangle_2 Triangle_2; - typedef typename K::Iso_rectangle_2 Iso_rectangle_2; - typedef typename K::Circle_2 Circle_2; - // this is not yet part of the kernel models: - //typedef typename K::Weighted_point_2 Weighted_point_2; - typedef typename K::Object_2 Object_2; - - typedef typename K::Point_3 Point_3; - typedef typename K::Vector_3 Vector_3; - typedef typename K::Direction_3 Direction_3; - typedef typename K::Line_3 Line_3; - typedef typename K::Ray_3 Ray_3; - typedef typename K::Segment_3 Segment_3; - typedef typename K::Triangle_3 Triangle_3; - typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - typedef typename K::Sphere_3 Sphere_3; - typedef typename K::Plane_3 Plane_3; - typedef typename K::Tetrahedron_3 Tetrahedron_3; - // this is not yet part of the kernel models: - //typedef typename K::Weighted_point_3 Weighted_point_3; - typedef typename K::Object_3 Object_3; - }; - -} - -CGAL_END_NAMESPACE - -#endif // CGAL_MATCHING_BUG_WRAPPER_H diff --git a/Packages/Configuration/include/CGAL/config.h b/Packages/Configuration/include/CGAL/config.h index acd69a0ec11..d042eac9745 100644 --- a/Packages/Configuration/include/CGAL/config.h +++ b/Packages/Configuration/include/CGAL/config.h @@ -107,8 +107,11 @@ // that do not appear when using the wrapper... #if defined(CGAL_CFG_MATCHING_BUG_4) || \ (defined(__sun) && defined(__SUNPRO_CC)) -# define CGAL_WRAP(K) Matching_bug_wrapper -# include +namespace CGAL { + template < typename T > + struct Self { typedef T Type; }; +} +# define CGAL_WRAP(K) CGAL::Self::Type #else # define CGAL_WRAP(K) K #endif