Boost logo

Boost Users :

From: Andrej van der Zee (mavdzee_at_[hidden])
Date: 2007-06-13 04:28:51


Hi,

I am trying to set up a multi_index_container-type
with a template argument like this:

template <typename event_type>
struct mi_container
{
typedef typename mi::composite_key<
        event_type,
        mi::const_mem_fun<fields::field_ts, ts_type,
&fields::field_ts::ts>,
        mi::const_mem_fun<fields::field_addr,
addr_type, &fields::field_addr::addr>,
        mi::const_mem_fun<fields::field_port,
port_type, &fields::field_port::port>
> self_key_type;

typedef typename mi::composite_key<
  event_type,
        mi::const_mem_fun<fields::field_ts, ts_type,
&fields::field_ts::ts>,
        mi::const_mem_fun<fields::field_peer_addr,
addr_type, &fields::field_peer_addr::peer_addr>,
        mi::const_mem_fun<fields::field_peer_port,
port_type, &fields::field_peer_port::peer_port>
> peer_key_type;

typedef typename mi::multi_index_container<
  event_type,
  mi::indexed_by<
          mi::ordered_non_unique<
mi::tag<self_key_tag>, self_key_type>,
          mi::ordered_non_unique<
mi::tag<peer_key_tag>, peer_key_type>
>
> type;
};

mi_container<ev_connect>::type connected;

This gives me the following compile-error:

main.cpp: In instantiation of
‘mi_container<event::ev_connect>’:
main.cpp:78: instantiated from here
main.cpp:57: error: invalid use of
‘event::fields::field_ts::ts’ to form a
pointer-to-member-function
main.cpp:57: note: a qualified-id is required
main.cpp:64: error: invalid use of
‘event::fields::field_ts::ts’ to form a
pointer-to-member-function
main.cpp:64: note: a qualified-id is required
main.cpp:75: error: invalid use of
‘event::fields::field_ts::ts’ to form a
pointer-to-member-function
main.cpp:75: note: a qualified-id is required

Probably I doing something silly. Note that if I
remove the class template and directly specialize it,
there is no problem at all. Can anybody help me out?

Thanks,
Andrej

      ___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net