[llvm] r271958 - Attempt to work around lack of std::map::emplace in libstdc++4.7

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 16:54:47 PDT 2016


On Mon, Jun 6, 2016 at 4:44 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> On Mon, Jun 6, 2016 at 4:28 PM, Reid Kleckner via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> -      BinaryForPath.emplace(Path, OwningBinary<Binary>());
>> +      OwningBinary<Binary> NullBinary;
>> +      BinaryForPath.insert(std::make_pair(Path, std::move(NullBinary)));
>>
>
> I'm curious - why the introduction of the named variable (NullBinary)? did
> that work around some particular problem?
>

I was afraid of std::make_pair using a value type which would be copied,
but apparently it works. r271964
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/6d9f162d/attachment.html>


More information about the llvm-commits mailing list