Boost logo

Boost :

Subject: Re: [boost] Metaprogramming: parameter pack expansion/evaluation trick
From: TONGARI J (tongari95_at_[hidden])
Date: 2015-07-03 10:31:14


>
> namespace detail {
> struct expand_impl final {
> template <class... Arg>
> constexpr inline
> expand_impl(Arg&&...) noexcept
> {}
> };
> }
>
> template <class... Arg>
> using expand = detail::expand_impl;
>
> But unfortunately there's no way to force the compiler to evaluate
> expressions in constructor call from left to right. So it did not work on
> GCC (but work on Clang).
>

There is. Just use {} and it's guaranteed to evaluate the args from left to
right.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk