本文整理汇总了C++中Blocks::emplace方法的典型用法代码示例。如果您正苦于以下问题:C++ Blocks::emplace方法的具体用法?C++ Blocks::emplace怎么用?C++ Blocks::emplace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blocks
的用法示例。
在下文中一共展示了Blocks::emplace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: simplifyPFBlock
void simplifyPFBlock(const Edges& toUnlink, const PFBlock& block, Blocks& simplifiedBlocks, Nodes& history) {
// take a block, unlink some of the edges and
// create smaller blocks or a simplified blocks
// or if nothing has changed take a copy of the original block
if (toUnlink.size() == 0) {
// no change needed, just make a copy of block
PFBlock newblock(block.elementIds(), block.edges(), simplifiedBlocks.size(), 's'); // will copy edges and ids
PDebug::write("Made {}", newblock);
auto id = newblock.id();
simplifiedBlocks.emplace(id, std::move(newblock));
// update history
makeHistoryLinks(block.elementIds(), {id}, history);
} else {
Edges modifiedEdges;
for (auto edge : block.edges()) { // copying edges
Edge e = edge.second;
if (toUnlink.find(edge.first) != toUnlink.end()) {
e.setLinked(false);
}
modifiedEdges.emplace(e.key(), e);
}
// create new blocks and add into simplifiedBlocks
buildPFBlocks(block.elementIds(), modifiedEdges, 's', simplifiedBlocks, history);
}
}