<div dir="ltr"><div><div><div><div>Hi Alex, Junxiao,<br><br></div>Thank you very much for your replies. Indeed, Alex's solution seems to be much faster than re-insert a pit entry.<br></div>Anyway, thanks to you two for the support!<br><br></div>Best,<br></div>Natalya<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-11 0:45 GMT+01:00 Alex Afanasyev <span dir="ltr"><<a href="mailto:aa@cs.ucla.edu" target="_blank">aa@cs.ucla.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Natalya,<div><br></div><div>This seem to be a deficiency in the current interface that we should fix asap.</div><div><br></div><div>As an immediate workaround, which could be faster then what Junxiao suggested, but not future-safe code:</div><div><br></div><div>    auto pitIterator = pit.begin();</div><div>    // ...</div><div>    shared_ptr<pit::Entry> pitEntry = pitIterator.operator->();</div><div>    pit.erase(pitEntry);</div><div><br></div><div>---</div><div>Alex</div><span class=""><div><br><div><blockquote type="cite"><div>On Dec 10, 2015, at 8:40 AM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" target="_blank">shijunxiao@email.arizona.EDU</a>> wrote:</div><br><div><div dir="ltr">Hi Natalya<div><br></div><div>You may invoke Pit::insert again with the same Interest, which would return the same entry as a shared_ptr<pit::Entry>.</div><div>Then you can erase this entry.</div><div><br></div><div>Yours, Junxiao</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 4:02 AM, Natalya Rozhnova <span dir="ltr"><<a href="mailto:rozhnova.natalya@gmail.com" target="_blank">rozhnova.natalya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi all,<br><br></div>It's me again. :)<br></div><div>The task I want to perform is to iterate in the Pit in order to find some interesting entries and delete them.<br>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></div><div>Is there any other way to do it?<br></div><div><br></div><div>Thanks in advance.<br></div><div>Best,<br></div><div>Natalya<br></div></div>
</blockquote></div></div></div></blockquote></div><br></div></span></div></blockquote></div><br></div>