Boost logo

Boost Users :

Subject: [Boost-users] [array][bind] Binding boost array to a boost function
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2010-10-10 19:59:21


I'm trying to bind a boost array to be called at a later time. This is
giving me a lot of errors. Is what I'm attempting possible?

Ryan

template<typename T, std::size_t U>
class Sorter
{
private:
  typedef boost::function<void(boost::array<T, U> & a)> t_SortFunction;

  t_SortFunction m_SortFunction;

public:
  Sorter(t_SortFunction func) : m_SortFunction(func) {}

  bool sort(boost::array<T, U> & a)
  {
    m_SortFunction(a);
  }
};

template<typename T, std::size_t U>
void quicksort(boost::array<T, U> & a)
{
}

int main(int argc, char* argv[])
{

  Sorter shell(boost::bind(quicksort, _1));

  return 0;
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net