Boost logo

Boost :

Subject: Re: [boost] [multi_index] feature proposal: member keys and typeless specification of keys
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2011-05-08 12:37:16

Thorsten Ottosen <thorsten.ottosen <at>> writes:

> Den 08-05-2011 16:18, Joaquin M Lopez Munoz skrev:
> > Joaquin M Lopez Munoz<joaquin<at>> writes:
> >
> >>
> >> I'm afraid this is impossible. What would the type be for the
> >> first template paramater of ordered_unique?
> >
> > Sorry, I meant "first non-template parameter".
> Well, I thought c++11 would allow us to deduce return type, argument
> types and class type of a member function pointer.
> Wouldn't
> help?

You can decompose a pointer to member *type* into its constituents
easily enough (even in C++98), but when you write


the entity passed to ordered_unique is not a *type* but
a pointer (to a member). That's why you need decltype to
do the object-->type magic, and that's why the syntax you
propose can't work.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Boost list run by bdawes at, gregod at, cpdaniel at, john at