Boost logo

Boost Users :

Subject: Re: [Boost-users] [Multi Index] Random Access Index C2247 Compile Error
From: Igor R (boost.lists_at_[hidden])
Date: 2012-07-09 07:06:10


> Thanks very much to Steven Watanabe for getting back to me regarding my lower_bound/upper_bound question - I will take a look at equal_range() as suggested.
>
> I have been reading around and found the random_access index. This is useful to me to find any random item in my multi_index container.
>
> I am having a problem compiling though, I get error c2247 when I try to use the square bracket operator [] to access a randomly indexed item. The error message says that this is an inheritance issue with the protected status of the operator...
>
> c:\program files\microsoft visual studio\myprojects\xmltest\xmltest\xmltestapp.cpp(899) : error C2247: 'boost::multi_index::detail::random_access_index<SuperMeta,TagList>::operator []' not accessible because 'boost::multi_index::detail::ordered_index<KeyFromValue,Compare,SuperMeta,TagList,Category>' uses 'protected' to inherit from 'boost::multi_index::detail::random_access_index<SuperMeta,TagList>'

Are you trying to copy an index? If you store an index returned by MIC
in a variable, define it as reference.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net