advanced C++11. Add std::function, std::iterator

This commit is contained in:
Ivan Morozov
2022-07-13 21:19:06 +03:00
parent f42206b55f
commit ae4ecd4667
4 changed files with 35 additions and 6 deletions

View File

@ -212,9 +212,8 @@ void CFStorage::VisitEntries(RedBlackTree::Action<PCFItem> action, bool recursiv
{
SVector<RedBlackTree::IRBNode> subStorages;
// TODO deligate
auto internalAction =
[subStorages] (RedBlackTree::PIRBNode targetNode)
RedBlackTree::Action<RedBlackTree::PIRBNode> internalAction =
[&] (RedBlackTree::PIRBNode targetNode)
{
auto d = std::dynamic_pointer_cast<IDirectoryEntry>(targetNode);
if (d->getStgType() == StgType::StgStream)
@ -266,7 +265,7 @@ void CFStorage::Delete(const std::wstring &entryName)
for (const auto& de : *(temp->getChildren()))
{
auto ded = std::dynamic_pointer_cast<IDirectoryEntry>(de);
temp->Delete(ded.Name);
temp->Delete(ded->GetEntryName());
}
// ...then we need to rethread the root of siblings tree...