]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/pfr/test/run/get_rvalue.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / pfr / test / run / get_rvalue.cpp
1 // Copyright (c) 2020 Antony Polukhin
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 #include <boost/pfr/core.hpp>
7
8 #include <memory>
9
10 #include <boost/core/lightweight_test.hpp>
11
12 struct unique_ptrs {
13 std::unique_ptr<int> p1;
14 std::unique_ptr<int> p2;
15 };
16
17 void test_get_rvalue() {
18 unique_ptrs x {
19 std::make_unique<int>(42),
20 std::make_unique<int>(43),
21 };
22
23 auto p = boost::pfr::get<0>(std::move(x));
24 BOOST_TEST_EQ(*p, 42);
25 }
26
27 int main() {
28 test_get_rvalue();
29
30 return boost::report_errors();
31 }