Subject: Re: [Boost-users] mpl programming task
From: peter_foelsche_at_[hidden]
Date: 2008-10-09 19:15:27


I think the following code would be easier:

#include <map>
#include <vector>

typedef std::map<size_t, size_t> CInt2IntMap;
typedef std::vector<size_t> CIntVector;

static CInt2IntMap convert(const CIntVector &_r)
{ CInt2IntMap s;
        for (size_t i = 0; i < _r.size(); i++)
                s.insert(std::make_pair(_r[i], s.size()));
        return s;
}