|
Boost Users : |
Subject: Re: [Boost-users] [Boost.Range] combine, native range-for, and destructuring
From: Chris Glover (c.d.glover_at_[hidden])
Date: 2018-04-18 01:58:25
On Tue, 17 Apr 2018 at 11:00 Michel Morin via Boost-users <
boost-users_at_[hidden]> wrote:
> Hmm..., with boost (develop branch) + GCC 7.3 or Clang trunk,
> the following code runs fine:
>
> std::vector<int> v1{1, 1, 1};
> std::vector<int> v2{2, 2, 2};
>
> for (auto&& tpl : boost::range::combine(v1, v2)) {
> auto [x, y] = tpl; // `auto&`, `auto const&` and `auto&&` also
> work fine
> x = 10;
> y = 20;
> }
>
> for (auto&& [x, y] : boost::range::combine(v1, v2)) {
> x = 200;
> y = 200;
> }
>
>
FWIW, I just checked, and this works in the develop, but not master or
1.67.
-- chris
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net