From 8dfbe2eba48a47e1160d381352be04d4c6a3eadc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 1 Oct 2014 09:36:10 +0200 Subject: [PATCH] Remove class Range again, and put functionality into iterator_range --- BGL/include/CGAL/iterator_range.h | 60 ++++++++++++++ STL_Extension/include/CGAL/Range.h | 129 ----------------------------- 2 files changed, 60 insertions(+), 129 deletions(-) delete mode 100644 STL_Extension/include/CGAL/Range.h diff --git a/BGL/include/CGAL/iterator_range.h b/BGL/include/CGAL/iterator_range.h index db7e33c000a..2f4e1362275 100644 --- a/BGL/include/CGAL/iterator_range.h +++ b/BGL/include/CGAL/iterator_range.h @@ -60,6 +60,66 @@ namespace CGAL { } }; + template + iterator_range + make_range(const T& b, const T&e) + { + return iterator_range(b,e); + } + + template + inline T range_begin( iterator_range & x ) + { + return x.first; + } + + template + inline T range_end( iterator_range & x ) + { + return x.second; + } + + template + inline T range_begin(const iterator_range& x ) + { + return x.first; + } + + template + inline T range_end(const iterator_range& x ) + { + return x.second; + } } // namespace CGAL +namespace boost { + + template + struct range_iterator; + + template + struct range_mutable_iterator; + + template + struct range_const_iterator; + + template + struct range_iterator > + { + typedef T type; + }; + + + template + struct range_mutable_iterator< CGAL::iterator_range > + { + typedef T type; + }; + + template + struct range_const_iterator< CGAL::iterator_range > + { + typedef T type; + }; +} #endif // CGAL_ITERATOR_RANGE_H diff --git a/STL_Extension/include/CGAL/Range.h b/STL_Extension/include/CGAL/Range.h deleted file mode 100644 index 2222342dd5b..00000000000 --- a/STL_Extension/include/CGAL/Range.h +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2014 GeometryFactory (France). 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; either version 3 of the License, -// or (at your option) any later version. -// -// 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) : Andreas Fabri - -#ifndef CGAL_RANGE_H -#define CGAL_RANGE_H - -#include - -namespace CGAL { - -// Range is a ... - - template - struct Range : public std::pair - { - typedef std::pair Base; - - typedef T iterator; - - Range(const T&b, const T& e) - : Base(b,e) - {} - - const T& begin() const - { - return first; - } - - const T& end() const - { - return second; - } - }; - - template - Range - make_range(const T& b, const T&e) - { - return Range(b,e); - } - - template - inline T range_begin( Range & x ) - { - return x.first; - } - - template - inline T range_end( Range & x ) - { - return x.second; - } - - template - inline T range_begin(const Range& x ) - { - return x.first; - } - - template - inline T range_end(const Range& x ) - { - return x.second; - } -} - -namespace boost { - - template - struct range_iterator; - - template - struct range_mutable_iterator; - - template - struct range_const_iterator; - - template - struct range_iterator > - { - typedef T type; - }; - - - template - struct range_mutable_iterator< CGAL::Range > - { - typedef T type; - }; - - template - struct range_const_iterator< CGAL::Range > - { - typedef T type; - }; - - /* - template - T - begin(const CGAL::Range& r) - { - return r.first; - } - - template - T - end(const CGAL::Range& r) - { - return r.second; - } - */ -} - -#endif // CGAL_RANGE_H