|
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> dezide.com> writes:
>
> Den 08-05-2011 16:18, Joaquin M Lopez Munoz skrev:
> > Joaquin M Lopez Munoz<joaquin<at> tid.es> 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
>
>
http://www.boost.org/doc/libs/1_46_1/libs/function_types/doc/html/boost_functiontypes/reference/decomposition.html
>
> help?
You can decompose a pointer to member *type* into its constituents
easily enough (even in C++98), but when you write
ordered_unique<&foo::x>
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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk