Boost logo

Boost :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2005-08-05 01:09:00


In the page it is informed that sort has an average complexity of
O(nlog n), but I'm writing this:

  template <typename T, typename U>
  struct sort_hierarchy_pred : mpl::not_<
      boost::is_base_and_derived<T, U>
>::type
  {
  };

  typedef mpl::back_inserter< mpl::vector<> > aux_in;
  template <typename SequenceT>
  struct sort_hierarchies : public mpl::sort<SequenceT,
      typename mpl::lambda<sort_hierarchy_pred<mpl::_, mpl::_> >::type
      , aux_in>
  {};

and for a sequence of 5 or more, the compile time and memory usage
gets too huge. To became unuseable.

What I'm trying to achieve is a sequence of types that are sorted with
the bases first...
Could anybody shed some light why and if there's some workaround this?

thanks in advance,
Felipe.

-- 
   Felipe Magno de Almeida
Developer from synergy and Computer Science student from State
University of Campinas(UNICAMP).
Unicamp: http://www.ic.unicamp.br
Synergy: http://www.synergy.com.br
"There is no dark side of the moon really. Matter of fact it's all dark."

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk