[multi_index].[composite_key] Index creation at run-time.
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
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
participants (2)
-
Joaquín Mª López Muñoz
-
Prashant Thakre