2
0
mirror of https://github.com/boostorg/json.git synced 2026-01-19 04:12:14 +00:00

Tidy up pilfering

This commit is contained in:
Vinnie Falco
2020-10-06 11:52:42 -07:00
parent dd338e299e
commit 0a905acf9d
11 changed files with 85 additions and 47 deletions

View File

@@ -10,6 +10,7 @@
// Test that header file is self-contained.
#include <boost/json/string.hpp>
#include <boost/json/monotonic_resource.hpp>
#include <boost/json/parse.hpp>
#include <numeric>
@@ -273,6 +274,16 @@ public:
BOOST_TEST(
s1.storage() == storage_ptr());
}
// ensure pilfered-from objects
// are trivially destructible
{
string s1(make_shared_resource<
monotonic_resource>());
string s2(pilfer(s1));
BOOST_TEST(s1.storage().get() ==
storage_ptr().get());
}
}
// string(string&&)