Is it possible to put a std::unique_ptr into a mulit_index container?
Hi all, Is it possible to put a std::unique_ptr into a mulit_index container? In particular, the following fails. typedef std::pair<int, std::unique_ptr<int> > ValueT; typedef boost::multi_index_container< ValueT, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< BOOST_MULTI_INDEX_MEMBER(ValueT, int, first) > > > HashMap; HashMap map; auto a = std::make_pair(5, std::unique_ptr<int>(new int(5))); map.insert(std::move(b)); // This line fails to compile (Visual Studio 2012) I'm guessing the answer is 'No' and it's because the rvalue reference overloads have not been done, but I'd like confirmation (or even better, to be told I'm wrong!). Thanks, Josh.
participants (2)
-
Igor R
-
Josh Quigley