<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Natalya,<div class=""><br class=""></div><div class="">This seem to be a deficiency in the current interface that we should fix asap.</div><div class=""><br class=""></div><div class="">As an immediate workaround, which could be faster then what Junxiao suggested, but not future-safe code:</div><div class=""><br class=""></div><div class="">    auto pitIterator = pit.begin();</div><div class="">    // ...</div><div class="">    shared_ptr<pit::Entry> pitEntry = pitIterator.operator->();</div><div class="">    pit.erase(pitEntry);</div><div class=""><br class=""></div><div class="">---</div><div class="">Alex</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 10, 2015, at 8:40 AM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" class="">shijunxiao@email.arizona.EDU</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Natalya<div class=""><br class=""></div><div class="">You may invoke Pit::insert again with the same Interest, which would return the same entry as a shared_ptr<pit::Entry>.</div><div class="">Then you can erase this entry.</div><div class=""><br class=""></div><div class="">Yours, Junxiao</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Dec 10, 2015 at 4:02 AM, Natalya Rozhnova <span dir="ltr" class=""><<a href="mailto:rozhnova.natalya@gmail.com" target="_blank" class="">rozhnova.natalya@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">Hi all,<br class=""><br class=""></div>It's me again. :)<br class=""></div><div class="">The task I want to perform is to iterate in the Pit in order to find some interesting entries and delete them.<br class="">I just discovered that the Pit iterators return const nfd::pit::Entry& but the function erase takes shared_ptr<pit::Entry> as parameter. I can't create the shared_ptr with make_shared because the class is protected by "noncopyable". So I can't delete the entries I want by iterating in the pit... <br class=""></div><div class="">Is there any other way to do it?<br class=""></div><div class=""><br class=""></div><div class="">Thanks in advance.<br class=""></div><div class="">Best,<br class=""></div><div class="">Natalya<br class=""></div></div>
</blockquote></div></div></div></blockquote></div><br class=""></div></body></html>