Commit 68c0f8a3 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix compile error with gcc-4.7

Use std::map::insert instead of std::map::emplace, since gcc-4.7 does
not support the latter.
parent 5182dc6c
......@@ -260,7 +260,12 @@ public:
return &ent;
}
FileEntry *cache_fd(const std::string &path, const FileEntry &ent) {
#ifdef HAVE_STD_MAP_EMPLACE
auto rv = fd_cache_.emplace(path, ent);
#else // !HAVE_STD_MAP_EMPLACE
// for gcc-4.7
auto rv = fd_cache_.insert(std::make_pair(path, ent));
#endif // !HAVE_STD_MAP_EMPLACE
return &(*rv.first).second;
}
void release_fd(const std::string &path) {
......
......@@ -64,7 +64,8 @@ DownstreamQueue::find_host_entry(const std::string &host) {
std::tie(itr, std::ignore) = host_entries_.emplace(host, HostEntry());
#else // !HAVE_STD_MAP_EMPLACE
// for g++-4.7
std::tie(itr, std::ignore) = host_entries_.insert({host, HostEntry()});
std::tie(itr, std::ignore) =
host_entries_.insert(std::make_pair(host, HostEntry()));
#endif // !HAVE_STD_MAP_EMPLACE
}
return (*itr).second;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment