Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Range and initializer_list
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2018-04-18 19:02:39


Right, a full and comprehensive explanation. Many Thanks.

Kind Regards

Rob.

On 17 April 2018 at 12:17, Michel Morin via Boost-users <
boost-users_at_[hidden]> wrote:

> Robert Jones via Boost-users wrote:
> > for( int i : { 1, 2, 3 } | reversed ) { cout << i << " "; } // Bad
>
> Boost.Range is not relevant here (other than the prvalue problem).
> `{...} | ...` is not allowed in C++.
> See https://bugs.llvm.org/show_bug.cgi?id=13069
>
> In C++2a, you can use this
>
> for (auto rng = {...}; auto&& x : rng | ...) {...}
>
> thanks to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/
> p0614r1.html.
>
> Regards,
> Michel
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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