mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 14:54:30 +02:00
MSVC6 and Borland workarounds.
[SVN r20798]
This commit is contained in:
@@ -17,9 +17,10 @@
|
|||||||
#ifndef BOOST_MPL_AUX_SORT_IMPL_HPP_INCLUDED
|
#ifndef BOOST_MPL_AUX_SORT_IMPL_HPP_INCLUDED
|
||||||
#define BOOST_MPL_AUX_SORT_IMPL_HPP_INCLUDED
|
#define BOOST_MPL_AUX_SORT_IMPL_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include "boost/mpl/aux_/select1st_wknd.hpp"
|
||||||
|
#include "boost/mpl/aux_/select2nd_wknd.hpp"
|
||||||
#include "boost/mpl/apply.hpp"
|
#include "boost/mpl/apply.hpp"
|
||||||
#include "boost/mpl/apply_if.hpp"
|
#include "boost/mpl/apply_if.hpp"
|
||||||
#include "boost/mpl/bind.hpp" // for bind2nd
|
|
||||||
#include "boost/mpl/copy_backward.hpp"
|
#include "boost/mpl/copy_backward.hpp"
|
||||||
#include "boost/mpl/empty.hpp"
|
#include "boost/mpl/empty.hpp"
|
||||||
#include "boost/mpl/front.hpp"
|
#include "boost/mpl/front.hpp"
|
||||||
@@ -36,6 +37,17 @@ namespace aux {
|
|||||||
|
|
||||||
template < typename Sequence, typename Predicate > struct quick_sort;
|
template < typename Sequence, typename Predicate > struct quick_sort;
|
||||||
|
|
||||||
|
template <typename Predicate, typename Pivot>
|
||||||
|
struct quick_sort_pred
|
||||||
|
{
|
||||||
|
template <typename T>
|
||||||
|
struct apply
|
||||||
|
{
|
||||||
|
typedef typename apply2< Predicate, T, Pivot >::type
|
||||||
|
type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
template <typename Sequence, typename Predicate>
|
template <typename Sequence, typename Predicate>
|
||||||
struct quick_sort_impl
|
struct quick_sort_impl
|
||||||
{
|
{
|
||||||
@@ -46,23 +58,21 @@ private:
|
|||||||
|
|
||||||
typedef typename partition<
|
typedef typename partition<
|
||||||
seq_
|
seq_
|
||||||
, bind2nd< Predicate,pivot_ >
|
, protect< quick_sort_pred<Predicate,pivot_> >
|
||||||
>::type partitioned;
|
>::type partitioned;
|
||||||
|
|
||||||
typedef typename quick_sort<
|
typedef typename quick_sort<
|
||||||
typename partitioned::first, Predicate
|
typename BOOST_MPL_AUX_SELECT1ST_WKND(partitioned), Predicate
|
||||||
>::type first_part;
|
>::type first_part;
|
||||||
typedef typename quick_sort<
|
typedef typename quick_sort<
|
||||||
typename partitioned::second, Predicate
|
typename BOOST_MPL_AUX_SELECT2ND_WKND(partitioned), Predicate
|
||||||
>::type second_part;
|
>::type second_part;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename copy_backward<
|
typedef typename copy_backward<
|
||||||
first_part
|
first_part
|
||||||
, typename push_front<
|
, typename push_front< second_part,pivot_ >::type
|
||||||
second_part,pivot_
|
|
||||||
>::type
|
|
||||||
, push_front<_,_>
|
, push_front<_,_>
|
||||||
>::type type;
|
>::type type;
|
||||||
|
|
||||||
@@ -85,8 +95,10 @@ struct sort_traits
|
|||||||
{
|
{
|
||||||
template< typename Sequence, typename Predicate >
|
template< typename Sequence, typename Predicate >
|
||||||
struct algorithm
|
struct algorithm
|
||||||
: aux::quick_sort< Sequence,Predicate >
|
|
||||||
{
|
{
|
||||||
|
typedef typename aux::quick_sort<
|
||||||
|
Sequence, Predicate
|
||||||
|
>::type type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user