Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use typed Mailbox::get<>() instead of using static_cast everywhere.
[simgrid.git] / examples / s4u / app-bittorrent / s4u-peer.cpp
index f147320..06cc7b5 100644 (file)
@@ -116,7 +116,7 @@ bool Peer::getPeersFromTracker()
   }
 
   try {
-    auto* answer = static_cast<TrackerAnswer*>(mailbox_->get(GET_PEERS_TIMEOUT));
+    auto* answer = mailbox_->get<TrackerAnswer>(GET_PEERS_TIMEOUT);
     // Add the peers the tracker gave us to our peer list.
     for (auto const& peer_id : answer->getPeers())
       if (id != peer_id)