![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/thread-self/root/usr/include/boost/polygon/detail/ |
Upload File : |
/* 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 polygon_sort_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 polygon_sort_adaptor default implementation that calls std::sort template<typename T> struct polygon_sort_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 polygon_sort(iter_type _b_, iter_type _e_) { polygon_sort_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 polygon_sort(iter_type _b_, iter_type _e_, const pred_type& _pred_) { polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_, _pred_); } } // namespace polygon } // namespace boost #endif