osrm-backend/test/unit/move_to_moved.cpp
Siarhei Fedartsou f1087e81ec Squashed 'third_party/unordered_dense/' content from commit 231e48c94
git-subtree-dir: third_party/unordered_dense
git-subtree-split: 231e48c9426bd21c273669e5fdcd042c146975cf
2024-05-30 19:06:16 +02:00

25 lines
474 B
C++

#include <ankerl/unordered_dense.h>
#define ENABLE_LOG_LINE
#include <app/doctest.h>
#include <app/print.h>
#include <type_traits> // for remove_reference, remove_referen...
#include <utility> // for move
TEST_CASE_MAP("move_to_moved", int, int) {
auto a = map_t();
a[1] = 2;
auto moved = std::move(a);
auto c = map_t();
c[3] = 4;
// assign to a moved map
a = std::move(c);
a[5] = 6;
moved[6] = 7;
REQUIRE(moved[6] == 7);
}