]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/config/test/boost_no_cxx17_structured_bindings.ipp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / config / test / boost_no_cxx17_structured_bindings.ipp
1 /*
2 Copyright 2017 Glen Joseph Fernandes
3 (glenjofe@gmail.com)
4
5 Distributed under Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 */
9
10 // MACRO: BOOST_NO_CXX17_STRUCTURED_BINDINGS
11 // TITLE: C++17 structured bindings
12 // DESCRIPTION: C++17 structured bindings are not supported.
13
14 #include <tuple>
15
16 namespace boost_no_cxx17_structured_bindings {
17
18 struct P {
19 int x;
20 int y;
21 };
22
23 int test()
24 {
25 auto [c, d] = std::make_tuple(1, 2);
26 if (c != 1 || d != 2) {
27 return 1;
28 }
29 auto [a, b] = P{1, 2};
30 if (a != 1 || b != 2) {
31 return 1;
32 }
33 return 0;
34 }
35
36 } /* boost_no_cxx17_structured_bindings */