Hi Everyone
I'm trying to make a boost::multi_index container that uses member functions w/ parameters as keys.
class Data {
public:
std::string get(const std::string & _attr) { return _internals_fetch_data(_attr); }
/*
assume some implementation for storing data in some structure(s)
*/
};
Suppose I have a rectangular list of these data items that I want to multiple indicies over. rectangular means all items in list have the same attributes via get()
The boost::multi_index declaration is something like
typedef multi_index_container<
Data,
indexed_by<
ordered_unique<
BOOST_MULTI_INDEX_CONST_MEM_FUN(Data,String,get)
>
>
> my_container;
Except that BOOST_MULTI_INDEX_CONST_MEM_FUNCT() does not have these features. Composite keys still work with member variables.
How do I get around this ? It doesn't look like I can give ordered_unique<> a boost::function1
EDIT:
After some thought, here is the gist of what I'm trying to do.
boost::multi_index determines it's indexing features during compile time. How do I circumvent these features and use run-time determined indexes ?