
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