У меня my_map определено как:
std::unordered_map<MyAction, MyLine * >;
(MyAction является классом enum)
где MyLine std::vector<MyPoint>
;
и MyLines std::vector<MyLine>
;
затем со следующим кодом:
for (const auto &myline : mylines) {
my_map.insert(
std::pair<MyAction, const Myline *>(MyAction::KEEP_1, &myline));
И я получил следующие ошибки:
my_utility.cpp:85:33: error: no matching member function for call to 'insert'
my_map.insert(
~~~~~~~~~~~~~~~~~~~~^~~~~~
my_project/external/clang/darwin/include/c++/v1/unordered_map:909:26: note: candidate function not viable: no known conversion from 'pair<my_namespace::MyAction, const Myline *>' to 'const pair<const std::__1::unordered_map<my_namespace::MyAction, std::__1::vector<math::Vector3<double>, std::__1::allocator<math::Vector3<double> > > *, std::__1::hash<my_namespace::MyAction>, std::__1::equal_to<my_namespace::MyAction>, std::__1::allocator<std::__1::pair<const MyAction, std::__1::vector<math::Vector3<double>, std::__1::allocator<math::Vector3<double> > > *> > >::key_type, std::__1::unordered_map<my_namespace::MyAction, std::__1::vector<math::Vector3<double>, std::__1::allocator<math::Vector3<double> > > *, std::__1::hash<my_namespace::MyAction>, std::__1::equal_to<my_namespace::MyAction>, std::__1::allocator<std::__1::pair<const MyAction, std::__1::vector<math::Vector3<double>, std::__1::allocator<math::Vector3<double> > > *> > >::mapped_type>' for 1st argument
pair<iterator, bool> insert(const value_type& __x)
^
Есть идеи, что случилось?Спасибо!