]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/pfr/test/run/std_interactions.cpp
1 // Copyright (c) 2016-2022 Antony Polukhin
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)
6 #include <boost/pfr/core.hpp>
8 #include <boost/core/lightweight_test.hpp>
11 template <std::size_t I
, class T
>
12 decltype(auto) get(T
&& v
) {
13 return boost::pfr::get
<I
>(std::forward
<T
>(v
));
19 using namespace helper
;
20 struct foo
{ int i
; short s
;};
23 BOOST_TEST_EQ(get
<0>(f
), 1);
26 BOOST_TEST_EQ(get
<1>(cf
), 2);
28 std::tuple
<int, short> t
{10, 20};
29 BOOST_TEST_EQ(get
<0>(t
), 10);
31 const std::tuple
<int, short> ct
{10, 20};
32 BOOST_TEST_EQ(get
<1>(ct
), 20);
34 return boost::report_errors();