Example:
SomeType bar::foo() const {
SomeType retVal;
for (auto i = 0u; i < 10; ++i) {
retVal = boost::range::join(retVal, m_someDataContainer.equal_range(i));
}
return retVal;
}
Lets say, for simplicity, the m_someDataContainer and the bar class are defined as following:
typedef boost::multi_index_container<
int, bmi::indexed_by<bmi::hashed_unique<bmi::tag<struct someTag>,
bmi::identity<int>>>> Data;
class bar {
public:
SomeType foo() const;
private:
Data m_someDataContainer;
};
The questions are: How do I figure out the return type of foo() and how do I join these ranges without using boost::any_range
EDIT1: Looks like it is quite impossible, calling join in loop on previous joined value makes the result type a nested type of joined_range of joined_range of joined_range ... and so on, which, I guess cannot be deduced easily if at all