Hi,
In the following code I am trying to get an handle to the index of a
multi_index container. The compiler says
"invalid initialization of reference of type
‘boost::multi_index::detail:..". Not sure why this is so. Since I
wasn't sure about the source of error I have pasted the full code (
sans declarations) is give below.
Thanks
sandeep
///-------------------------Full code ---------------------
template
class TupleStore
{
typedef tuple tuple_t;
typedef multi_index_container
<
tuple_t,
indexed_by <
ordered_unique >
>
> tuplestore_t;
tuplestore_t m_tuplestore;
public:
template<int n>
void lookup_key(Col1_t key) const
{
typedef typename tuplestore_t:: template nth_index<n>::type
tuplestore_index_t; ///compiler error here
tuplestore_index_t& indexx = m_tuplestore.get<n>();
}
};
int main()
{
TupleStore tstr;
tstr.lookup_key<0>(5);
}