Is it possible to use constructions like QMap< QString, boost::multi_index_container<...> >
?
On the one hand, we have private:
BOOST_COPYABLE_AND_MOVABLE(multi_index_container)
in the containers declaration. It should tell us not to put multi_index_container<> into other stl-like container.
On the other hand, such construction
QMap< QString, boost::multi_index_container<...> > _map;
map.insert("bla-bla", container1);
...
auto tmp = _map.value(QString("bla-bla")).get<keyVal>();
//keyVal corresponds to one for the multi_index_container instance
is compiled well with Visual Studio 2012 (+update4 + boost v1.55 + qt v4.8.5).
Experimentally it was discovered that:
auto tmp = _map.value(QString("bla-bla")).get<keyVal>();
makes tmp
to handle deleted data.
while
auto tmp = _map.value(QString("bla-bla"));
auto tmp_1 = tmp.get<keyVal>();
leaves tmp_1
with valid data.
Does anybody know what is the proper treatment with boost::multi_index_container<>
if we need to put it in another container?
Are there any differences for Qt5.3?