Boost logo

Boost :

Subject: Re: [boost] [multi_index] feature proposal: member keys and typeless specification of keys
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-05-08 09:57:56


Den 08-05-2011 13:31, JOAQUIN M. LOPEZ MUÑOZ skrev:
> Hi all,
>
> This is a proposal for inclusion of two new features into Boost.MultiIndex,
> mem_key and BOOST_MULTI_INDEX_AUTO_KEY.

> This in itself gains us relatively little; but if we have a C++11 compiler
>
> with decltype, BOOST_MULTI_INDEX_AUTO_KEY can use mem_key
>
> in a way that dispenses with the need for specifying the type of
>
> the key!
>
>
>
> typedef multi_index_container<
>
> foo,
>
> indexed_by<
>
> ordered_unique<BOOST_MULTI_INDEX_AUTO_KEY(&foo::x)>,
>
> ordered_unique<BOOST_MULTI_INDEX_AUTO_KEY(&foo::bar)>,
>
> ordered_unique<BOOST_MULTI_INDEX_AUTO_KEY(&foo::baz)>
>
> >
>
> > multi_t;

If we have decltype, then can't we simply say

  indexed_by<

       ordered_unique<&foo::x>,

       ordered_unique<&foo::bar>,

       ordered_unique<&foo::baz>

>

> multi_t;

with some modifications to ordered_unique<>?

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk