|
Boost Users : |
Subject: Re: [Boost-users] multi_index::composite_key with char[]
From: leyiliu (595657419_at_[hidden])
Date: 2015-12-16 03:41:21
JoaquÃn M López Munoz wrote
> leyiliu <595657419
> <at>
> qq.com> writes:
>
>> I follow your suggest,define the set like this:
>>
>> typedef boost::multi_index_container<
>> t_ac_client_basic,
>> boost::multi_index::indexed_by<
>>
>> boost::multi_index::ordered_non_unique<
>> boost::multi_index::tag
> <pk_t_ac_client_basic>
> ,
>> boost::multi_index::composite_key<
>> t_ac_client_basic,
>> boost::multi_index::member<t_ac_client_basic, char[21],
> > &t_ac_client_basic::LCcode >,
>> boost::multi_index::member<t_ac_client_basic, char[21],
> > &t_ac_client_basic::ClientID >
>> >,
>> boost::multi_index::composite_key_compare<
>> std::less
> <const char*>
> ,
>> std::less
> <const char*>
>> >
>> >
>> >
>> > t_ac_client_basic_set;
>>
>> I get a error,when add this code
>> pk_t_ac_client_basic_Index& test = testSet.get
> <pk_t_ac_client_basic>
> ;
>> :
>> error C3867:
>> âboost::multi_index::multi_index_container [...] ::getâ:
>> å½æ°è°ç¨ç¼ºå°åæ°å表ï¼è¯·ä½¿ [...]
>
> I can't read Chinese, but Google Translate suggests
> the compiler is complaining about missing args to get,
> which is indeed the problem:
>
> testSet.get
> <pk_t_ac_client_basic>
> ;
>
> should be
>
> testSet.get
> <pk_t_ac_client_basic>
> ();
>
> JoaquÃn M López Muñoz
> Telefónica
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_.boost
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
Sorry,Long time no see.
Follow you suggest,I can insert element into the container.But the find() is
also a problem.
*test.find(std::make_tuple("KS", "1")); *.
thanks a lot
-- View this message in context: http://boost.2283326.n4.nabble.com/multi-index-composite-key-with-char-tp4679825p4682139.html Sent from the Boost - Users mailing list archive at Nabble.com.
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