Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66493 - branches/release/boost/polygon/detail
From: lucanus.j.simonson_at_[hidden]
Date: 2010-11-11 11:49:00


Author: ljsimons
Date: 2010-11-11 11:48:57 EST (Thu, 11 Nov 2010)
New Revision: 66493
URL: http://svn.boost.org/trac/boost/changeset/66493

Log:
missing header
Added:
   branches/release/boost/polygon/detail/polygon_sort_adaptor.hpp (contents, props changed)

Added: branches/release/boost/polygon/detail/polygon_sort_adaptor.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/polygon/detail/polygon_sort_adaptor.hpp 2010-11-11 11:48:57 EST (Thu, 11 Nov 2010)
@@ -0,0 +1,67 @@
+/*
+ Copyright 2008 Intel Corporation
+
+ Use, modification and distribution are subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+*/
+#ifndef BOOST_POLYGON_SORT_ADAPTOR_HPP
+#define BOOST_POLYGON_SORT_ADAPTOR_HPP
+#ifdef __ICC
+#pragma warning(disable:2022)
+#pragma warning(disable:2023)
+#endif
+
+#include <algorithm>
+
+//! @brief gtlsort_adaptor default implementation that calls std::sort
+namespace boost {
+ namespace polygon {
+
+ template<typename iterator_type>
+ struct dummy_to_delay_instantiation{
+ typedef int unit_type; // default GTL unit
+ };
+
+ //! @brief gtlsort_adaptor default implementation that calls std::sort
+ template<typename T>
+ struct gtlsort_adaptor {
+ //! @brief wrapper that mimics std::sort() function and takes
+ // the same arguments
+ template<typename RandomAccessIterator_Type>
+ static void sort(RandomAccessIterator_Type _First,
+ RandomAccessIterator_Type _Last)
+ {
+ std::sort(_First, _Last);
+ }
+ //! @brief wrapper that mimics std::sort() function overload and takes
+ // the same arguments
+ template<typename RandomAccessIterator_Type, typename Pred_Type>
+ static void sort(RandomAccessIterator_Type _First,
+ RandomAccessIterator_Type _Last,
+ const Pred_Type& _Comp)
+ {
+ std::sort(_First, _Last, _Comp);
+ }
+ };
+
+ //! @brief user level wrapper for sorting quantities
+ template <typename iter_type>
+ void gtlsort(iter_type _b_, iter_type _e_)
+ {
+ gtlsort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_);
+ }
+
+ //! @brief user level wrapper for sorting quantities that takes predicate
+ // as additional argument
+ template <typename iter_type, typename pred_type>
+ void gtlsort(iter_type _b_, iter_type _e_, const pred_type& _pred_)
+ {
+ gtlsort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_, _pred_);
+ }
+
+
+
+ } // namespace polygon
+} // namespace boost
+#endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk