summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 475afa2..665df8b 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -4403,23 +4403,24 @@ void addMembersToMemberGroup(MemberList *ml,
auto mg_it = std::find_if(pMemberGroups->begin(),
pMemberGroups->end(),
[&groupId](const auto &g)
- { return g.groupId()==groupId; }
+ { return g->groupId()==groupId; }
);
MemberGroup *mg_ptr = 0;
if (mg_it==pMemberGroups->end())
{
- pMemberGroups->emplace_back(
+ auto mg = std::make_unique<MemberGroup>(
context,
groupId,
info->header,
info->doc,
info->docFile,
info->docLine);
- mg_ptr = &pMemberGroups->back();
+ mg_ptr = mg.get();
+ pMemberGroups->push_back(std::move(mg));
}
else
{
- mg_ptr = &(*mg_it);
+ mg_ptr = (*mg_it).get();
}
mg_ptr->insertMember(fmd); // insert in member group
fmd->setMemberGroup(mg_ptr);
@@ -4438,23 +4439,24 @@ void addMembersToMemberGroup(MemberList *ml,
auto mg_it = std::find_if(pMemberGroups->begin(),
pMemberGroups->end(),
[&groupId](const auto &g)
- { return g.groupId()==groupId; }
+ { return g->groupId()==groupId; }
);
MemberGroup *mg_ptr = 0;
if (mg_it==pMemberGroups->end())
{
- pMemberGroups->emplace_back(
+ auto mg = std::make_unique<MemberGroup>(
context,
groupId,
info->header,
info->doc,
info->docFile,
info->docLine);
- mg_ptr = &pMemberGroups->back();
+ mg_ptr = mg.get();
+ pMemberGroups->push_back(std::move(mg));
}
else
{
- mg_ptr = &(*mg_it);
+ mg_ptr = (*mg_it).get();
}
md = ml->take(index); // remove from member list
mg_ptr->insertMember(md->resolveAlias()); // insert in member group