Fix compile error on boost 1.86
Boost 1.86 shows a compiler error which is holding up the rebase here.
The mapper extends std::vector, because it results in smaller binary
sizes compared to boost::vector. It's not clear if this is the problem,
or if there's something else amiss within container. Triaging the real
root cause isn't important to this use case.
There are a few reported bugs and changes that might be related[1][2].
It's not clear which one would've broken try_emplace in this case, nor
is it worth the effort to resolve.
This patchset replaces try_emplace calls with emplace calls. In theory
these are slightly less efficient, but considering that map construction
is a cold path, it's not terribly important that it be efficient.
[1] https://github.com/boostorg/container/issues/292
[2] https://github.com/boostorg/container/issues/280
Change-Id: I30d176022d2cec45430a50dc02c84666541fb4d7
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/src/processing.cpp b/src/processing.cpp
index 79d79ba..ff94d2e 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -146,7 +146,7 @@
// This is all needed so that mapper operations can be done
// on the new parent paths.
using iface_map_iterator = InterfaceMapType::iterator;
- using name_map_iterator = InterfaceMapType::mapped_type::iterator;
+ using name_map_iterator = ConnectionNames::iterator;
static const InterfaceNames defaultIfaces{
"org.freedesktop.DBus.Introspectable", "org.freedesktop.DBus.Peer",
@@ -160,10 +160,10 @@
parent = parent.substr(0, pos);
std::pair<iface_map_iterator, bool> parentEntry =
- interfaceMap.try_emplace(parent);
+ interfaceMap.emplace(parent, ConnectionNames{});
std::pair<name_map_iterator, bool> ifaceEntry =
- parentEntry.first->second.try_emplace(wellKnown, defaultIfaces);
+ parentEntry.first->second.emplace(wellKnown, defaultIfaces);
if (!ifaceEntry.second)
{