I'm trying for the first time to work with boost's multi-index and I can't seem to be able to wrap my head around all the code I see on the web.
First of all: My aim is to have a container with an enum as the key for direct access as well as to be able to iterate over it based on the original order of insertion.
I have defined my boost elements like so:
struct VarMapEle {
SolutionVariableNames first;
uint second;
};
struct var_tag {};
struct rand_tag {};
typedef multi_index_container<
VarMapEle,
indexed_by<
random_access<tag<rand_tag>>, // this index represents insertion order
hashed_unique<tag<var_tag>, member<VarMapEle, SolutionVariableNames, &VarMapEle::first>>
>
> VariableMap;
How can I do either of the tasks I mentioned before?