The documentation for Boost multiindex containers seem to indicate that I can use it as a set after declaring an index to iterate over. So I was wondering if it is possible to hide the boost implementation and return an iterator masqueraded as an iterator to an std::set
Ex: Header
typedef multi_index_container<
Employee,
indexed_by<
ordered_non_unique<
composite_key<
Employee,
member<Employee, int, &Employee::id>,
member<Employee, int, &Employee::salary>
>
>
> > EmployeeSet;
const std::set<Employee>::iterator getEmployees();
static EmployeeSet employeeSet;
Test.cc:
const std::set<Test::Employee>::iterator getEmployees(){
std::pair<EmployeeSet::iterator, EmployeeSet::iterator> by_id =
employeeSet.equal_range(id);
return by_id.first;
}
Is it possible to do something like this? and How?