Eigen :: aligned_allocator does not work with std :: unordered_multimap

I am trying to compile this code in Xcode 6:

std::unordered_multimap< Frame*, Sim3, std::hash<Frame*>, std::equal_to<Frame*>, Eigen::aligned_allocator< std::pair<const Frame*,Sim3> > > trackingFailed; 

Failure:

 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:1461:5: Static_assert failed "Invalid allocator::value_type" 

Is it necessary to use aligned_allocator in Eigen 3.2.2? Why is this happening with C ++ 11 / C ++ 14 and libC ++?

EDIT

I get no type named value_type if I remove the Eigen allocator from the unordered_map template declaration.

+5
source share
1 answer

I believe the error is that the pointer should be const , not pointee.
Those. try Eigen::aligned_allocator< std::pair<Frame* const, Sim3> > as the type of dispenser.

+8
source

Source: https://habr.com/ru/post/1208508/


All Articles