X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/721deabd5306011d4d148b8788fda4aa5b75cba9..de83dfa52b003b652ef954490f1ff75b251fdf19:/examples/cpp/comm-waitany/s4u-comm-waitany.cpp diff --git a/examples/cpp/comm-waitany/s4u-comm-waitany.cpp b/examples/cpp/comm-waitany/s4u-comm-waitany.cpp index 30cd1e7bc4..802a4fc253 100644 --- a/examples/cpp/comm-waitany/s4u-comm-waitany.cpp +++ b/examples/cpp/comm-waitany/s4u-comm-waitany.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -37,11 +37,11 @@ static void sender(unsigned int messages_count, unsigned int receivers_count, lo /* Make a vector of the mailboxes to use */ std::vector mboxes; for (unsigned int i = 0; i < receivers_count; i++) - mboxes.push_back(sg4::Mailbox::by_name(std::string("receiver-") + std::to_string(i))); + mboxes.push_back(sg4::Mailbox::by_name("receiver-" + std::to_string(i))); /* Start dispatching all messages to receivers, in a round robin fashion */ for (unsigned int i = 0; i < messages_count; i++) { - std::string msg_content = std::string("Message ") + std::to_string(i); + std::string msg_content = "Message " + std::to_string(i); // Copy the data we send: the 'msg_content' variable is not a stable storage location. // It will be destroyed when this actor leaves the loop, ie before the receiver gets it auto* payload = new std::string(msg_content); @@ -81,7 +81,7 @@ static void sender(unsigned int messages_count, unsigned int receivers_count, lo /* Receiver actor expects 1 argument: its ID */ static void receiver(int id) { - sg4::Mailbox* mbox = sg4::Mailbox::by_name(std::string("receiver-") + std::to_string(id)); + sg4::Mailbox* mbox = sg4::Mailbox::by_name("receiver-" + std::to_string(id)); XBT_INFO("Wait for my first message"); for (bool cont = true; cont;) { auto received = mbox->get_unique();