We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
std::move
1 parent 9086e87 commit 4d47642Copy full SHA for 4d47642
src/dsf/mobility/Agent.cpp
@@ -1,5 +1,7 @@
1
#include "Agent.hpp"
2
3
+#include <utility>
4
+
5
namespace dsf::mobility {
6
Agent::Agent(std::time_t const& spawnTime,
7
std::optional<Id> itineraryId,
@@ -31,7 +33,7 @@ namespace dsf::mobility {
31
33
void Agent::setStreetId(std::optional<Id> streetId) {
32
34
if (!streetId.has_value()) {
35
assert(m_nextStreetId.has_value());
- m_streetId = std::move(m_nextStreetId);
36
+ m_streetId = std::exchange(m_nextStreetId, std::nullopt);
37
return;
38
}
39
assert(m_nextStreetId.has_value() ? streetId == m_nextStreetId.value() : true);
0 commit comments