Boost logo

Boost Users :

From: Prashant Thakre (prashant.thakre_at_[hidden])
Date: 2006-06-06 15:06:29


Hi,
 Thanks for the reply.
 This is what I am trying to achieve:
  a) Each entry in the container will have tuple containing n-elements
tuple < t0, t1 ..., tn >, where n is known at run-time. This entry
will also have other elements.
  b) Multi_index container will have a composite_key, consisting of
each tuple element.

  As per 2) it should be possible to just have std::vector<T> as a
tuple and define the composite key in terms of each element of the
tuple i.e. [ tuple.at(0), ..., tuple.at(n-1) ].
  Please correct me if am wrong.
 Thanks once again.

-- 
regards,
Prashant Thakre
> Date: Tue, 06 Jun 2006 13:00:09 +0200
> From: Joaqu?n M? L?pez Mu?oz <joaquin_at_[hidden]>
> Subject: Re: [Boost-users] [multi_index].[composite_key] Index
>         creation at run-time.
> To: boost-users_at_[hidden]
> Message-ID: <44856039.19A00631_at_[hidden]>
> Content-Type: text/plain; charset=iso-8859-1
>
> Prashant Thakre ha escrito:
>
> > Hi,
> >  I would like to know if it's possible to define a multi_index using
> > composite_key,where the number of keys which are part of the
> > composite_key are only known at run-time.
> >  Thanks again.
> > --
> > regards,
> > Prashant Thakre
>
> Hello,
>
> The short answer is no, you must know the number of keys a
> composite_key is made of at compile time. The long answer is,
> depending on your usage scenario, maybe you can have something
> close to what you're after:
>
> 1. If the maxium number of keys of the composite_key is bounded
> then you can use that maximum and later on, at run-time, take
> advantage of only the first N key slots.
> 2. You can have std::vector<> as the key, the comparison semantics
> of this container in some ways resembles that of an infinite-length
> composite key.
>
> If you can describe what you are pursuing with a little more detail
> maybe I can provide more focused help.
>
> Thanks for using B.MI, best regards,
>
> Joaqu?n M L?pez Mu?oz
> Telef?nica, Investigaci?n y Desarrollo

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