Boost logo

Boost :

Subject: Re: [boost] Is there any interest in a library for actor programming? [preliminary submission]
From: Larry Evans (cppljevans_at_[hidden])
Date: 2014-05-09 14:44:33


On 05/08/14 12:30, Dominik Charousset wrote:
[snip]
>
> [3] https://github.com/Neverlord/boost.actor/blob/a0cab41e2946df7d751c59dfead0c2122da0fb77/boost/actor/detail/int_list.hpp

https://github.com/Neverlord/boost.actor/blob/a0cab41e2946df7d751c59dfead0c2122da0fb77/boost/actor/detail/int_list.hpp#L83

uses a recursive call using a List<typename ...Ts> which is 1 shorter
than the argument list, List<T0, Ts...>.
Why not just pass sizeof...(T0, Ts...):

http://en.cppreference.com/w/cpp/language/sizeof...

and keep adding indices while decreasing this sizeof value,
as done here:

http://svn.boost.org/svn/boost/sandbox/variadic_templates/boost/mpl/package_range_c.hpp

in the package_range_c template class where:

     Start value would be 0
and Finish value would be sizeof...(T0, Ts...)

It achieves the same result, but without producing unneeded
instantiations. For example:

   package_range_c<std::size_t,0,sizeof...(mpl::vector<T0,T2,T3>>::type
   package_range_c<std::size_t,0,sizeof...(mpl::vector<S0,S2,S3>>::type

would produce 1 instantiation of:

   package_range_c<std::size_t,0,3>

whereas the int_list.hpp code would, IIUC, produce the same
instantiations for the T's as well as the S's.

-regards,
Larry


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