/usr/include/c++/v1/map:837:5: error: static_assert failed "Allocator::value_type must be same type as value_type"

Dimitry Andric dimitry at andric.com
Wed Jun 15 16:52:43 UTC 2016


On 15 Jun 2016, at 15:20, Joerg Sonnenberger <joerg at bec.de> wrote:
> 
> On Wed, Jun 15, 2016 at 11:54:17AM +0200, Dimitry Andric wrote:
>> This patch should hopefully work.  I do not have the port itself, so I could not compile-test it.
>> 
>> diff --git a/include/LoopClosing.h b/include/LoopClosing.h
>> index b1736fe..5d80d02 100644
>> --- a/include/LoopClosing.h
>> +++ b/include/LoopClosing.h
>> @@ -47,7 +47,7 @@ public:
>> 
>>     typedef pair<set<KeyFrame*>,int> ConsistentGroup;
>>     typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
>> -        Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;
>> +        Eigen::aligned_allocator<std::pair<KeyFrame const*, g2o::Sim3> > > KeyFrameAndPose;
> 
> That's a stylistic change only:
>  const foo * == foo const * != foo * const.

Yeah sorry, I realized that only after sending, it should indeed be
"KeyFrame* const", e.g the pointer itself (which is the key to for
std::map<>) should be const, not the thing pointed to.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20160615/e3b859eb/attachment.sig>


More information about the freebsd-hackers mailing list