Server IP : 172.67.216.182 / Your IP : 108.162.227.31 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/boost/boost_1_59_0/boost/sort/spreadsort/ |
Upload File : |
// Templated generic hybrid sorting // Copyright Steven J. Ross 2001 - 2009. // Distributed under 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) // See http://www.boost.org/libs/sort/ for library home page. /* Some improvements suggested by: Phil Endecott and Frank Gennari float_mem_cast fix provided by: Scott McMurray */ #ifndef BOOST_SORT_SPREADSORT_HPP #define BOOST_SORT_SPREADSORT_HPP #include <algorithm> #include <vector> #include <cstring> #include <string> #include <limits> #include <boost/type_traits.hpp> #include <boost/sort/spreadsort/integer_sort.hpp> #include <boost/sort/spreadsort/float_sort.hpp> #include <boost/sort/spreadsort/string_sort.hpp> namespace boost { namespace sort { /*! Namespace for spreadsort sort variants for different data types. \note Use hyperlinks (coloured) to get detailed information about functions. */ namespace spreadsort { /*! \brief Generic @c spreadsort variant detecting integer-type elements so call to @c integer_sort. \details If the data type provided is an integer, @c integer_sort is used. \note Sorting other data types requires picking between @c integer_sort, @c float_sort and @c string_sort directly, as @c spreadsort won't accept types that don't have the appropriate @c type_traits. \param[in] first Iterator pointer to first element. \param[in] last Iterator pointing to one beyond the end of data. \pre [@c first, @c last) is a valid range. \pre @c RandomAccessIter @c value_type is mutable. \pre @c RandomAccessIter @c value_type is <a href="http://en.cppreference.com/w/cpp/concept/LessThanComparable">LessThanComparable</a> \pre @c RandomAccessIter @c value_type supports the @c operator>>, which returns an integer-type right-shifted a specified number of bits. \post The elements in the range [@c first, @c last) are sorted in ascending order. */ template <class RandomAccessIter> inline typename boost::enable_if_c< std::numeric_limits< typename std::iterator_traits<RandomAccessIter>::value_type >::is_integer, void >::type spreadsort(RandomAccessIter first, RandomAccessIter last) { integer_sort(first, last); } /*! \brief Generic @c spreadsort variant detecting float element type so call to @c float_sort. \details If the data type provided is a float or castable-float, @c float_sort is used. \note Sorting other data types requires picking between @c integer_sort, @c float_sort and @c string_sort directly, as @c spreadsort won't accept types that don't have the appropriate @c type_traits. \param[in] first Iterator pointer to first element. \param[in] last Iterator pointing to one beyond the end of data. \pre [@c first, @c last) is a valid range. \pre @c RandomAccessIter @c value_type is mutable. \pre @c RandomAccessIter @c value_type is <a href="http://en.cppreference.com/w/cpp/concept/LessThanComparable">LessThanComparable</a> \pre @c RandomAccessIter @c value_type supports the @c operator>>, which returns an integer-type right-shifted a specified number of bits. \post The elements in the range [@c first, @c last) are sorted in ascending order. */ template <class RandomAccessIter> inline typename boost::enable_if_c< !std::numeric_limits< typename std::iterator_traits<RandomAccessIter>::value_type >::is_integer && std::numeric_limits< typename std::iterator_traits<RandomAccessIter>::value_type >::is_iec559, void >::type spreadsort(RandomAccessIter first, RandomAccessIter last) { float_sort(first, last); } /*! \brief Generic @c spreadsort variant detecting string element type so call to @c string_sort for @c std::strings and @c std::wstrings. \details If the data type provided is a string or wstring, @c string_sort is used. \note Sorting other data types requires picking between @c integer_sort, @c float_sort and @c string_sort directly, as @c spreadsort won't accept types that don't have the appropriate @c type_traits. \param[in] first Iterator pointer to first element. \param[in] last Iterator pointing to one beyond the end of data. \pre [@c first, @c last) is a valid range. \pre @c RandomAccessIter @c value_type is mutable. \pre @c RandomAccessIter @c value_type is <a href="http://en.cppreference.com/w/cpp/concept/LessThanComparable">LessThanComparable</a> \pre @c RandomAccessIter @c value_type supports the @c operator>>, which returns an integer-type right-shifted a specified number of bits. \post The elements in the range [@c first, @c last) are sorted in ascending order. */ template <class RandomAccessIter> inline typename boost::enable_if_c< is_same<typename std::iterator_traits<RandomAccessIter>::value_type, typename std::string>::value || is_same<typename std::iterator_traits<RandomAccessIter>::value_type, typename std::wstring>::value, void >::type spreadsort(RandomAccessIter first, RandomAccessIter last) { string_sort(first, last); } } // namespace spreadsort } // namespace sort } // namespace boost #endif