Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::mpl::set and boost::mpl::sort -- does not compile -- any help appreciated
From: peter_foelsche_at_[hidden]
Date: 2008-10-17 17:06:06


I found the answer meanwhile.

Peter

 

#include <boost/mpl/set.hpp>

#include <boost/mpl/sort.hpp>

#include <boost/mpl/inserter.hpp>

#include <boost/mpl/insert.hpp>

#include <boost/mpl/placeholders.hpp>

#include <boost/mpl/front.hpp>

#include <boost/mpl/deref.hpp>

#include <boost/mpl/for_each.hpp>

#include <iostream>

 

 

typedef boost::mpl::set<

                        boost::mpl::int_<1>,

                        boost::mpl::int_<5>,

                        boost::mpl::int_<3>,

                        boost::mpl::int_<0>

> CSet;

 

typedef boost::mpl::inserter<

            boost::mpl::set<>,

            boost::mpl::insert<boost::mpl::_1, boost::mpl::_2>

> CInserter;

 

typedef boost::mpl::sort<

            CSet,

            boost::mpl::less<

                        boost::mpl::_1,

                        boost::mpl::_2

>,

            CInserter

>::type COrderedSet;

 

 



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