• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2Copyright 2017 Glen Joseph Fernandes
3(glenjofe@gmail.com)
4
5Distributed under Boost Software License, Version 1.0.
6(See accompanying file LICENSE_1_0.txt or copy at
7http://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
16namespace boost_no_cxx17_structured_bindings {
17
18struct P {
19    int x;
20    int y;
21};
22
23int 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 */
37