X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fc76eac8d82e65ece481a2d104c34034c9934e14..4c753f8d4cabd4104f3f7109823f16be2ebdcce3:/examples/cpp/comm-ready/s4u-comm-ready.cpp diff --git a/examples/cpp/comm-ready/s4u-comm-ready.cpp b/examples/cpp/comm-ready/s4u-comm-ready.cpp index edb9575f49..d90d52de36 100644 --- a/examples/cpp/comm-ready/s4u-comm-ready.cpp +++ b/examples/cpp/comm-ready/s4u-comm-ready.cpp @@ -30,7 +30,7 @@ static void peer(int my_id, int messages_count, size_t payload_size, int peers_c { /* Set myself as the persistent receiver of my mailbox so that messages start flowing to me as soon as they are put * into it */ - sg4::Mailbox* my_mbox = sg4::Mailbox::by_name(std::string("peer-") + std::to_string(my_id)); + sg4::Mailbox* my_mbox = sg4::Mailbox::by_name("peer-" + std::to_string(my_id)); my_mbox->set_receiver(sg4::Actor::self()); std::vector pending_comms; @@ -39,8 +39,8 @@ static void peer(int my_id, int messages_count, size_t payload_size, int peers_c for (int i = 0; i < messages_count; i++) { for (int peer_id = 0; peer_id < peers_count; peer_id++) { if (peer_id != my_id) { - sg4::Mailbox* mbox = sg4::Mailbox::by_name(std::string("peer-") + std::to_string(peer_id)); - std::string message = std::string("Message ") + std::to_string(i) + " from peer " + std::to_string(my_id); + sg4::Mailbox* mbox = sg4::Mailbox::by_name("peer-" + std::to_string(peer_id)); + std::string message = "Message " + std::to_string(i) + " from peer " + std::to_string(my_id); auto* payload = new std::string(message); // copy the data we send: // 'message' is not a stable storage location XBT_INFO("Send '%s' to '%s'", message.c_str(), mbox->get_cname()); @@ -53,7 +53,7 @@ static void peer(int my_id, int messages_count, size_t payload_size, int peers_c /* Start sending messages to let peers know that they should stop */ for (int peer_id = 0; peer_id < peers_count; peer_id++) { if (peer_id != my_id) { - sg4::Mailbox* mbox = sg4::Mailbox::by_name(std::string("peer-") + std::to_string(peer_id)); + sg4::Mailbox* mbox = sg4::Mailbox::by_name("peer-" + std::to_string(peer_id)); auto* payload = new std::string("finalize"); // Make a copy of the data we will send pending_comms.push_back(mbox->put_async(payload, payload_size)); XBT_INFO("Send 'finalize' to 'peer-%d'", peer_id);