M
mitmaxtor
Hi everyone,
I am working on to implement Matlab sort function in C++ and I used
the following code. But, it seems it does not work for me. Any idea
about how to modify the code or any idea to make it work? thanks a lot
#include <vector>
#include <map>
#include <boost/bind.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <algorithm>
void main()
{
using std::vector;
typedef std:air<double,int> dpair; // <data,index>
vector<int> data;
vector<dpair> A;
std::transform(&A[0], &A[2]
, boost::counting_iterator<int>(1)
, std::inserter(A,data.begin())
, boost::bind(std::make_pair<double,int>, _1, _2)
);
}
I am working on to implement Matlab sort function in C++ and I used
the following code. But, it seems it does not work for me. Any idea
about how to modify the code or any idea to make it work? thanks a lot
#include <vector>
#include <map>
#include <boost/bind.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <algorithm>
void main()
{
using std::vector;
typedef std:air<double,int> dpair; // <data,index>
vector<int> data;
vector<dpair> A;
std::transform(&A[0], &A[2]
, boost::counting_iterator<int>(1)
, std::inserter(A,data.begin())
, boost::bind(std::make_pair<double,int>, _1, _2)
);
}