tags:

views:

16

answers:

1

In boost multiindex example complex_structs, it use one key in the car_manufacturer struct for car_table. If car_manufacturer have been modify to have 2 ID

struct car_manufacturer { 
  std::string name;
  int cm_code;

  car_manufacturer(const std::string& name_, const int& cm_code_):name(name_), cm_code(cm_code_){}
};

What will be the key_from_key struct looks like? Have try to add another KeyExtractor or use composite index inside key_from_key, but still cannot compile.

Please help on this. Thanks.

A: 

After some trying, my compile error is actually cause by using find() without boost::make_tuple.

Can use back the same key_from_key struct. Key1Extrator will be composite key of name and cm_code.

StrifeLow