Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Interprocess accessing an unordered_map in shared memory.
From: lazylabs_at_[hidden]
Date: 2013-03-12 00:43:08


On Tue, Mar 12, 2013 at 2:21 AM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
> El 11/03/2013 13:20, lazylabs_at_[hidden] escribió:
>
>> However, I would prefer to do this with a std::string, which results
>> in compilation errors:
>>
>> persons->at(std::string("H")).print();
>>
>> Is it possible to write the above statement, i.e. accessing the map
>> allocated in shared memory with std::string?
>
>
> No, as the key_type is not std::string. It's a bit ugly but to fix this has
> no easy fix.
>

Thanks. It's ugly for sure, but does it have any performance impact as well?

As I understand, the reason why we cannot lookup ShmemString with
std::string is because of the template argument, which I have given
while creating the unordered_map:

                std::equal_to<KeyType>,

Just guessing, if something can be done here?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net