On 3/20/2015 11:44 AM, Louis Dionne wrote:
As a simple curiosity, here's how this could be implemented with Hana:
<snip>
And using Meta:
#include <tuple>
#include
using namespace meta;
namespace l = lazy;
template<typename List>
using indexed_sort_ = sortList::size()>>>,
lambda<_a,_b,l::less>,
l::sizeof_>>>>;
template<typename List>
using indexed_sort =
pair,
transform>;
int main()
{
using P =
indexed_sort>;
using Tup = apply_liststd::tuple, first<P>>;
using Idx = second<P>;
// list,int_<1>,int_<4>,int_<0>,int_<3>>
Tup tup; // std::tuple
char(&a)[3] = std::get::value>(tup);
char(&b)[2] = std::get::value>(tup);
char(&c)[5] = std::get::value>(tup);
}
FWIW, these indices don't seem all that useful to me. What exactly was
the desired behavior?
--
Eric Niebler
Boost.org
http://www.boost.org